Repository navigation
Read Resolve from the thread corner in the startup and navigation tests - #444
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
The margin case's new reading stays green in the layout its own comment excludes. Forcing .lf-conversation-thread > .lf-resolve.lf-icon-action to position: static — the control leaving the corner and taking a full-width row above the first message — leaves all three assertions holding: as the thread's first flow child the control still lands at contentTop (710.8) and at the thread's content right edge, and the head is pushed down to 746.8, so resolve.bottom <= head.bottom reads 738.8 ≤ 774.8. The test passes on the regression it was just updated to name. tests/CLAUDE.md, Make a green test non-vacuous, asks for the causal contrast for each assertion and warns that "bounds and geometry tests are especially prone to staying green after the fault moves to another edge".
The overlap reading closes it: head.top < resolve.bottom passes as the page stands and fails at 746.8125 < 738.8125 under that probe. Suggested inline.
test_render_navigation.py's inline reading — placement["controlBottom"] <= placement["headBottom"], failing with "Resolve took a row above the first inline message" — carries the same gap, and is where this reading came from, so its message overstates what it proves too. Worth the same line there.
The corner readings in the margin and navigation cases stayed green when the control left the corner and took a full-width row above the first message: as the thread's first flow child it still lands at the content top and right edge, and the head is pushed below it, so a bottom-ordering assertion holds either way. Each case now also reads the overlap, which fails under that layout.
# Conflicts: # tests/test_render_margin.py
The public feature gallery currently withholds every generated page control until its first authoritative state read returns, so a cold agent container leaves the playground's control column blank even though widget upgrade has already completed. This changes the visibility boundary from `data-lf-presented` to `data-lf-upgraded` in light and shadow DOM, while keeping durable mutations, dialogs and popovers, and the agent-derived top status panel gated on authoritative presentation. The existing presentation signal still reconciles authored geometry against replay before semantic interaction opens. Browser regressions hold `/api/state` open and prove that page-local controls and previews paint and work, durable actions cannot post, the banner remains Connecting, local playground changes survive replay, and box-derived interface geometry reconciles when replay lands. The startup contract and runtime comments now describe those separate readiness facts. The unrelated receipt assertion remains on `main` and is intentionally left to #444, which owns its stronger positional repair. Tests: `pre-commit run --all-files` (passed); reviewer selection `tests/test_render_startup.py tests/test_render_widgets.py tests/test_render_gate.py` (275 passed, plus the current-`main` receipt assertion failure owned by #444); earlier full suite before dropping that overlapping test-only repair (910 passed); `leaf version check … --render` on feature-gallery (light and dark); held-backend visual sweep at 1200×900 and 1440×900 in both color schemes. Candidate and `main` website profiles load the same 36 JS / 779 KiB, 41 code / 1048 KiB, and 49 total / 1262 KiB by feature-gallery presentation. > _This was written by Codex on behalf of @max-sixty_
`test_an_inline_thread_uses_surface_focus_until_its_reply_takes_over` has been red on every complete run since a15715c, and it is the third failure in the nightly [`ci` run on `7e403108`](https://github.com/max-sixty/leaf/actions/runs/34217624366) — the one #444 measured at its merge base and correctly set aside as not its branch's. `git bisect` over `0b50e4c5…7e403108` puts it on a15715c (`Simplify thread and reply chrome`): the case passes at that commit's parent b094e80 and fails at a15715c, alone under `-n0`. Two things were wrong, and the second was hidden behind the first. **The case read the thread before the preview built one.** a15715c added a resting-tint reading as its first act on the page, from `.lf-margin-preview .lf-conversation-thread`. The margin preview builds its thread when it opens one, so at rest that locator resolves nothing and the case spent its 30s timeout there. The resting tint now comes from the same element once the region gives the focus back, so `pointer["background"] != resting` still contrasts a current thread against a quiet one rather than against a value read before the thread existed. **Every reading after that point had never run, and one of them was measuring a cascade collision.** a15715c's message says *Reply fields use one focus ring instead of an accented border plus outline*, and it set the chrome text-box rule to `outline-offset: 0` with the border cleared under the ring. `theme.css`'s conversation rule still said `outline-offset: 1px`, and it wins the declaration at (0,3,0) against the text-box rule's (0,2,1) — the extra class coming from `.lf-btn` sitting in that `:is()` list beside `textarea`. So the offset that commit set reached every text box in the document except the reply field it was written for, and one control shape wore the band at two offsets. The fix is in the layer rather than the expectation. The reply is a text box, so it takes the text box's band: the conversation rule keeps its 1px gap for the thread's buttons and summary, and the reply gets the chrome rule's terms — ring on the border, border cleared under it — repeated inside the shadow-carried slice. That repeat is the fix rather than a restatement of a rule that already reached the field. A thread an `x-thread-surface` widget seats inside its own shadow tree reads only the theme's `lf-shadow` slice; `runtime/chrome.css` is never adopted there, so the reply in a diff's inline outlet never met the text-box rule at all. Measured on the diff fixture before this change, that field wore its resting `--border-2` border (`rgb(69, 63, 54)` on the dark scheme) *and* the 2px accent ring 1px outside it — exactly the accented border plus outline a15715c removed from the document copy. It now wears the same single band as the panel's copy, at `offset: 0px` with the border transparent. `test_a_diff_surface_keeps_the_complete_thread_lifecycle_inline` gained the reading that pins the shadow half: it focuses the reply in both seats and asserts the two bands are identical. Reverting `theme.css` alone fails it on all three fields — offset, border, and the ring's own name. Verified: `tests/test_render_navigation.py`, `tests/test_render_anchors.py`, and `tests/test_render_conversations.py` green in full (253 passed); every `-k ring` case across the nightly suite green (91 passed), including the corpus ring floor; the everyday suite green (904 passed, 6 skipped); pre-commit clean on the three changed files. The margin and startup failures in the same nightly run are #444's. <details><summary>Bisect and the state the preview is in at rest</summary> ``` 0b50e4c Simplify Leaf state, serving, and browser initialization (#429) pass c20aaa5 Use standard UI and keyboard terminology (#431) pass b094e80 Keep go-to hints stable across filters pass a15715c Simplify thread and reply chrome fail f38be9e Bundle the published Leaf runtime (#442) fail 7e40310 Polish thread controls and reaction picker (#441) fail ``` Probing `INLINE_PAGE` with one anchored mark, on `7e403108`: ``` AT REST .lf-conversation-thread count: 0 .lf-margin-preview count: 1 AFTER CLICK background: color(srgb 0.967373 0.969412 0.96502) (thread focused) AFTER BLUR background: rgba(0, 0, 0, 0) (thread still built, preview still open) AFTER ESC preview hidden, thread retained ``` </details> <details><summary>The reply field's band before and after, in both seats</summary> Read with `getComputedStyle` on the focused reply textarea. The light-DOM reading is the inline thread the margin preview builds; the shadow reading is the same shared Thread view seated in `lf-diff`'s outlet, which adopts only the theme's `lf-shadow` slice. | seat | before | after | | --- | --- | --- | | light DOM | `offset: 1px`, `border: transparent`, `--lf-here-ring: conversation` | `offset: 0px`, `border: transparent`, `--lf-here-ring: text-box` | | widget shadow tree | `offset: 1px`, `border: rgb(213, 207, 194)` light / `rgb(69, 63, 54)` dark — the resting `--border-2` — `--lf-here-ring: conversation` | `offset: 0px`, `border: transparent`, `--lf-here-ring: text-box` | The panel's own reply field was already the second column and did not move; it is the control the new assertion compares the inline copy against. </details> --------- Co-authored-by: leaf-agent <[email protected]>
#441 moved Resolve out of the first message's metadata row and into the thread's own corner. Three nightly readings still described the old address. #443 has since landed the margin one on
main— it dropped that test's.lf-conversation-headreading and loosened Resolve's box to the thread's own — so this branch now carries the two that remain.test_render_startup.py::test_a_thread_says_what_the_agent_is_doing_about_itasserted the receipt'snextElementSiblingmatches.lf-resolve. Nothing follows the receipt in the head now, so the probe raisedTypeError: Cannot read properties of null (reading 'matches')before it could assert anything. The case keeps the claim it was making — the receipt is metadata on its own message rather than a full-width row — and pins it at the new address, as the row's last element. That is whatpaintAcknowledgmentsNowguarantees by passingnullas the receipt'sbeforefor a message head.test_render_navigation.py::test_inline_thread_surface_has_room_without_focus_reflowalready said Resolve does not hang below the first inline message's row, but that reading is vacuous on its own: a control that leaves the corner and takes a full-width row above the head is still the thread's first flow child, so it lands at the content top and right edge and the head is pushed below it — the bound holds either way. The case now also assertshead.top < control.bottom, which is what fails under that layout.Verified on the merged head: both named cases pass, and so does the margin case this branch no longer touches. Pre-commit passes on all three files.