Repository navigation
Say a file editor's failure and conflict in its header status - #2867
Merged
Merged
Conversation
A save failure and a conflict with another writer used to open a pane below
the editor holding the error, the choices and the comparison. It took the
editor's room as each problem arrived, a failure turning into a conflict
moved it again, and its `min(50%, 20rem)` cap resolved against an auto grid
row, so the pane clipped its own content.
Both now stand in the header's status slot, where "Saving changes…" already
sits, and the editor's top and height measure the same in every state. A
failure reads "Not saved · Retry", the error as the status's tooltip and
Retry's description. A conflict reads "Changed on disk" in the warning tone;
that one control opens a native popover menu (Compare, Save draft, Use file
version) that the keyboard walks with the arrows and leaves with Escape or
Tab, handing the reader back to the control. Compare opens the comparison
below the editor on the reader's press, and the host's grid gives it half
the editing room through a `comparing` custom state, so it sizes against a
definite row. "Save my version" is now "Save draft".
The status presses take no block aim floor, which would grow the header as
they arrive; each spans the header's full height through its padding.
Failures and conflicts are announced once each through the page's live
region (`announce`), replacing the widget's own alert and status regions.
`boundFile` gives a request that got no answer its own sentence in place of
the engine's ("Failed to fetch"), so "The draft is kept." follows a full
stop, and drops the draft clause it duplicated on a layer change.
Landing the reader back in the editor reveals the caret, since its room may
have shrunk under it while they stood in the menu.
Adds the stability rule this applies to `assets/AGENTS.md`: an unlikely
event fits into what is already there.
Tests: the in-flight save journey measures the editor's room through a
failure and a conflict (it failed on main, where the pane took 92px), drives
the conflict through the menu by pointer and keyboard, and opens Compare.
The file-editor `grows-with-content` known finding is fixed and removed.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…keys in its menu A Save draft that got no answer hid "Changed on disk" behind "Not saved · Retry", stranding Use file version and the open comparison's Compare toggle. The conflict control now stays whenever a disk version waits, carrying the failure as its description; Save draft is its retry. Pressing a page key such as `c` inside the conflict menu reached the page while the menu stayed open. Leaf's own menus claim every key but the command reference through a page scope; an element scope had no way to say the same. `commandsOn` and `commands` now take a `claims` option, and the widget API exports `allButCommandReference` for it (module-input.md, "How scopes compose"). A failure answered by a page without the server's words, such as a proxy's 502, read "file: HTTP 502" before "The draft is kept." `requestJson` keeps the server's own words as `said`, and `boundFile` gives a status-only answer its own sentence. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
With the pane gone, an editor that could read no file (an export, an unbound page) said why only in the status's tooltip, which a finger and the keyboard cannot reach. The empty editor now shows the reason as its CodeMirror placeholder, in the room it already has. The CodeMirror bundle exports `placeholder` for it (+1 KB). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
After a failed Save draft the header still read "Changed on disk", so a pointer or touch user saw the menu close and nothing change. The control now reads "Not saved" while the failure stands, opening the same choices; the slot's one line has no room for both words. A server answer that does not parse now reads as a failure sentence rather than "answered HTTP 200". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 14, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 14, 2026
…aim after updated A failed draw replaced the render root's children with the fail-soft box, so a widget that paints retained nodes, as lf-options paints its authored options, had nothing to draw on afterwards: the next reading removed the box and left the options gone. The box now stands at the head of the render root beside what the element drew, and the next update that draws takes it away (`placesFailure` in widget-upgrade.js, which a LeafElement registers). The same placement takes a rejected `present()` preparation and a module's own `failSoft(this, …)`, which had replaced a shadow widget's whole stage and detached its render root. A `setup()` that throws shows its failure and the element draws nothing after it, so lf-file-editor-style builds need no catch of their own. An update's claim now moves at its gate and settles once Lit has run all of it, `updated` included; a failure anywhere, `willUpdate` too, rejects it rather than the coordinator recording a commit before work after the draw failed (leaf-agent's finding). A draw nested in another's `updated` with no claim of its own fails the enclosing one. The hold is one flag, since the controller's `defer()` refuses a second, and the refresh is a private method rather than a symbol. lf-file-editor.js takes prettier's indentation after the merge of #2867. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
A file editor's save failure and its conflict with another writer now say so in the header's status slot, where "Saving changes…" already sits, instead of in a pane that opened below the editor. The editor's top and height measure the same at rest, on a failure and on a conflict. This is the design the maintainer chose for unit 57 of the Lit follow-up review, and it adds the UI principle behind it to
skills/leaf/assets/AGENTS.md.Unit 57: where
lf-file-editorshows a failure and a conflictBehaviour that changed
--warn-ink,--warn-tintunder the pointer). That one control opens a nativepopover="auto"menu with Compare, Save draft (was "Save my version") and Use file version.rowWalk+rove). Escape, or a choice, puts it away onto its control (closeLayer+handBack). Tab leaves the menu as it leaves a menu button's menu, and a press elsewhere dismisses it.comparingcustom state gives the comparison half of the host's grid, so it sizes against a definite row rather than the oldmin(50%, 20rem)cap on an auto row.announce). This replaces the widget's own alert and status regions.boundFileturns every failure into a sentence, so "The draft is kept." follows a full stop. A request with no answer reads "The page's server did not answer."; a status-only answer reads "…answered HTTP 502."; an unreadable answer has its own sentence.requestJsonnow keeps the server's own words assaid.Runtime additions this needed
claimsoption (keyboard/scopes.js).allButCommandReference, documented in module-input.md, "How scopes compose". Before this, only Leaf's page-scope menus could hold the page's keys.placeholder(+1 KB, rebuilt).Line deltas
lf-file-editor.js(+193/−63) and itsshadow.css(+80/−15).Tests
test_file_editor_saves_quietly_and_preserves_inflight_editsmeasures the editor's room through a failure and a conflict. It failed on main, where the pane cut the editor from 547px to 455px.cheld);grows-with-contentknown finding no longer occurs, so it is deleted.Stability principle
The new bullet is "An unlikely event fits into what is already there." It sits beside "Generated interface first appears in its settled position", and says that bullet covers interface that ordinary use brings.