Skip to content

fix: Support ctrl/cmd+s hotkey for submitting annotations/predictions#6490

Merged
dwesolow merged 2 commits into
developfrom
dwesolow/6380-submit-annotation-hotkey
May 18, 2026
Merged

fix: Support ctrl/cmd+s hotkey for submitting annotations/predictions#6490
dwesolow merged 2 commits into
developfrom
dwesolow/6380-submit-annotation-hotkey

Conversation

@dwesolow
Copy link
Copy Markdown
Contributor

Summary

Fix #6380

How to test

Checklist

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

@dwesolow dwesolow self-assigned this May 15, 2026
Copilot AI review requested due to automatic review settings May 15, 2026 11:57
@dwesolow dwesolow requested a review from a team as a code owner May 15, 2026 11:57
@github-actions github-actions Bot added the Geti UI Issues related to Geti application frontend label May 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Ctrl/Cmd+S keyboard shortcut for submitting annotations or predictions in the media preview secondary toolbar, addressing a user-experience request to avoid round-trips between the labels panel and the Submit button.

Changes:

  • Define a new submit hotkey (Ctrl/Cmd+S) and include it in the shared COMMON_HOTKEYS set.
  • Wire the new hotkey in SecondaryToolbar to call handleSubmitPredictions in prediction mode and handleSubmit otherwise, gated by the existing isSubmitDisabled flag.
  • Surface the new shortcut at the top of the in-app hotkeys help list.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
application/ui/src/shared/hotkeys-definition.ts Adds submit: Ctrl/Cmd+S to HOTKEYS and to COMMON_HOTKEYS so it propagates to per-task hotkey maps.
application/ui/src/features/dataset/media-preview/secondary-toolbar/secondary-toolbar.component.tsx Registers useHotkeys for the submit shortcut, dispatching to prediction or annotation submission depending on mode.
application/ui/src/features/dataset/media-preview/primary-toolbar/hotkeys/hotkeys-list.component.tsx Lists the new submit hotkey in the user-facing hotkeys help panel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +129 to +135
if (isPredictionMode) {
handleSubmitPredictions();
} else {
handleSubmit();
}
},
{ enabled: !isSubmitDisabled },
handleSubmit();
}
},
{ enabled: !isSubmitDisabled },
Comment on lines 98 to +137
const handleSubmit = async () => {
await submitAnnotations(subset);
onSelectNextMediaItem();
};

const handleSubmitPredictions = async () => {
await submitPredictions(subset);
onSelectNextMediaItem();
};

const isClassification = isClassificationTask(selectedProject.task.task_type);
const isMultiLabelClassification = isMultiLabelClassificationTask(selectedProject.task);

const handleDeleteItem = ([deletedItem]: string[], totalItems: number) => {
const deletedIndex = items.findIndex((item) => item.id === deletedItem);
const nextItem = getNextItem(totalItems - 1, deletedIndex);

onSelectedMediaItem(items[nextItem]);
};

const isPredictionMode = mode === 'prediction';
const isAnnotationMode = mode === 'annotation';

// If annotations are not changed but subset has changed we want to allow user to submit
const isSubmitDisabled = (!canSubmit && !hasSubsetChanged) || isSaving || isLoadingPredictions;

useHotkeys(
HOTKEYS.submit,
(event) => {
event.preventDefault();

if (isPredictionMode) {
handleSubmitPredictions();
} else {
handleSubmit();
}
},
{ enabled: !isSubmitDisabled },
[isSubmitDisabled, isPredictionMode, handleSubmitPredictions, handleSubmit]
);
Comment on lines +124 to +137
useHotkeys(
HOTKEYS.submit,
(event) => {
event.preventDefault();

if (isPredictionMode) {
handleSubmitPredictions();
} else {
handleSubmit();
}
},
{ enabled: !isSubmitDisabled },
[isSubmitDisabled, isPredictionMode, handleSubmitPredictions, handleSubmit]
);
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

🐳 Docker image sizes

Device Size
cuda 9783.2 MB (9.55 GB)
xpu 10578.6 MB (10.33 GB)
cpu 3588.0 MB (3.50 GB)

@github-actions
Copy link
Copy Markdown

📊 Test coverage report

Metric Coverage
Lines 59.8%
Functions 80.6%
Branches 88.0%
Statements 59.8%

@dwesolow dwesolow added this pull request to the merge queue May 18, 2026
Merged via the queue into develop with commit ad79ff6 May 18, 2026
38 checks passed
@dwesolow dwesolow deleted the dwesolow/6380-submit-annotation-hotkey branch May 18, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Geti UI Issues related to Geti application frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add hotkey to submit annotation

3 participants