Skip to content

Show the Canvas leave guards above the note panel - #372

Merged
byronwall merged 2 commits into
mainfrom
claude/fervent-franklin-87347d
Nov 29, 2026
Merged

byronwall merged 2 commits into
mainfrom
claude/fervent-franklin-87347d

Conversation

@byronwall

@byronwall byronwall commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

On Canvas, the "Discard unsaved changes?" and "Note is saving" dialogs now show above the open note. The two Canvas panel browser tests that timed out now pass.

Before: The note panel covered the right side of the dialog, including most of Discard changes.
After: The whole dialog is on top, and both buttons work.

Cause

canvas.tsx kept both dialogs mounted from page load, so the note panel opened over them. They now mount only when shown, as the panel's own guard already does.

The tests were also out of date, which hid this:

  • They clicked a backdrop. The Canvas panel has had none since fe83ffd9 made it non-modal on purpose, so the click reached the sidebar's People link. They now try to leave by opening another note from search.
  • Autosave (1.5 s) saved the draft while the test checked the guards. The two cases that need an unsaved draft now turn off that one timer.
  • The save test held updateDoc. The editor now saves with saveDocContent.
  • The "discarding must not save" check could not fail: in Chromium, request.postData() is null without a page route. With autosave let through, it counted 0 saves without a route and 1 with one.

Proof

Same step in the spec at 1280×720: type, then open another note from search.

Before After
before after

The "before" image has the updated spec and the old canvas.tsx. The spec clicks Discard changes, so it fails if the panel covers the dialog again.

playwright test canvas-note-panel --repeat-each=3 --workers=1 against the audit harness (pnpm dev):

12 passed (54.0s)

pnpm lint exits 0, pnpm type-check passes, pnpm test: 925 passed, 86 skipped.

Limits

  • CI skips this spec because it needs an audit run.
  • The turned-off timer is matched by its 1500 ms delay. If the delay changes, update the constant in the spec.
  • No Codex review: this changes where two dialogs mount, not core logic.

The path editor test that also timed out is fixed in #373.

🤖 Generated with Claude Code

byronwall and others added 2 commits November 28, 2026 22:10
The discard and saving dialogs in canvas.tsx were always mounted, so the
note panel's portal landed over them and hid "Discard changes". Mount them
on demand, as DocumentSidePanel does for its own guard.

Update canvas-note-panel.spec.ts for the non-modal panel, autosave, and the
saveDocContent action.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Without a page route, request.postData() was null for server-action requests,
so the check could not fail.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@byronwall

Copy link
Copy Markdown
Owner Author

Review (code-review, medium): no blocking findings. Left as is:

  • nit, unverified: the on-demand dialogs in canvas.tsx may skip their exit animation and focus return.
  • nit: holdAutosave drops every 1500 ms timeout on the page, not only autosave.

@byronwall
byronwall merged commit 9632c23 into main Nov 29, 2026
5 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.

1 participant