Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7509 +/- ##
=======================================
Coverage 99.61% 99.61%
=======================================
Files 283 283
Lines 11861 11877 +16
Branches 2895 2898 +3
=======================================
+ Hits 11815 11831 +16
Misses 46 46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates DrawTool’s keyboard interaction behavior and attempts to improve rectangle initialization when creating rect annotations, along with corresponding test updates.
Changes:
- Switch “large increment” arrow-key movement modifier from Shift to Ctrl/Cmd.
- Default rect annotations to start in keyboard “move” mode when no pending keyboard mode is set.
- Add logic to clear a keyboard-initialized rectangle when the user starts moving the mouse.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/annotator/test/draw-tool-test.js |
Updates keyboard movement tests to use Ctrl instead of Shift for large increments. |
src/annotator/guest.ts |
Changes how initialMode is chosen when starting drawing for rect annotations. |
src/annotator/draw-tool.tsx |
Updates large-increment modifier handling and adds “keyboard-initiated rect” state/behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
santicomp2014
left a comment
There was a problem hiding this comment.
Approved, this fixes the issues 1,2,3 for VPAT
This pull request improves the keyboard and mouse interaction logic for drawing rectangles in the annotation tool, clarifying the behavior when switching between input methods and updating keyboard shortcut conventions. It also adds new tests to ensure correct handling of keyboard-initiated rectangles.
https://github.com/orgs/hypothesis/projects/157/views/1?pane=issue&itemId=157872970
https://github.com/orgs/hypothesis/projects/157/views/1?pane=issue&itemId=157874357
https://github.com/orgs/hypothesis/projects/157/views/1?pane=issue&itemId=157876244
Keyboard and Mouse Interaction Improvements:
_rectInitiatedByKeyboardflag inDrawToolto track when a rectangle is created using the keyboard, and updated logic so that the first mouse move after keyboard initiation clears the rectangle and deactivates keyboard mode, allowing the user to seamlessly switch to mouse drawing. [1] [2] [3] [4] [5]Keyboard Shortcut Updates:
Sidebar and Annotation Creation Behavior:
Testing Enhancements: