Skip to content

Make thread transitions, focus, and resolution consistent - #213

Merged
max-sixty merged 4 commits into
mainfrom
codex/thread-interactions
Sep 2, 2026
Merged

max-sixty merged 4 commits into
mainfrom
codex/thread-interactions

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 2, 2026 •

Copy link
Copy Markdown
Owner

Submitting a selection comment could close the Threads panel, shift the document, and leave keyboard focus unclear. Keep the new conversation in the reader's chosen view and focus its reply box. Wide live pages reserve conversation space before the first comment so sending and resolving leave the document column in place.

Opening a conversation enters its reply, while explicit thread navigation stays on cards. Escape returns from a panel reply to its card, and Enter resumes typing. Stronger input focus styling distinguishes these modes, and long threads reveal the reply field with Send and Resolve together. Later typing or selection retains focus when a request completes.

Inline and panel views now share Resolve/Reopen controls, immediate pending feedback, and duplicate-submission protection through the outbox. Settlement preserves focus when replacing controls, including page-seated threads that have no reply box. A CSS validation regression also checks changed theme values and syntax against unchanged authored HTML.

Validation: the everyday suite, focused browser suites covering conversations, navigation, margins, and drafts, and pre-commit checks. Regression cases include version-response seats without a reply box and a filtered panel receiving a comment after the reader selects another passage. Inspected the live examples at narrow and wide sizes in light and dark themes. Updated the ship-review example, regenerated its corpus, and aligned the runtime guidance.

This was written by Codex on behalf of max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two focus/visibility regressions on paths this PR adds; details inline.

The reopen half of the page-seat case has the same shape and isn't covered by the suggestion below: the .lf-conversation-resolved control's landing is thread.querySelector(":scope > .lf-say textarea")?.focus(...), and a seat whose root carries a version response never has a .lf-say — it reconciles back to .lf-conversation-actions. The optional chain makes that a silent no-op, so reopening from that seat also ends on document.body. ?? thread there would close it.

Nothing else stood out. The settlement control reading pending work off the outbox reads well, and pulling one control into folding.js for both surfaces is the right seam. Separately, the lf-skip pin in test_a_coined_class_cannot_reach_the_chromes_rules fixes a break that landed with #210 at the merge base — worth knowing it isn't this PR's own.

@max-sixty
max-sixty merged commit de0f296 into main Sep 2, 2026
3 checks passed
@max-sixty
max-sixty deleted the codex/thread-interactions branch September 2, 2026 08:28
leaf-agent added a commit that referenced this pull request Sep 2, 2026
The export gate's band reading asked whether anything under `main` overlapped
the claimed strip. A widget asking for width is drawn past the column by design
and lands in that band while claiming nothing, so a board or a diagram answered
for the rail on three of the five copies that hold a strip: the strip could have
been held open for nothing and the band still read as occupied. Measured by
exporting each example with `.lf-margin-item, aside.sidenote` hidden — a copy
keeping the claim and losing what stands in it — the old reading caught the
defect on design-decision and ship-review only, while the narrowed one catches
it on all five and stays green on the corpus as it stands.

The phone-banner reading follows the address instead of pinning where it lands.
Whether the version folds at 390px is a font-width fact: the assertion #209
shipped reads it still on the row, this suite's fonts fold it away, and the two
cannot both be pinned. What the test is about is that the fold hands the reader
over rather than drops them, which is read now over a row made to fold
something.

The rail paragraph in `skills/leaf/CLAUDE.md` described the code #213 deleted.
`reserveRailForPage` and its `x-state`/`x-work` query are gone; `reserveRail()`
now runs unconditionally as `createLivingMargin` builds, and the bake drops the
reservation unless a margin item survived into the file.
max-sixty pushed a commit that referenced this pull request Sep 2, 2026
…aws them (#218)

## Problem

The nightly leg of `ci` has been red on main since
[de0f296](de0f2967), with seven
cases failing on [run
33614395596](https://github.com/max-sixty/leaf/actions/runs/33614395596).
None is a product regression: each is a test reading the layer the way
it was drawn before #209 landed the banner fold, the reserved rail, and
the wider control floors. #209's own `ci` run was cancelled, so the
nightly modules first ran against it two commits later and every stale
reading surfaced at once.

## Solution

Three readings, brought back onto what the layer now draws.

**The strip a copy holds open**
(`test_an_exported_example_stands_on_its_own`, button-gallery and
ship-review). A strip is what `main` gives up beside itself and
`--lf-shift` re-centres what is left, so on a window wider than the
column plus its strips the leftover room sits outside both. The band was
still read from body's edges, which asks about that leftover — nobody's
claim, and always empty — while the rail's actual residents stood beside
the column. The band is measured from the column's own edges now, and
the question is put to the residents that make the claim
(`aside.sidebar`, `aside.sidenote`, `.lf-margin-item`) rather than to
every descendant of `main`: a widget asking for width is drawn past the
column by design and lands in the band while claiming nothing, so the
wider reading was answered by a board or a diagram on three of the five
copies that hold a strip.

**Three cases that assumed an address the fold now takes.**
`test_covering_workspaces_separate_page_paint_from_chrome_target_paint`
pressed `.lf-decisions` at 560px, where the row has folded it; it uses
the `banner_address` helper written for exactly that.
`test_the_banner_uses_the_page_mark_and_puts_each_edge_by_its_panel`
asserted the focused address stays on the row at 390px, against its own
docstring and against `refold` — whether the version folds at that width
is a font-width fact, so the reading follows the address to wherever the
fold put it, over a row that has been made to fold something. The ring
walk's `offers` gate asked whether `.lf-others` was *visible*, so a
folded address read as a page not offering the tray at all, and the walk
that did open and walk it never recorded the scope.

**A fixture the chip face outgrew.** `LIVE_KEYS_V1` set two links 60px
apart with a chip face 63px wide, so the chord took the second chip down
— the right answer to a crowded line, and the wrong fixture for a test
about a page moving under a press. The links are a clause apart now.

The wide-banner case is the one calibration change: `oneLine > shown *
1.2` cannot hold, because the row's cap *is* the sentence's floor stated
from the other end, so a crowded row leaves the status its floor and no
margin over it. The pressure is stated as the sentence outgrowing its
box, and the fixture's crowding is asserted where the row is read — the
row folded something.

One doc correction rides along, because the export reading rests on it:
the rail paragraph in `skills/leaf/CLAUDE.md` still described the code
#213 deleted. `reserveRailForPage` and its `x-state`/`x-work` query are
gone, `reserveRail()` now runs unconditionally as `createLivingMargin`
builds, and the bake drops the reservation unless a margin item survived
into the file.

## Testing

Each case reproduced locally on `40c1de4` before the change and passes
after. The four touched modules ran whole under `--run-nightly` —
`test_render_controls.py`, `test_render_export.py`,
`test_render_aim.py`, `test_render_projection.py` — 223 passed at
`46ec807`, and `test_render_controls.py` plus `test_render_export.py`
re-ran at 98 passed after the readings above changed. The everyday suite
is 794 passed, 6 skipped. `ruff check` and `ruff format --check` are
clean on the touched files. The PR's own `ci` runs the everyday suite;
the nightly leg these cases live in first runs after main moves.

<details><summary>What the narrowed band reading catches, per
example</summary>

Each example exported twice at 1200px, once as it stands and once with
`aside.sidebar, aside.sidenote, .lf-margin-item { display: none
!important }` appended — a copy keeping the claim and losing what stands
in it, which is the defect the assertion names.

| example | `--strip-r` | `empty` as it stands | residents hidden, `main
*` | residents hidden, claimants |
| --- | --- | --- | --- | --- |
| button-gallery | 95 | `[]` | `[]` | `['right']` |
| corpus | 384 | `[]` | `[]` | `['right']` |
| design-decision | 384 | `[]` | `['right']` | `['right']` |
| postmortem | 384 | `[]` | `[]` | `['right']` |
| ship-review | 59 | `[]` | `['right']` | `['right']` |

The other seven examples claim nothing (`--strip-r: 0`), so `hi - lo >
1` never lets a band be read at all. No copy claims `--strip-l`: the
sidebar strip is written under `html:not(.lf-copy)`, so it is the live
page's alone.

</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