Skip to content

Leave a message's stage to the message in an open thread - #1393

Merged
max-sixty merged 4 commits into
mainfrom
thread-working-status
Sep 28, 2026
Merged

max-sixty merged 4 commits into
mainfrom
thread-working-status

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

An open thread in the Threads panel said "Working" twice: under its title and beside the message being worked on. Both come from workflowLabel on the same workflow. For a waiting thread, the summary's status is just the stage of one message's workflow. The panel keeps one thread open, so that line only adds anything on the folded rows, where no messages show.

The summary's meta row is now the folded card's digest. Anything on it that the open card already shows carries data-lf-folded, and chrome.css hides it while the <details> is open, so opening and folding need no re-render. That covers three things: the status when a message in the card draws the same workflow, "Draft" (the draft is in the reply box), and "N unread" (the unread messages sit behind their boundary). Two statuses stay visible on the open card, since no message says them: whose turn it is ("On you to answer", "On you to resend"), and work claimed on a thread with no message workflow behind it.

Hiding only the status left the open card's meta row usually empty, and the next item to appear grew it by 12px. Typing a reply moved Resolve (test_a_thread_keeps_submit_in_its_field_and_resolve_with_its_metadata), and an arriving reply pushed the followed reply off its fold (test_incoming_reply_follows_a_selected_thread_before_later_cards). Hiding draft and unread as well keeps the open card still. It also no longer grows when the user sends a reply.

Tests: test_a_thread_says_what_the_agent_is_doing_about_it checks the status on a folded row, hidden once opened, and still visible for thread-level work. test_a_wheel_during_a_resolution_fold_outranks_the_landing_after_it seeds 12 threads rather than 8. The now-shorter open card let the list's end clamp the wheeled scroll position, and the test now asserts that the end is out of reach before comparing positions. leaf-dev stills gains plan-panel-sent, a reply sent from the panel; it is the only state that changes.

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

🤖 Generated with Claude Code

max-sixty and others added 2 commits September 28, 2026 00:17
The Threads panel's summary row shows the thread's attention, and a
waiting thread's attention label is the stage of one message's
workflow. The expanded card also draws that stage in the message's own
header, so an open thread said "Working" twice: under its title and
beside the message being worked on.

The summary status is the folded row's digest. It now carries
`data-lf-folded` when it repeats a stage a message in the card draws,
and the open card hides it. A needs-user status ("On you to answer")
stays, since no message says whose turn it is, as does work claimed on
a thread with no message workflow behind it.

test_a_thread_says_what_the_agent_is_doing_about_it now checks the
status is visible on the folded row, hidden once the card opens, and
still visible for thread-level work with no message workflow.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Sep 28, 2026

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

Hiding the status on an open thread changes the summary's metadata row as the thread changes. In test_a_thread_keeps_submit_in_its_field_and_resolve_with_its_metadata, typing a draft now moves Resolve down 12px; test_incoming_reply_follows_a_selected_thread_before_later_cards also loses its followed position after a reply. All six cases fail on this head and pass on the exact base commit (47d4d79). Please keep the summary layout stable through draft and reply transitions while removing the duplicate status.

@leaf-agent
leaf-agent dismissed their stale review September 28, 2026 16:26

CI reproduced six browser layout failures on this head; all six pass on base 47d4d79

max-sixty and others added 2 commits September 28, 2026 09:37
Hiding the repeated stage left the open card's meta row empty in the
common case, so the next thing to appear there grew the row by 12px and
moved the card: typing a reply (Draft) moved Resolve, and an arriving
reply (N unread) pushed the followed reply off its fold. CI caught both in
test_a_thread_keeps_submit_in_its_field_and_resolve_with_its_metadata and
test_incoming_reply_follows_a_selected_thread_before_later_cards.

Draft and unread digest a folded card too: the open card shows the draft
in its reply box and the unread messages behind their boundary. They now
carry `data-lf-folded` with the repeated stage, and the open card hides
all three.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
With the open card's meta row gone, eight seeded threads left the list
13px shorter, so the fold's shrink clamped the wheeled scrollTop at the
list's end and read as the landing moving it. Twelve threads keep the end
out of reach, and the test now asserts that before comparing positions.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 5848277 into main Sep 28, 2026
5 checks passed
@max-sixty
max-sixty deleted the thread-working-status branch September 28, 2026 17:12
max-sixty added a commit that referenced this pull request Sep 29, 2026
…s its field (#1432)

Every browser test now fails if its page makes a layout shift that the
"Stability" rule (`skills/leaf/assets/AGENTS.md`) forbids. That covers
two cases: a shift Chrome reports without recent input, where news or
loading moves what the user was reading, and typing that carries the
field it types in. The second is what the "Draft" chip broke when it
appeared in an open thread card's header above the reply box and pushed
the box down. #1393 already fixed the chip; this PR adds the broad check
that would have caught it, and the wider one beside it.

`tests/shift_watch.js` is an init script the `browser` fixture installs
on every page, beside `write_watch.js`. Both rules read Chrome's Layout
Instability API (`layout-shift` entries). It compares painted frames,
nets out scrolling, catches a move that is undone before any script
could look, and says whether the user gave input in the half second
before the frame (`hadRecentInput`). Chrome credits no input to a frame
nested in another page, so a trusted key or press in the frame's own
document counts for the same half second.

- **Nothing moves without input.** Each element a no-input shift moves
is reported once per document. `EXPECTED` lists the shifts the page
makes today, and each is a defect waiting on its fix: the bottom bar as
news lands, the runtime root, the section after a diff at first reading,
a package Ask and the paragraphs after it, ship-review's tasks, the
process page's screenshot, the MCP App's frame, a sample frame, the
gallery column, and thread cards as a reply lands. Without the list they
fail 102 tests on macOS. Chrome names only the five nodes a frame moved
most, and which five differs between runs and between macOS and Linux,
so each pattern names the region a shift moves and matches any node in
it. The patterns apply only to shifts without input, so they never hide
typing's carry.
- **Typing never carries its field.** The API is right about what moved
but not about why: a move laid out before a keystroke and painted after
it is charged to the keystroke's frame. Its rects are also what a node
paints (a shadow or focus ring included), clipped to the viewport,
rather than the node's box. So at each trusted `beforeinput`, the script
reads the field's box and the box of every element holding it with a
forced layout, and it reads the same boxes again at the start of each
frame of the keystroke's rendering. A shift Chrome reports in that
rendering counts only where it names one of those elements and, in the
next frame's reading, both opposite edges moved the same way from the
key's. Where an animation that moves a box was already running on the
field or a holder at the key and is still running, as a panel sliding in
is, the rest of the rendering is judged by neither rule: that motion
belongs to the press that opened the panel. A field may grow at either
edge; it may not be carried. Chrome doesn't count text inserted without
a key (`fill`, `insert_text`) as input, so a frame of a trusted
`beforeinput`'s rendering is the typing rule's alone; a frame after it
is judged like any other. The keystroke's rendering ends when the
runtime's `lfRenderingSettled` reading goes quiet or after 1s, and
sooner at another key or press, at news (`data-lf-reading`), or at a
scroll of the field's holders.

Chrome hands a frame's shifts to the observer only after it paints. So
`conftest.py` wraps `pytest_runtest_call` to let the frames the test's
last act changed paint, then judges every shift
(`render_harness.judge_shifts`), while the page servers still answer.
`tests/test_render_shift_watch.py` holds both rules and the
last-keystroke case the review found, which fails if the paint wait is
removed. It also holds a composer standing past the viewport's edge with
a shadow, which the first comparison failed, a holder still sliding in,
an unrelated move just after typing (which the review found excused),
and a press in a nested frame.

Bug-back: with `data-lf-folded` removed from the Draft chip, all four
`test_a_thread_keeps_submit_in_its_field_and_resolve_with_its_metadata`
cases fail, and so does
`test_agent_reply_arrivals_keep_open_panel_drafts_and_summarize_batches`,
whose own assertions pass.

The earlier Linux-only CI failure (`typing in leaf-text in
div.lf-compose-field moved div.lf-thread-panel-foot` in
`test_a_settled_delivery_activates_one_fresh_document_with_continuity`)
was the rect mismatch. The key read the foot at 1171,835 419x65, while
Chrome's rect was 1108,835 92x65: a shadow reaching 63px left, clipped
at the viewport's right edge.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[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