Repository navigation
Stand an error over the box it is about, and lift it when g i comes back - #3246
Conversation
An error about a text field covered that field's words only in the floating panel, which drew its own cover over its own editor. A refused send from a passage's comment box, or an image a box would not take, showed only as the leaf's dot, so nothing said the words had come back. And Resume writing put the caret in covered words without lifting the cover, so Enter and Send did nothing until the user typed. The cover now belongs to the shared editor (composing/input.js): every wired box shows the newest error about it over its words and actions, wrapping within its lines, and sends nothing until the user comes back to them by an edit, a paste, or a press on the cover. Resume writing passes the errors about the box it lands in through the same call (errors.js, `passErrorsAt`), and words a refusal hands back are resumed at their end, so Enter sends them. The panel keeps only what is its own: saying an error about nothing in its empty field. The leaf's dot now waits for errors no box on screen shows. Behavior changes in tests: after g i over refused words the cover is gone, the error is in the menu and Enter sends; a refused selection comment, an image the options Add field refuses, and an image that lost its passage all stand over their box before they wait in the menu. The cover's class is `.lf-compose-error`, wherever it stands. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/kernel/kernel.json
…ck to them Review of the cover found four gaps, each fixed where it starts: - A capture into a covered box was dropped silently: only a paste passed the box's errors before `addMedia`'s guard. Attaching now passes them inside `addMedia`, the one path paste and capture share. - The cover keyed on the box's node, and one passage composer serves every passage, so a refused comment's error outlived Escape (the leaf's dot stayed off with nothing on screen saying it) and covered the empty box on the next passage. A box now passes its errors when it takes up another draft (`sync.arrive`) and when it stops showing them, hidden or taken from the page (a size observer on each covered box, and the box's own paint for one already out of sight). Passing publishes, so the dot follows, and `standsAtItsBox` no longer reads visibility. - Resume writing into words a refusal returned to a box still on screen landed at the caret the send left; every returned writing place now resumes at the words' end. - The cover's clip held to whole lines only at the default line height. Its words now stop at `round(down, 100%, 1lh)` of the box's room. Tests: a refused comment's error leaves with Escape, and the box on another passage is free of it, its words clipped at a whole line; g i lands at the end of refused words sent with the caret at their start; a capture lands in a box an error stood over. The refused-reply journey now lifts the cover by a press before its retry in every place, not only the panel: the cover stands over a reply box in a card or outlet too, and a focus() is no gesture of the user's, so its Enter sent nothing (the CI failure on #3246; the shift it reported came from the failed retry's teardown, not from the cover). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A keyboard user in a covered box could lift the cover only by editing: Enter was swallowed with no feedback, so there was no keyboard route to resend the same words. Any key pressed in a covered editor now lifts it, as a press does. A key that edits or moves the caret keeps its meaning. A send key, and Send reached by the keyboard under the cover, only lifts it, with the caret at the words' end, so nothing is sent unseen and the next Enter sends. A modifier alone, Tab and Escape do not lift it. The press, the send key and the Send control share one `uncover`. Tests: the first Enter in a covered box lifts the cover and sends nothing, and the second sends (the refused selection comment, the panel's field); the refused-reply journey is back to its focus-then-Enter shape, with one Enter more. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/kernel/kernel.json
leaf-agent
left a comment
There was a problem hiding this comment.
The PR description's final paragraph says Enter and arrow keys do not lift the cover. In wireInput, a non-send key passes the error and a send Enter calls uncover(); the updated refused-comment test also expects Enter to lift it. Please correct that paragraph before it becomes the squash commit message.
# Conflicts: # skills/leaf/kernel/kernel.json
# Conflicts: # skills/leaf/assets/runtime/floating-panel.js # skills/leaf/kernel/kernel.json # skills/leaf/kernel/leaf.js
leaf-agent
left a comment
There was a problem hiding this comment.
The current head's CI fails the keyboard register contract: wireInput adds a capturing keydown listener to every text box, while test_the_register_is_the_only_way_a_key_enters_the_runtime finds input.js outside the command register. This listener can consume Enter before the registered text-box command sees it, leaving the displayed shortcut and its behavior with separate owners. Move the covered-box key behavior into the existing keyboard scope and keep the register as the owner of the send key.
The any-key lift added a raw keydown listener in composing/input.js, a key path behind the register's back (test_the_register_is_the_only_way_a_key_ enters_the_runtime). It is gone. A covered box now lifts its cover from what already reports the key: - a send key reaches the box's own send binding (`text.send`), whose `pressed` lifts the cover and sends nothing, as Send reached by the keyboard already did, so the ? reference gains no row; - an edit arrives as `lf-before-edit`, as before; - a caret move arrives as `lf-caret-move`, which the text field now fires for a user selection change that edits nothing (CodeMirror's `select` user event); a write to the selection triple fires nothing. A modifier alone, Tab and Escape neither edit nor move the caret, so none of them lifts the cover. The capture test attaches on the drag's lift: main removed Attach capture (#3262), which is why it timed out waiting for that button. The panel's error test also checks that a caret key lifts the cover and moves the caret. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/kernel/kernel.json
… thread's view away (#3298) A selection the page's text can't name again, such as one running into a suggestion, has a detached anchor: only the browser's Range knows where its words stand. The placement dropped that Range whenever the box went down, so the box a refusal reopened stood in the unanchored window posture, in the window's top-left corner. The Range now stays with its anchor across the box's tenures, while its endpoints survive and it still reads as the quote, so a refused send's box, and Resume writing, stand beside the words again. Such a thread has no card beside its passage, so the send opened it in the panel, and the refusal left that view saying "This thread is not on the page." A thread view now goes whenever the reading no longer holds its thread, as a margin card does, whoever opened it, an undone comment's included (untested). The panel's own page-comment refusal keeps only its caret rule on top of that, and the unreachable "not on the page" text is gone. Behavior changed: a refused detached comment reopens beside its passage with no panel view (test_a_refused_detached_comment_reopens_beside_its_words). Found while building the shared error cover (#3246). > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Two picks from the floating-panel review page,
fix-giandfix-outside, share one cause: an error about a text field covered that field's words only in the floating panel, which drew its own cover over its own editor. A refused send from a passage's comment box, or an image a box would not take, showed only as the leaf's dot, andg iput the caret in covered words without lifting the cover, so Enter and Send did nothing until the user typed.The cover now belongs to the shared editor (
composing/input.js,wireInput), so the panel's field, a passage's comment box, thread replies and the options Add field get the same code: the newest unhandled error about that box covers its words and actions, wrapping within the box's lines, until an edit, a paste or a press on it.g ipasses the box's errors through the same call a press uses (errors.js,passErrorsAt), and handed-back words resume with the caret at their end. The panel's own cover is deleted; it keeps only saying an error about no box in its empty field. The leaf's dot waits for errors no box on screen shows.Tests rewritten to the new behaviour:
test_a_reply_under_a_refused_parent_comes_back_with_it(g i lifts the cover, caret at the end, Enter sends),test_a_refused_selection_comment_reopens_its_words_while_the_send_owns_intent(cover at the comment box), and the Add-field and uploading-picture tests; each fails on the base runtime. Checked in Firefox on release-notes.Departures from the proposal: the cover also stands on a box holding no words (an image the Add field refuses). Any key in a covered box lifts the cover: a key that edits or moves the caret then does its usual work, while a send key (Enter, Mod+Enter) or Send only lifts it, with the caret at the words' end, and sends nothing, so a second Enter sends. A modifier alone, Tab and Escape leave it standing. A one-line comment box cuts a long refusal after its first line, with the full text in the tooltip and Errors.