Repository navigation
Stand a pasted picture in a band above the box while a thread is open - #6686
Merged
Merged
Conversation
In the floating panel, a picture pasted into a draft hung just over the panel's top edge. With a long thread open, that edge is the thread's head, about 800 px above the box, so the picture landed far from where the user was typing and was easy to miss. Now the shelf hangs from the row's top edge, and while a view is open the row takes a margin as tall as the shelf's tallest picture with its gap on either side. The panel rises by that band and the picture stands in it, between the thread and the box, covering neither. With no view open the row's top is the panel's, so the page's field looks as it did. Max chose this on a playground over holding the picture in the box (inside the box's frame with a thread open, outside it without one) and standing it beside the panel (about 230 px of room per picture), with hanging it over the box and drawing it as the thread's next message set aside. It reverses one thing #3181 kept: the thread no longer stays still as you paste, but moves up 124 px. `--lf-media-h` and `--lf-media-gap` move from the shelf to the theme's tokens, since the row, an ancestor of the shelf, sizes the band from them. The picture lands once its upload ends, after the paste key's rendering has settled, so box-motion took the band as news: it carried the thread's messages up from where they stood while the view's foot jumped, and the message being answered vanished behind the band for about 100 ms. The composer now holds the rendering through the upload (`holdRendering`), as the panel does through a leaving view's fade, so the band is the paste's own result and the thread steps up with it. A new browser test pastes into a long open thread and checks the band's placement, the box staying put, and the last message's place on the tween's first frame; it fails without the hold. leaf-dev's paste state now works in Firefox, which drops a constructed ClipboardEvent's clipboardData, and a new stills state, `thread-reply-photo`, shows the band.
Review found the band stayed open, empty, in Menu and in Threads' search: a search hides the field's editors rather than the shelf, so the row's rule still matched. The rule now asks for a shelf whose editors show, and the page-field test opens Threads, checks the band, then searches and checks it closes; that check fails on the old selector. The composer takes its rendering hold just before the upload's `try`, so a throw in the busy state's paint can no longer leave the page reading unsettled for good, and the comments that review called hard to parse are shorter.
leaf-agent
approved these changes
Nov 21, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 22, 2026
On news, box-motion carried every scroller's content from where it was drawn, as a turn joining the thread. A change that only resized the box around a scroller rode the same way. So when a picture pasted from the context or Edit menu (no key, so the change reads as news) opened #6686's band under a thread's view, the thread's messages stood where they were drawn, under the view's new foot, and hid the message being answered for about 100 ms. #6686 covered only a keyboard paste, by holding the rendering through the upload. News now carries a scroller's content only where that content changed since the last reading, read as its laid-out height (`laidOutHeight` in scrolling.js, now exported). A change that only resizes the box shows the content where its scroll puts it, and a thread's view keeps that at its foot. Sends ride as before. The scroll height would not do as the measure: it counts a ride's own drawing, so after a sent reply rode in, the next box-only change rode again. A fresh review found that, and the test now covers it. Worth weighing: the margin card's transcript gets no reading when news lands in it at its cap, so there the rule can compare against a stale height and ride as it did before. The fuller fix would be for the thread reader to declare a turn joining, as a send declares itself (`stream()`), so box-motion infers nothing. That needs a path from the reader to the box's motion, and isn't attempted here. Max asked for this before closing the session that built the band. The band test now runs for a key paste, a menu paste, and a menu paste just after a sent reply. The menu cases fail on main's rule, and the last one also fails on the scroll-height reading. 145 stream, news, send and paste tests across the panel, margin card and threads pass, as do `test:runtime` and `check:browser`. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
added a commit
that referenced
this pull request
Nov 22, 2026
… dead pieces (#6723) Several comments and one shipped reference describe code that has since changed. This corrects them and removes two pieces of dead code. Behavior is unchanged, apart from one shipped sentence that no longer points package authors at the wrong pattern. - **`skills/leaf/references/module-reading.md`** gave the depth dial as an example of a widget that reads its document with `viewDocument(node)`. #6642 scoped `lf-dial` to `this.parentElement` and dropped that import, so a package author copying the dial from this sentence got the scope the dial stopped using. The contents list (`toc-view.js`) is now the only example, and it is the only caller. - **`src/leaf/todos.py`** and **`_todo_error`** in `event_contracts.py` said a to-do needs a *live* widget. Since #6641, `work.widget_seat_error` accepts any widget the newest revision declares. - **`browser/styles/floating-panel.css`**: the band comment said the band is the shelf's tallest picture plus its gaps. The rule reserves the most a picture may take, `--lf-media-h` (tokens.css), plus a gap on each side, as #6686's own description says. - **`browser/runtime/obligations/view.js`** sent readers to a passage in `version.js`'s header that no longer exists. `carry.js` owns that rule now ("Other unnamed elements and changed tags carry nothing"), and the comment states the failure inline. - **`browser/runtime/rendering.js`** cited `scripts/leaf/render_checks.py`. The file is `src/leaf/render_checks.py`. - **Dead code:** `page-inspection.js` rendered a "Reading source…" line in a branch that the early `return` above it already rules out; `handOver` in `thread/replies.js` took a `target` argument it never read; and `projection/authored.js` stated its header paragraph twice. The browser type check (`tsc --project browser/types/tsconfig.json`) passes. These are comment and dead-code changes with no behavior to pin, so there's no regression test. Co-authored-by: leaf-agent <[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.
In the floating panel, a picture pasted into a draft hung just over the panel's top edge. With a long thread open, that edge is the thread's head, about 800 px above the box, so the picture landed far from where the user was typing. Now the shelf hangs from the row's top edge, and while a view is open the row takes a band as tall as the shelf's tallest picture plus its gap on either side: the panel rises by the band and the picture stands in it, between the thread and the box, covering neither. With no view open nothing changes.
Max picked the band on a playground over holding the picture inside the box and standing it beside the panel. It reverses one thing #3181 kept: the thread no longer stays still as you paste, but moves up 124 px.
The picture lands after its upload, once the paste key's rendering has settled, so box-motion took the band as news and carried the thread up from where it stood: the message being answered vanished behind the band for about 100 ms (frames, top row). The composer now holds the rendering through the upload (
holdRendering), so the band is the paste's own result and the thread steps up with it.Worth weighing:
box-motion.js,joins). That changes box-motion's rule, so it isn't in this PR.Also: leaf-dev's paste state now works in Firefox, and a new stills state,
thread-reply-photo, shows the band. A fresh code review and a fresh look at the captures found the band staying open, empty, during a search; that is fixed. Firefox and Chromium stills, light, dark, phone and a 900×600 window. The new test, the panel's paste tests and the attachment tests pass, plustest:runtimeandcheck:browser. The new checks fail without the hold and without the search fix.