Skip to content

Conversation

@TrevorBurgoyne
Copy link
Member

@TrevorBurgoyne TrevorBurgoyne commented Oct 30, 2025

Keybinds

Description

  • Add collapsible toolbox with arrow button at top
    • Toolbox collapse state persists in browser
    • Annotation canvas expands to fill space when toolbox is collapsed
  • Add Keybinds toolbox item for viewing and customizing keybinds
    • Display all configurable keybinds with labels and descriptions
    • Edit keybinds by clicking and pressing new key combination
    • Support for modifier key chords (shift, ctrl, alt, meta)
    • Collision detection with red highlighting for duplicate keybinds
    • Reset individual keybinds or all keybinds to defaults
    • Visual indicator (yellow highlight) for user-customized keybinds
    • User keybind settings persist in browser
    • Closes Keybinds document or in-tool display #225
  • Rename create_bbox_on_initial_crop to create_bbox_on_initial_crop_keybind for consistency
  • Split change_zoom_keybind into two separate keybinds:
    • reset_zoom_keybind (default: r) - Reset zoom to fit image
    • show_full_image_keybind (default: shift+r) - Zoom to show full image
  • Removed "default_keybinds" object in configuration. Each keybind in that object is now accepted directly
  • Store collapse/expand state for Keybinds, Annotation List, and Image Filters toolbox items
  • Add comprehensive e2e tests for keybind functionality and keybind toolbox item

PR Checklist

  • Merged latest main
  • Version number in package.json has been bumped since last release
  • Version numbers match between package package.json and src/version.js
  • Ran npm install and npm run build AFTER bumping the version number
  • Updated documentation if necessary (currently just in api_spec.md)
  • Added changes to changelog.md

Breaking API Changes

  • Changes to the names of some keybinds:
    • Rename create_bbox_on_initial_crop to create_bbox_on_initial_crop_keybind for consistency
  • Split change_zoom_keybind into two separate keybinds:
    • reset_zoom_keybind (default: r) - Reset zoom to fit image
    • show_full_image_keybind (default: shift+r) - Zoom to show full image

@TrevorBurgoyne TrevorBurgoyne added the enhancement New feature or request label Oct 30, 2025
Copy link
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

This PR implements a comprehensive keybind management system with a dedicated toolbox item for viewing and customizing keyboard shortcuts. The toolbox becomes collapsible to provide more workspace, and keybind configurations are split and renamed for clarity.

Key changes:

  • Added collapsible toolbox with persistent state and a new Keybinds toolbox item for viewing/editing shortcuts
  • Split change_zoom_keybind into reset_zoom_keybind and show_full_image_keybind
  • Renamed create_bbox_on_initial_crop to create_bbox_on_initial_crop_keybind for consistency

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/testing-utils/annotation_utils.js Adds helper to extract class ID from annotations
tests/e2e/keybinds.spec.js E2E tests for keybind toolbox UI features
tests/e2e/keybind-functionality.spec.js E2E tests verifying each keybind works correctly
src/toolbox_items/keybinds.ts New toolbox item for keybind management with editing and persistence
src/toolbox_items/image_filters.ts Adds collapse state persistence
src/toolbox_items/annotation_list.ts Adds collapse state persistence
src/toolbox.ts Adds collapsible toolbox UI and updates keybind references
src/listeners.ts Refactors keybind handling to support chords and new keybind names
src/initializer.ts Restores custom keybinds from localStorage on init
src/index.js Adds keybind editing state flag
src/configuration.ts Updates keybind config properties and adds dynamic keybind key enumeration
src/blobs.js Adjusts toolbox header flex sizing
demo/multi-class.html Updates demo with new keybind property names
api_spec.md Documents new keybind configuration properties
.github/tasks.md Task tracking for implementation
.github/copilot-instructions.md Updates coding guidelines

@TrevorBurgoyne TrevorBurgoyne linked an issue Nov 3, 2025 that may be closed by this pull request
Copy link
Collaborator

@joshua-dean joshua-dean left a comment

Choose a reason for hiding this comment

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

Toolbox collapse is a bit clunky.
Keybind functionality looks great though 👍

Comment on lines +2 to +10
- [x] Add a sideways, clickable arrow to minimize the entire toolbox
- [x] Add collapse button to toolbox HTML
- [x] Add CSS styles for collapsed state
- [x] Add click handler to toggle collapsed state
- [x] Store collapsed state in localStorage
- [x] Test functionality
- [x] Move arrow to top of toolbox (instead of middle)
- [x] Make annbox expand when toolbox is collapsed
- [x] Make collapsed button visible
Copy link
Collaborator

Choose a reason for hiding this comment

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

On my machine, this just expands the window sideways and adds a scrollbar on the bottom:
scrollbar

Hovering annotations will cause the dual-highlight functionality of the annotation list to trigger, and scroll sideways to bring the toolbox into view. Ideally this would physically collapse the toolbox instead of expanding like this.

Copy link
Member Author

@TrevorBurgoyne TrevorBurgoyne Nov 12, 2025

Choose a reason for hiding this comment

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

ive tried reworking this a bit, should definitely not do the "scroll to annotation list" when collapsed anymore. and now the toolbox should be fully hidden and not just partially obscured

Base automatically changed from feature/annotation-list to main November 17, 2025 16:56
@TrevorBurgoyne TrevorBurgoyne merged commit 2904229 into main Nov 17, 2025
3 checks passed
@TrevorBurgoyne TrevorBurgoyne deleted the feature/keybinds branch November 17, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keybinds document or in-tool display

3 participants