fix: empty-canvas nudge stays gone once a tool is armed - #565
Conversation
The "Nothing here yet" hint only checked canvas emptiness, so it ignored tool arming and reappeared after arming then unarming back to select on an empty canvas. editorUi now latches hasArmedTool on first arm (draw shape, starter, or comment) and never resets it; blockEmpty reads that latch so the nudge disappears for good.
Confidence Score: 5/5The PR appears safe to merge. The latch is consistently applied across tool-arming paths and the empty-state behavior matches the changed tests without an established failure. Reviews (1): Last reviewed commit: "fix: empty-canvas nudge stays gone once ..." | Re-trigger Greptile |
vibhavkatre
left a comment
There was a problem hiding this comment.
Correct fix, and the latch is documented where it matters. Checked that createEditorUi() is per-page (EditorShell.vue:47, ViewerPage.vue:31), so hasArmedTool is scoped to one editor session and a freshly opened diagram still gets its nudge.
The product call the comment makes — a first-run nudge, not a persistent empty state, so it stays gone even after the canvas is emptied again — is the right one and is written down where the next reader will find it.
Merging.
Summary
useEditorUinow latchesstate.hasArmedTool = truethe first time any tool is armed (setToolto non-select,setDrawShape,armStarter,armComment) and never resets it.blockEmptyinDiagramCanvas.vuenow returnsfalseoncehasArmedToolis set, so the nudge disappears immediately on first arm and stays gone for the rest of the session, even after unarming.Test plan
yarn test— all 150 files / 1743 tests pass, including newhasArmedToolcases inuseEditorUi.test.jsyarn build— succeeds