Skip to content

Show Tool-reported unsaved changes on Panes and Doors - #676

Open
nedtwigg wants to merge 17 commits into
dor-tool-qcfrom
dor-tool-dirty
Open

nedtwigg wants to merge 17 commits into
dor-tool-qcfrom
dor-tool-dirty

Conversation

@nedtwigg

@nedtwigg nedtwigg commented Sep 16, 2026

Copy link
Copy Markdown
Member

Tools can report unsaved changes using OSC 367;state;{"v":1,"dirty":true|false}. A reported dirty state adds an accessible dot to the Tool's Pane header and minimized Door, including narrow browser headers.

Dirty reports leave serving/browser state intact. The last report remains after command exit; a new command, restart, or takeover resets it to unknown. Ordered replay and live Workspace transfer preserve state, while durable session storage omits it. Ordinary terminals do not acquire Tool UI from state reports. This PR adds indication; Save and close protection remain future work.

Validation: the full root pnpm test suite passes, including the integrated parent changes and corrected quit-confirmation fixture. The association follow-up passes 51 registry/open tests at a37a53dd. The final shared-header and focus follow-up at 051dc052 passes 133 header/state/parser tests (including content-resize popover positioning). The final test/spec-only parent merge at 801e039e passes 47 header tests and spec lint; production code is unchanged from the bot-approved, CI-green 051dc052; library, standalone, and VS Code typechecks, spec lint, and loopback lint pass. The earlier dirty-specific pass covered 404 focused tests, including fixed-width dirty updates across the header action thresholds. Dirty transitions preserve focus when controls move in either direction, without stealing unrelated focus or focusing hidden Surfaces. Claude simplify is incorporated (88a19abb), and independent review found no remaining correctness issue. docs/testing/dor-tool-dirty.md records the earlier live innerdogfood checks; this follow-up used automated checks only.

Stack predecessor: #675 (dor-tool-qc). Merge after QC and its predecessors: #493#514#668#669#670#675 → this PR.

nedtwigg and others added 5 commits September 16, 2026 10:47
# Conflicts:
#	docs/specs/layout.md
#	lib/src/components/wall/SurfacePaneHeader.test.tsx
#	lib/src/components/wall/SurfacePaneHeader.tsx
One recorder, `recordToolEvents`, feeds both Tool stores in stream order
from every replay seam; OSC 367 verbs share one bounded payload parser.
Dirty resets leave the generic pane-state store: disposal clears beside
the announce store in teardown and discarded arrivals, synthetic starts
reset at their two producers. `useToolDirty` owns the Tool gate and
returns the boolean both headers need; ordinary panes never subscribe.
Baseboard reads a copy-on-write snapshot like its sibling stores. Tests
use the new `resetToolDirty` seam; the duplicate Chromatic story is gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…-dirty

# Conflicts:
#	docs/specs/layout.md
#	lib/src/components/wall/SurfacePaneHeader.test.tsx
#	lib/src/components/wall/SurfacePaneHeader.tsx
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 16, 2026

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: d15fe52
Status: ✅  Deploy successful!
Preview URL: https://424a7d3d.mouseterm.pages.dev
Branch Preview URL: https://dor-tool-dirty.mouseterm.pages.dev

View logs

# Conflicts:
#	scripts/loopback-lint.mjs
#	scripts/spec-word-budgets.json
#	standalone/src/workspace-move.ts
@nedtwigg
nedtwigg marked this pull request as ready for review September 16, 2026 23:53

@dormouse-bot dormouse-bot 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.

Draft feedback on work in progress, not a merge verdict — mark it ready when you want the full pass.

Two points, both inline: one interaction at the new tight band, one spec sentence.

Comment thread lib/src/components/wall/SurfacePaneHeader.tsx
Comment thread docs/specs/dor-tool.md Outdated

@dormouse-bot dormouse-bot 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.

The dismissal added at 7e9a0013 covers the popover → header direction; the
reverse still drops focus. That and one cleanup, both inline.

Comment thread lib/src/components/wall/SurfacePaneHeader.tsx Outdated
Comment thread lib/src/lib/tool-announce.ts Outdated
…-dirty

# Conflicts:
#	docs/specs/layout.md
#	lib/src/components/wall/SurfacePaneHeader.test.tsx
dormouse-bot
dormouse-bot previously approved these changes Sep 17, 2026

@dormouse-bot dormouse-bot 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.

Nothing new on the PR side since 00f980b3 — the three commits since are base
merges of dor-tool-qc. One point from the last round is still live and the
thread it was raised in has been resolved, so it is here instead: the
popover-dismissal rule in docs/specs/layout.md is narrower than the code it
describes. Inline, word-neutral.

Comment thread docs/specs/layout.md Outdated
@dormouse-bot
dormouse-bot dismissed their stale review September 17, 2026 02:29

Superseded by the review on a later commit.

# Conflicts:
#	lib/src/components/wall/SurfacePaneHeader.tsx
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.

2 participants