feat: extend Delete key to single hotspots, sticky notes, and screen groups#1
Merged
trmquang93 merged 3 commits intomainfrom Mar 15, 2026
Merged
Conversation
…groups Delete/Backspace now handles all selectable canvas objects: - Single selected hotspot (hotspotInteraction.mode === "selected") - Selected sticky note - Selected screen group Adds selection state (selectedStickyNote, selectedScreenGroup) with visual feedback — glow ring on sticky notes, solid border on screen groups — and cross-selection clearing so only one object type is selected at a time. Canvas clicks and Escape also clear the new selections. Priority order: batch hotspots > single hotspot > connection > sticky note > screen group > screen. Adds 17 tests in useKeyboardShortcuts.test.js covering new behaviors, priority ordering, Backspace parity, and existing regression cases.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…e-key feature Resolves conflicts by keeping both feature sets: - Multi-select props (isMultiSelected, onToggleSelect, onMultiDragStart) for StickyNote - Rubber-band canvas selection with clearSelection/startRubberBand - Individual delete support (deleteHotspot, selectedStickyNote, selectedScreenGroup) preserved - Merged dependency arrays in useKeyboardShortcuts to cover both feature sets
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
hotspotInteraction.mode === "selected"); pressing Delete/Backspace now removes itselectedStickyNoteandselectedScreenGroupstate with cross-clearing — selecting any object deselects all others; canvas clicks and Escape also clear the new selectionsFiles changed
src/Drawd.jsxselected/onSelectprops, pass new props to hookssrc/components/StickyNote.jsxselected/onSelect; callonSelecton mousedown; show glow ring when selectedsrc/components/ScreenGroup.jsxselected/onSelect; callonSelecton label mousedown; solid border when selectedsrc/hooks/useKeyboardShortcuts.jssrc/hooks/useCanvasMouseHandlers.jssrc/hooks/useKeyboardShortcuts.test.jsTest plan
npm test— 229 tests passing, 0 failures