Skip to content

Keep the conversation message header on one row outside the Threads panel - #883

Merged
max-sixty merged 1 commit into
mainfrom
fix/ci-35582348277
Sep 21, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/ci-35582348277

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

ci on main went red at 9b17c79: lint and test passed, and the complete suite in nightly failed on one case — test_agent_status_leaves_the_margin_transcript_where_the_reader_scrolled_it. The transcript's scroll extent moved from 959 to 980 the moment an agent status arrived. It reproduces on every local run with those exact numbers, and passes at bbdd9af, the commit before #879.

shadow.css states the shared header rule beside the class it governs — "The name and age hold their size; the state uses the remaining width" — so a receipt whose words lengthen ellipsizes in place and the header stays one row. #879 gave the same lf-msg-meta class a second face in chrome.css, written for the accordion's narrow column but left unscoped inside @scope (.lf-chrome), and it carries flex-wrap: wrap. Scope proximity beats an unscoped rule at equal specificity, so that wrap won on every conversation the chrome draws — including the margin card, which is not the accordion and still keeps its receipt in the header. The status changing ○ Waiting for pickup to ● Working — Reading your feedback wrapped the header onto a second line and grew the transcript by 21px under a reader who had scrolled it.

This scopes the rule to .lf-thread-compact, where it was written for. The accordion keeps its wrap; every other surface returns to the shared one-row rule. That is the constraint chrome.css's own header already sets out — "A shared class owns only the look shared on both sides of the scope line" — so the fix is the chrome sheet no longer restating a shared class's layout rather than a second rule added to hold the first one back.

Verification: the failing case passes, and so does the nightly selection over test_render_margin.py, test_render_conversations.py and test_render_anchors.py (312 passed), which is where the accordion's own header and receipt placement are covered. Pre-commit is clean on the changed file.

Reproduction and the measured reflow

The failure at 9b17c79, reproduced locally with uv run pytest tests/test_render_margin.py::test_agent_status_leaves_the_margin_transcript_where_the_reader_scrolled_it -q -n0:

AssertionError: assert {'working': [484, 980], 'waiting': [484, 980]}
                    == {'working': [484, 959], 'waiting': [484, 959]}

scrollTop holds at 484 — the card placement itself disturbs nothing. What moves is scrollHeight - clientHeight, the content below the reader's place. Dumping the transcript's boxes across the status arrival names the element:

-DIV.lf-conversation-msg user | h=44      -DIV.lf-conversation-head | h=19      -SPAN.lf-msg-meta | h=17
+DIV.lf-conversation-msg user | h=65      +DIV.lf-conversation-head | h=40      +SPAN.lf-msg-meta | h=39

.lf-receipt-state is already white-space: nowrap with text-overflow: ellipsis and min-width: 0, and .lf-message-receipt is flex: 1 1 auto; min-width: 0 — the header was built to absorb a longer state without growing. Only the wrap on the containing row let it break instead.

The everyday suite was also run here; its 6 failures are this sandbox's own (PermissionError on AF_UNIX sockets, umask, and a Node bundle step), all outside the CSS this change touches, and test was green on 9b17c79 on the hosted runner.

…anel

`shadow.css` states the shared header rule: the name and age hold their
size while the state uses the remaining width, so a receipt whose words
lengthen ellipsizes in place. #879 added a second face for the same
`lf-msg-meta` class in `chrome.css`, unscoped inside `@scope
(.lf-chrome)`, carrying `flex-wrap: wrap` for the accordion's narrow
column. Scope proximity beats an unscoped rule at equal specificity, so
that wrap won on every conversation the chrome draws, the margin card
included.

There the receipt still sits in the header, and an agent status arriving
turned "Waiting for pickup" into "Working — Reading your feedback",
which wrapped the row onto a second line and grew the transcript 21px
under a reader who had scrolled it. Scoping the rule to
`.lf-thread-compact` leaves the accordion's wrap where it was written
for and returns every other surface to the shared one-row rule.

`test_agent_status_leaves_the_margin_transcript_where_the_reader_scrolled_it`
is the case that failed; the nightly selection over
`test_render_margin.py`, `test_render_conversations.py` and
`test_render_anchors.py` passes.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

The scheduled ci run on main at the same commit hit this again: run 35590940976 failed nightly on test_agent_status_leaves_the_margin_transcript_where_the_reader_scrolled_it alone, with the same reading — scrollTop holding at 484 while the extent moved 959 → 980 — out of 2818 passed and 3 skipped.

Two independent runs on 9b17c79 reaching the identical numbers confirms the reflow is deterministic rather than a timing race, which matches the account in this PR's description. main is still at 9b17c79 and still red on that case.

@max-sixty
max-sixty merged commit 10ece06 into main Sep 21, 2026
4 of 5 checks passed
@max-sixty
max-sixty deleted the fix/ci-35582348277 branch September 21, 2026 16:38
max-sixty pushed a commit that referenced this pull request Sep 21, 2026
…ontrols (#884)

`ci` on `main` went red at 725fca7 (#878): [`lint` and `test` passed
and the complete suite in `nightly` failed on seven
cases](https://github.com/max-sixty/leaf/actions/runs/35615354769). One
of them,
`test_agent_status_leaves_the_margin_transcript_where_the_reader_scrolled_it`,
also fails at 9b17c79 and is #879's; #883 has since landed it. The
remaining six are the Web Awesome rollout's, and they share one cause:
the rollout moved four packages' controls into a vendor's shadow root,
and the facts Leaf had stated about the native elements it replaced
stayed on the hosts those elements used to be. #878's stated validation
was 177 widget browser tests and the shipped runtime tests, and neither
reaches the corpus ring floor or the published site.

## What the reader sees

**The band is the vendor's, not the layer's.** `theme.css` keeps the
ring's thickness in one token so there is one band on the page. A
vendored control's ring is painted inside its own shadow root from
`--wa-focus-ring-*`, which the Leaf theme did not map, so every vendored
control wore a 3px ring next to Leaf's 2px one — and the diff filter
field's own rule, `.lf-diff-search:is(:focus-visible, …)`, stopped
matching anything at all, because a `wa-input` host is neither the Tab
stop nor the box that gets ringed. The vendor also transitions
`outline-color`, so the band faded in over 75ms rather than appearing
with the focus; `theme.css` states the opposite for the layer's own
rules, and a transition in flight is reported as the value the property
is leaving, so the band was invisible to any reading taken when it was
drawn.

The shared theme now states the band — `--wa-focus-ring-style`,
`--wa-focus-ring-width: var(--here-ring-w)` beside the
`--wa-color-focus` mapping that was already there — draws and names it
on the text field's own part, since `--lf-here-ring` does not inherit,
and drops `outline-color` from the two vendored controls that transition
it. That is one place for every package rather than a rule per host. The
diff package loses its dead filter-field rule, and the duplicate
`.lf-diff-wrap:focus-visible` #878 added beside the named one — the
second latent failure, which the corpus floor reached only once the
first was fixed.

**The chrome above the evidence grew.** `lf-visual-review` gives a
focused review a laptop's height, and both rows of chrome above the
evidence take their height from the tallest control in them. A vendored
control sizes itself from the vendor's form-control height, eight pixels
more than `.lf-btn`'s box, so the queue row and the inspector row each
grew by eight and the evidence stage lost sixteen — 366px to 350px,
under the 360px the workspace states. The package states those controls'
height again, as it did before #878 with `.lf-vr-inspector-button {
min-height: 30px }`. Measured on the rebuilt page: both rows back to
30px and the evidence back to 366px.

## What the tests were reading

`test_site.py` still read a `wa-slider` through `to_have_value` and
drove a `wa-select` with `select_option`; both now use the shapes #878
established in `test_render_widgets.py`. The corpus ring specimen named
the `wa-input` host, which is not in sequential keyboard navigation; it
now names the field the reader actually stands on, and a second specimen
keeps `diff-tools` exhibited for the controls that still wear it.

`test_a_copy_speaks_reader_origin_after_live_map_is_removed` is not a
Web Awesome failure. It asserts the card move's optimistic paint and
then closes the page — but the paint says nothing about the log, and the
export opens its own page with only the log to replay from, so a send
still in the wire is aborted by the close. That is the arrangement
`sending()` exists for, under **State races are arrangements, not
probabilities** in `tests/CLAUDE.md`; the gesture is now enclosed in it.
Nothing says #878 introduced it: the two failing `main` runs before this
one carry only the margin case, so this reads as a latent race that the
run lost.

## Two more the floor could not reach

The corpus ring floor raises inline on the first specimen it cannot
stand on, so it reports one per run and fixing one uncovers the next.
Behind the diff filter field, two had collected, and this branch takes
both because `main`'s `nightly` stays red on that case otherwise.

`lf-shot` upgrades to `wa-comparison` after presentation, and
`theme.css` shows the native checkbox only while no comparison is
mounted, so `lf-shot > input.lf-shotflip` — the control `RING_CASES`
named — is `display: none` on every live page. The reader's stop is the
comparison's own handle, which wears Leaf's band because the host maps
`--wa-focus-ring` to it, and wears the `shot` name because #892's
`#paint()` writes `--lf-here-ring` onto that shadow element inline —
`--lf-here-ring` is registered `inherits: false`, so the host's own
declaration does not reach it. The specimen moves there. That is #892's,
and the same shape as the diff field: a vendored control took over and
the reading stayed on the element it replaced.

The summary range's expand and refold controls draw the here ring and
declare no `--lf-here-ring`, which `chrome.css`'s own header forbids.
That is #886's. They share one rule, so they take one name,
`summary-fold`, and one specimen on the gallery's summarized thread.

The walk collecting its per-specimen failures the way
`test_every_base_corpus_tab_stop_has_a_visible_focus_indicator` collects
its own would have shown all three in one reading. That is a change
against the test rather than against this one, and nothing here makes it
harder.

## Verification

All six cases pass here, and so do the nightly files they live in or
that the theme change could reach: `test_render_widgets.py`,
`test_render_visual_review_journey.py`, `test_render_projection.py`,
`test_render_controls.py`, `test_render_navigation.py`,
`test_render_anchors.py`, `test_render_gate.py`, `test_site.py` — 881
passed, beside two `test_render_export.py` cases that fail in this
sandbox for a reason named below and fail identically without this
change. `pre-commit run --all-files` is clean, `npm run test:runtime` is
28 passed, and the Web Awesome regeneration is `scripts/vendor.py
webawesome` rather than a hand edit of the bundle. That reading was
taken at 4bfc53f; with `main` merged in and the two cases above taken,
`tests/test_render_controls.py -k "ring or focus_indicator"` is 21
passed and `tests/test_render_conversations.py` is 96 passed, both
`--run-nightly`.

## What this does not do

The height fix is the visual review's own, because that is the package
whose layout contract broke and where the metric was stated before. The
general question — whether the shared theme should state the vendored
control's box, so any vendored control matches the Leaf button beside it
— is left open: taking it here would move the playground, targeting and
diff geometry that #878 reviewed, with no failing case to read the
result against. Nothing in this change makes that harder to do later.

It does not settle what `shot` is declared by. `RING_NAMES` reads
declarations off stylesheets, so that name's whole population entry
stays `lf-shot:has(> input.lf-shotflip:is(:focus-visible,
.lf-focus-visible))` — a rule whose control is `display: none` wherever
the comparison mounts — while the credit comes from the handle's inline
property. The two halves the floor compares agree on a string rather
than on a rule for that one name. Putting the declaration where the
paint is, `::part(handle):focus-visible` drawing and naming the band
with the `#paint()` write dropped, is the repair; it is left out here
because it answers for `lf-shot` the question this PR leaves open for
the other vendored families, and the corpus floor reaches its end
assertions either way.

<details><summary>The failing cases and where each was read</summary>

From [the `nightly` job at
725fca7](https://github.com/max-sixty/leaf/actions/runs/35615354769):

```
FAILED tests/test_site.py::test_the_published_notification_example_runs_its_authored_module@site
  AssertionError: Locator expected to have Value '2' / Error: Not an input element
FAILED tests/test_site.py::test_published_visual_evidence_loads_from_its_page@site
  Locator.select_option: Error: Element is not a <select> element
FAILED tests/test_render_controls.py::test_every_base_corpus_tab_stop_has_a_visible_focus_indicator
  keyboard stops with no visible indication: pr-walkthrough: input#input.control [outline none, shadow none]
FAILED tests/test_render_controls.py::test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus
  .lf-diff-search in the page of pr-walkthrough is not in sequential keyboard navigation
FAILED tests/test_render_export.py::test_a_copy_speaks_reader_origin_after_live_map_is_removed
  Locator expected to have attribute '1' / Actual value: None
FAILED tests/test_render_projection.py::test_visual_review_gallery_gives_a_laptop_to_the_evidence
  assert 350.421875 >= 360
FAILED tests/test_render_margin.py::test_agent_status_leaves_the_margin_transcript_where_the_reader_scrolled_it
  assert {'working': [484, 980]} == {'working': [484, 959]}      # #879's, landed in #883
```

Five of the six reproduce here on `main`. The export case does not — it
passed on three consecutive local runs — and was diagnosed from the
arrangement rather than from a local red.

The band's own reading, taken on the focused diff filter field before
the transition was removed: `outline-width` 2px and `--lf-here-ring`
`text-entry` from the new rule, with `outline-color` still `rgba(0, 0,
0, 0)` because the vendor's `outline-color` transition had not run. That
is what made the rule look inert and is why the transition is part of
this change rather than a separate one.

Two cases in `test_render_export.py` fail in this sandbox —
`test_the_example_preview_command_exports_a_file_that_opens_on_its_own`
and `test_exporting_an_example_leaves_the_live_preview_untouched` —
because a subprocess cannot launch Chrome here. Both fail identically at
9b17c79 with this change absent, and neither is in the hosted run's
failure list. The everyday suite's five failures here are the same
sandbox's `AF_UNIX` and umask limits, as [#883
recorded](#883).

Catalog previews are not affected: the resting appearance of a vendored
control is unchanged everywhere except the visual review, which the
catalog does not carry, and a still has nothing focused.

</details>

---------

Co-authored-by: leaf-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants