Skip to content

Colour a thread margin entry when its next word is the reader's - #785

Merged
max-sixty merged 6 commits into
mainfrom
thread-waiting-color
Sep 18, 2026
Merged

max-sixty merged 6 commits into
mainfrom
thread-waiting-color

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

A reader scanning the margin rail had no way to tell which conversations wanted something from them. The agent's side of that question was already there in green, so the reader's side was the gap.

A thread reading now carries awaitsReader — the server's one answer to whose turn a conversation is, which the Threads panel's On you filter and the banner's Ask count already read — and paints it the way working paints green: blue glyph, blue interior, and "On you" in the label and the accessible name so colour is never the only channel. Agent workflow outranks it on the same carrier, because live work is what the reader needs first and one interior carries one wash. An aggregated thread control takes the turn of any member, as it already takes the most urgent member's workflow stage. Margin and Page Map paint the same attribute.

Reading the existing projection rather than deriving "the agent spoke last" is deliberate: a second reading in the margin would let the rail say On you about a thread the panel's On you filter then hides. It is narrower in one shape: with no structural Ask the projection consults only the latest spoken turn, so a thread whose root is an agent comment and whose latest spoken turn is an agent reply carrying no awaits reads as on nobody, however plainly the root asked. A structural Ask deliberately survives a later plain turn; the comment-is-a-question rule does not. That asymmetry is events.py's to settle and would move the banner and the panel with it, so it is a TODO item rather than a workaround here. No page in the corpus stands that shape, which the item says, because seeding one is the evidence the decision will need.

The colour is a first pass, not a settled scheme. --turn-tint / --turn-wash / --turn-ink sit beside the --ok-* trio, --turn-ink is currently the accent, and TODO.md names what is still open: whether the reader's turn wants a hue of its own, whether a thread on nobody should say so, and the panel's On you chip, whose lf-needs hook class no stylesheet reads.

--lf-agent-tint becomes --lf-entry-tint, since two states now set the tint that hover must not erase.

Where to look

skills/leaf/assets/runtime/margin-projection.js reads awaitsReader onto the thread item and paints the marker and each reading option; margin-entries.js owns syncMarginTurn and the module header's statement that the turn is projection state rather than a contributor axis; page-map-dialog.js paints the map rows; chrome.css holds both rules and the precedence; theme.css holds the tokens and the comment saying they are provisional.

Checks

Everyday suite green (1141). Nightly render suites for margin, conversations, gate, pages, navigation, startup, controls, widgets, reactions, product and export green, plus test_site.py. The new test in test_render_margin.py bug-backs five ways: flip the icon token, flip the projection predicate, drop the agent-workflow precedence, drop the Page Map paint, or make the attribute sticky instead of clearing, and it goes red on the matching assertion.

The gallery specimen is bg-thread-text in the Threads section, whose own Thread control is blue and visible. Its existing agent reply now asks the reader a question and sets awaits, which leaves the log's thread set, ids and order untouched — seeding a new thread instead shifted the order and reddened three t-walk tests across a fixture twelve nightly files share.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits September 17, 2026 23:31
A reader scanning the rail had no way to tell which conversations wanted
something from them. The agent's own state was already there in green, so the
reader's side of the same question was the gap.

The thread reading now carries `awaitsReader`, the server's one answer to whose
turn a conversation is, and paints it in Margin and Page Map the way working
paints green: blue glyph, blue interior, and "On you" in the label and the
accessible name, so the colour is never the only channel. Agent workflow
outranks it on the same carrier. An aggregated thread control takes the turn of
any member.

`--lf-agent-tint` becomes `--lf-entry-tint`, because two states now set the
tint that hover must not erase.

The colour is a first pass, not a settled scheme, and reading `awaitsReader`
rather than "the agent spoke last" has a visible consequence: an agent comment
that asks something, followed by an agent reply that asks nothing, reads as on
nobody. TODO.md carries both questions.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@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.

The prose this PR adds to bg-thread-text — offered in place of the dedicated blue specimen — points a developer at a control the gallery does not render.

Rendering examples/developer/feature-gallery.html at 1440×1000, the only element carrying data-lf-turn="reader" is the marker on bg-crowded, and it is hidden: the suggestion's Accept is primary, so keepsHidden(row, … || Boolean(primary)) takes the marker down. Opening that cluster's ⋯ yields the four reaction marks and Show 4 more in Page Map — the Thread reading spills rather than materialising. The blue row is reachable only through Page Map, where it does paint (--turn-wash interior, --turn-ink glyph, "On you" under the label). bg-crowded also sits in the section headed Margin entries (<section id="bg-margin-controls">, "Combine roles."), not in Suggestions (bg-changes), so the sentence sends the reader to the wrong section and then to a control that is not there.

That matters because examples/CLAUDE.md asks a focused specimen to name "the real control or gesture" and tell the developer "what result to inspect", and this sentence is what the PR offers instead of one. The inline suggestion names Page Map as the gesture; seeding the state on a thread whose margin control is actually visible would be the stronger fix if the fixture can take it. Either way examples/corpus.html carries the same sentence, so scripts/corpus.py needs rerunning after the edit.

Comment thread examples/developer/feature-gallery.html Resolved
The prose added to `bg-thread-text` pointed at `bg-crowded`'s Thread reading,
which the gallery does not render: the suggestion's Accept is primary, so the
marker is hidden and the reading spills to Page Map. It also named the wrong
section. Reviewed on the rendered page, `bg-crowded`'s marker reports
`checkVisibility() === false`.

The fixture now carries the state where a developer can see it. The gallery's
existing agent reply on that thread asks the reader a question and sets
`awaits`, so `bg-thread-text`'s own control is blue, visible, and in the
Threads section. Editing one existing reply leaves the log's thread set, ids
and order alone, which is what broke three `t`-walk tests when this was tried
by seeding a new thread.

The test now also answers both threads and holds the marker to losing the
attribute and the word, since the specimen tells a developer to reply and
watch the colour go.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@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.

The last commit falsifies the TODO item this PR adds. a3f78ec6 gives bg-thread-text's later reply awaits: true, and the item added in 4ffa38d7 cites that same specimen as an agent question a later plain turn hides — "is exactly that shape and wears no colour". Rendering the merged gallery at 1440×1000, that marker now carries data-lf-turn="reader" with the blue interior, the blue glyph, and Thread, On you, 9 of 21, … as its accessible name: it is this PR's showcase for the new colour, not an instance of the gap. Whoever picks the item up goes looking for a specimen that isn't there.

The design question itself survives — _thread_awaits_reader still reads only the latest spoken turn, so a structural Ask outlives a later plain turn where the comment-is-a-question rule does not. Only its evidence moved. The inline suggestion drops the citation; re-pointing it at a page that still stands the shape would be better if one exists, but I did not find one in the corpus.

The PR description carries the same sentence, and the repo squash-merges with PR_BODY, so it lands in main's commit message unless it is edited too.

Comment thread TODO.md Resolved
`a3f78ec6` gave `bg-thread-text`'s later reply `awaits: true` to make it the
gallery's blue specimen, which is the opposite of what the TODO item added in
`4ffa38d7` cited it for: an agent question a later plain turn hides. Whoever
picked the item up would have gone looking for a gap that page no longer shows.

The behaviour is unchanged — `_thread_awaits_reader` still reads only the
latest spoken turn — so the item now states the shape in terms of the log
rather than pointing at a page, and says no corpus page stands it, since
seeding one is the evidence the decision will need. `bg-resolved-text` is the
near miss and is named as one: it is excluded for being resolved, not by this
rule.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The item called `bg-resolved-text` a near miss "excluded for being resolved
rather than by this rule". Both halves are wrong: its answering reply carries
no `awaits` and no ask element, so the latest-turn branch returns False on it
independently of the resolved branch, and what the rule hides there is an
answer, which is the reading that should hold.

It is still the thread to start from, so the item now says so and says what it
needs — a later agent reply that answers nothing — rather than describing it as
something the rule leaves alone.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
"Give it a later agent reply that answers nothing" does not produce the
instance: `build_threads` clears `resolved` only on an explicit `unresolve`, so
a reply appended after the `resolve` leaves the thread resolved and
`_thread_awaits_reader` returns at that branch before the latest-turn rule.

That is the third wrong claim in three passes over this one sentence, all of
them operational detail about work nobody has started. The item keeps the
decision, its stakes, and the fact that no corpus page stands the shape, and
says only what `bg-resolved-text` is — answered and resolved, so not a shortcut
— rather than a recipe for turning it into one. Whoever seeds the instance
picks the route.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit de1f4a4 into main Sep 18, 2026
7 checks passed
@max-sixty
max-sixty deleted the thread-waiting-color branch September 18, 2026 08:27
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