Repository navigation
fix: let Go-to's g i resume writing in the field its stance just shut - #6514
Merged
Merged
Conversation
Since #6461 a stance shuts the panel's field, and the field's `closed` read the stance from the repaint frame's copy (status-context.js). `g i` ends the Go-to stance and runs Resume writing in the same task, so `resumeAt` found the field still painted read-only and raised "That writing place is unavailable", though it then got focus and its draft. The field's `closed` now reads the stance from the dispatcher, as the repaint frame computes it, while the row's words (`still`) and the writing posture keep the frame's copy. `resumeAt` asks `takesNoWords` rather than the painted `readOnly`. Behavior change: Resume writing now reaches a box whose image is still uploading, which `readOnly` alone had refused. test_writing_reaches_the_field_however_the_panel_stands fails on main and passes with this change. Closes #6513
This was referenced Nov 19, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 23, 2026
… composing/input.js (#6907) The knip pre-commit hook printed import cycles and still passed, because knip grades `cycles` a warning by default and a warning doesn't set the exit code. So the cycle `browser/runtime/drafts.js` ↔ `browser/runtime/composing/input.js`, added in #6514, has stood on main with CI green. `.config/knip.js` now sets `rules: { cycles: "error" }`, which makes the hook do what its header and `browser/AGENTS.md` ("Runtime ownership") already said it did. The fix keeps `input.js` → `drafts.js` (the box wiring is a view of the draft store) and drops `drafts.js` → `input.js`. Resume writing needed `takesNoWords` to ask whether the box it reaches takes words now. Instead, a draft subscription now carries that answer (`closed`, default false), `mirrorDraft` passes the wiring's own `sync.closed`, and `resumeAt` asks the editor it found. The only boxes that supply `closed`, the floating panel's field and its thread replies, both register through `mirrorDraft`, so Resume writing answers as before. To weigh: `watchDraft` is in the public widget API, so it gains an undocumented `closed` option, like its existing `resume` and `mirrored`. Checks: knip exits 0 on this branch and 1 with the import restored; dependency-cruiser, `pnpm run check:browser`, and the runtime tests for drafts, composing-input, message-edit, words-watch and annotation-inventory pass; a `leaf-dev probe` journey resumes a page draft and a closed thread's reply through `g i`. Found while porting deslop-please's lints to Leaf. > _This was written by Claude Code on behalf of max-sixty_
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.
g i(Go-to, then Resume writing) raised "That writing place is unavailable" even though the field then got focus and its draft. #6461 made a stance shut the panel's field, and the field'sclosedread the stance from the repaint frame's copy (statusContextReading().stance). The Go-to destination ends the stance and runswriting.resumein the same task, before that frame. SoresumeAtsaw the field's paintedreadOnlystill set and raised the error.The field's
closednow reads the stance from the dispatcher (stanceWords(innermostStance()?.scope)), the same thingpaintStatusContextcomputes. The row's words (still) and the writing posture keep the frame's copy, so #6461's decision that the field and the row's ✕ change in the same paint still holds for what is painted.resumeAtnow askstakesNoWords(field)instead of the paintedreadOnly. That also covers any other Go-to destination that writes into the field in the same task.One behavior moves beyond the failing case.
readOnlyis also set while an image uploads, so Resume writing used to refuse a box with an upload in flight. It now moves the caret there.takesNoWords's own comment already says that box stays onecmay move to.test_writing_reaches_the_field_however_the_panel_standsfails onmain(2cd1bda49) with the error's count at 1 and passes on this branch. The panel tests matching stance, mode, Escape, resume and writing pass, and so dopnpm run test:runtimeandpnpm run check:browser.Closes #6513 — automated triage