Skip to content

fix: empty-canvas nudge stays gone once a tool is armed - #565

Merged
vibhavkatre merged 1 commit into
frappe:mainfrom
bvnaik05:564-empty-nudge-armed-tool
Sep 1, 2026
Merged

fix: empty-canvas nudge stays gone once a tool is armed#565
vibhavkatre merged 1 commit into
frappe:mainfrom
bvnaik05:564-empty-nudge-armed-tool

Conversation

@bvnaik05

Copy link
Copy Markdown
Contributor

Summary

  • Fixes Empty-canvas 'Nothing here yet' nudge reappears after arming and unarming a tool #564: the block/unified canvas "Nothing here yet" nudge only checked canvas emptiness, so it ignored tool-arming state and reappeared after arming a tool and then unarming back to select on an empty canvas.
  • useEditorUi now latches state.hasArmedTool = true the first time any tool is armed (setTool to non-select, setDrawShape, armStarter, armComment) and never resets it.
  • blockEmpty in DiagramCanvas.vue now returns false once hasArmedTool is 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 new hasArmedTool cases in useEditorUi.test.js
  • yarn build — succeeds
  • Manually verified in the running app: nudge shows on a fresh empty diagram, disappears immediately on arming the Quadrilateral shape tool, and stays hidden after switching back to Select with the canvas still empty

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.
Copilot AI lite review requested due to automatic review settings August 28, 2026 06:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The 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 vibhavkatre left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@vibhavkatre
vibhavkatre merged commit 8f5f791 into frappe:main Sep 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty-canvas 'Nothing here yet' nudge reappears after arming and unarming a tool

3 participants