-
Notifications
You must be signed in to change notification settings - Fork 46
Add hotkey to assign empty label #1414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new hotkey ('n') to assign an empty label to selected annotations in the annotator interface. This feature enables users to quickly assign empty labels without manually clicking through the UI.
Key changes:
- Added 'empty-label' hotkey action type and default key binding ('n')
- Implemented hotkey handler that assigns empty label to selected annotations when triggered
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| web_ui/src/pages/annotator/providers/annotator-provider/utils.ts | Added 'empty-label' to HotKeyActions type and DefaultHotkeys configuration with 'n' key binding |
| web_ui/src/pages/annotator/components/primary-toolbar/hot-keys-button/use-availability-of-hotkeys.hook.ts | Enabled the 'empty-label' hotkey by setting its availability to true |
| web_ui/src/pages/annotator/components/main-content/labels-shortcuts/labels-shortcuts.component.tsx | Implemented the hotkey handler that finds the empty label and assigns it to selected annotations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
web_ui/src/pages/annotator/providers/annotator-provider/utils.ts
Outdated
Show resolved
Hide resolved
| (event) => { | ||
| event.preventDefault(); | ||
|
|
||
| if (emptyLabel && selectedAnnotations.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the check being made on the selected annotations? For detection and segmentation the empty label can also be when the user has no annotations selected - for local annotation projects we always replace the whole scene with a single "full image" annotation that only has the empty label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True! I wasnt 100% sure. Updated :)
📝 Description
✨ Type of Change
Select the type of change your PR introduces:
🧪 Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
✅ Checklist
Before submitting the PR, ensure the following: