fix: Support ctrl/cmd+s hotkey for submitting annotations/predictions#6490
Merged
Conversation
jpggvilaca
approved these changes
May 15, 2026
Contributor
There was a problem hiding this comment.
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
submithotkey (Ctrl/Cmd+S) and include it in the sharedCOMMON_HOTKEYSset. - Wire the new hotkey in
SecondaryToolbarto callhandleSubmitPredictionsin prediction mode andhandleSubmitotherwise, gated by the existingisSubmitDisabledflag. - 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] | ||
| ); |
🐳 Docker image sizes
|
📊 Test coverage report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix #6380
How to test
Checklist