Skip to content

Make a margin card act like the floating panel: Resolve moves on, a click opens in the reply - #5410

Merged
max-sixty merged 13 commits into
mainfrom
one-thread-view-2
Nov 5, 2026
Merged

max-sixty merged 13 commits into
mainfrom
one-thread-view-2

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

A margin card now behaves like the floating panel where the two differed without a reason. This is step 2 of one thread view: #5390 had both draw a thread through ThreadView, and this makes them act alike, on the user's two picks from 4 November.

Resolve in a card moves on. At a passage with several threads the card shows the thread after the one resolved, else the one before, and stands the user on it, so the page doesn't move. A passage with one thread closes the card, and Undo opens the thread again in the card. buildThreadCard and landing in thread-preview.js own this. After a step the card places itself as any new selection does, so a shorter thread brings it back beside its passage; the user asked for that over a hold of its own that would have kept ✓ under the pointer.

A click opens a thread in its reply. openingPart in thread/focus.js holds the one rule: a click lands in the reply, and a key or a finger lands on the thread, where keys act. It covers the margin marker, the passage's mark, ‹ and ›, a Page Map row and Show on page, and destination.js defaults to it. Enter on a row of Threads or On me keeps the caret in the reply, as on main, because otherwise the next words typed would run as commands (r resolves, ? opens the command list).

A reply session begins only on the user's own act. Typing, pressing in the box, Tabbing into its row, or c or Enter on a thread begin one; a caret left by an opening, a send or a pass begins nothing. CardAnchor reads the session instead of keeping its own account of writing, so an agent's Resolve still moves a card a click opened with nothing typed.

Next unread and New reply move from the panel into ThreadView, so both surfaces draw them from one place. A card names its transcript as the box that scrolls the thread, and tells the thread each time a placement lands. An answer past a capped card's foot now takes the panel's rule: the user's turn stays in sight above it, with New reply at the foot, where before the card's own scrolling hid the turn. That goes further than the user's 31 October note on cards, and card-anchor.js records that it was done to unify the two rather than picked.

Every card offers Next unread, as the user picked. It shows only while a reply the opening left unread remains. Its words stand on a card with one thread; beside ‹ 1/2 › it stands on its chevron alone, with the words as its tooltip, and under a finger there it draws nothing, because even the chevron left a head no room for the author's name.

Testing

pnpm run check:browser, pre-commit and pnpm run test:runtime (810) passed just before the last merge with main, as did the card's Resolve and reply tests in Chromium (60), and the tests that open a thread (16) pass after it. An earlier reviewer used the branch cold in Firefox by click, key and touch, in two passes, the second finding nothing new; the hold's removal since then is a small subtraction that I read myself and checked with a Firefox probe of a Resolve.

Before the last merge with main, a focused selection failed only on tests that also fail on a clean copy of main or passed on rerun. test_reopening_a_library_select_keeps_its_options_visible fails on main itself.

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

…e panel

A press on a thread's margin marker, on its passage's mark or on a card's Previous and Next now puts the caret in its reply box, as a press on a row of Threads does in the floating panel, so typing answers at once, and Escape stands the user on the thread, where keys act. A key puts them on the thread, and so does a finger, since a box would raise the keyboard over what they opened to read. The user chose this on 4 November 2026 over opening on the thread wherever a click opened it, as the card did. One rule says so, `openingPart` in thread/focus.js, which the card, the margin, a mark and the panel's view all ask; the panel's own reading of whether a key or a pointer began the gesture goes for `pressLed`, which already answers that.

Behavior this changes beyond the pick's clicks:

- Enter on a row of Threads or On in the panel now stands the user on the view, where it put the caret in the reply. The decision the user saw said a key's opening stands them on the thread on both surfaces, which the panel's rows did not do, so this makes that true; Enter again enters the reply.
- Previous and Next in a card work from its reply. On main a press on either did nothing while the caret stood there: the press counts as one in the thread, so the reply's editing session went on, and the thread pass carried the card back to the thread that held it. The press now ends that session, keeping its draft, as the panel's leaving a thread does. A click's opening now reaches this every time.
- The caret an opening leaves in a card's empty box is no draft being written (card-anchor.js), like the one a send leaves there, so an answer the user waits for shows at once, as it did on the thread. `forget`, which drops what a placement held, no longer drops that reading with it.

The card lands the thread whole as it opens, since landing on its reply box takes its transcript to its end, past the turn the card opened on.

Test expectations change only for this behavior. Those whose subject stands on the thread press Escape after the click; `test_c_lands_where_its_badge_is_and_in_the_card_on_screen`'s marker route does too; `test_a_thread_can_be_answered_in_the_margin_without_opening_threads` and `test_a_shared_passage_steps_between_single_thread_cards` hold the rule itself, the second the Next from a reply; `test_a_finger_opens_a_card_on_its_thread` and `test_news_shows_in_a_card_whose_opening_left_the_caret_in_its_box` are new.
A passage with several threads, shown in the card as "1/3" with Next, now shows the thread after the one resolved, else the one before, and stands the user on it, so `r`, `t` and Escape go on from there, and the page never moves. A passage with one thread closes the card onto it, as it did. Undo brings the thread back into the card where it was resolved. On main the card showed the passage's first thread, whichever one was resolved, and left focus to the repaint.

The rule is general: any thread that leaves the cluster a card shows gives its place to the one after it (`buildThreadCard`), and Resolve's landing stands the user on whichever stands there. The user chose this on 4 November 2026 over closing the card onto its passage whatever else stood there, and over moving on to the next open thread on the page, as the panel does, which scrolls the page after each Resolve. thread-preview.js's header records it, replacing its note that resolving closes the card.
…e panel

`ThreadView` now owns both, which only the floating panel had, so one mechanism serves both surfaces and each gives the thread its places and its scroller through the outlets.

Next unread stands where the container's head line names a place (`head.unread`, or a card's `line`). Whether an opening offers it is decided once the container says the thread stands and a pass of read tracking has read what it shows whole (`settled`), as the panel decided. In a card it stands on the head line, before Previous and Next, and goes to the first unread reply by a press, Tab and Enter, or a tap. While a rewrite stands open there it gives up its room to Discard and Save, which a narrow card under a finger could not otherwise fit.

New reply is the foot that appears when an answer the user waits for arrives past the foot of the box scrolling the thread, which a container names (`scroller`): the panel's view, a card's capped transcript. The thread reads the answer from its own change (`threadChange`), reads the box as the container says it stands at its size (`settled`: after the reader's `drawn` in a primary reader, after placement lands in a card), and draws the press at the end of its transcript, where it sticks at the box's foot. The panel behaves as it did. In a card, a reader at the transcript's end needs none, since the card's tail-following shows the answer; a reader scrolled back would otherwise miss it, so New reply says so there, and their place holds. A press or a key on it shows the answer's start and stands the user on the thread, and scrolling there or sending another turn takes it away.

Who moved a scroller is now `browserScrolls` rather than the panel's record of where it last put its view, so `keepFoot` loses `kept`. `parts.thread`'s `drawn` takes no answer, since nothing else read it, and `HeldThread` loses its `change`. Its `head` takes `unread` and it takes `scroller`, so a package's thread can have both (module-annotations.md).

The panel's classes become the thread's (`.lf-next-unread`, `.lf-new-reply`, `.lf-awaited`), which tests and states follow. Stills states `plan-card-cluster-resolved`, `ship-card-next-unread` and `ship-card-new-reply` reach the new behaviour.
# Conflicts:
#	browser/AGENTS.md
#	browser/runtime/thread/held-news.js
…af placed

A thread opened by a click had the caret in its empty box, and that caret's
`focusin` began a reply session. A session keeps a resolved thread in the margin
(`threadHasDiscussion`), so an agent's Resolve left the card standing on "Resolved
by Agent" over an empty box, where main moves on to the next thread at a passage of
three and closes the card at a solo passage. It was the same class as #5364: focus
was taken for the user writing.

A session now begins when the user types (`save`), presses in the box, Tabs into its
row, or runs a command that takes them there (`landIn`: `c`, Enter on a thread). Focus
arriving elsewhere begins nothing unless the box already holds their words, and a
session already standing moves to the row focus reaches. So a caret from an opening,
from a send or carried across a pass stays no session.

`CardAnchor` reads that session rather than keeping its own record of whether the box
was typed in, so `#sentFrom`, `opened()`, `leftReply()` and `session.opened` go.
Tests: an agent's Resolve after a click's opening at a three-thread and a solo
passage, and each of the user's acts retaining the card.
Enter on a panel row stood the user on the thread once `openingPart` covered the
panel. After `g T` and Enter, typing "really?" then resolved the thread with `r`, moved
on, and opened the Command reference with `?`, where main types the words. Escape also
closed the panel in one press rather than two. The user's pick of 4 November was about
clicks.

The panel opens a thread in its reply again, from a row by a key as by a press, and a
finger stands on the view as on main. `openingPart` keeps a key on the thread for `t`,
and for a key on a marker or Next, and its comment says why a row differs. This restores
the expectations of `test_the_keys_into_and_out_of_a_panel_thread_land_where_keys_act`
and `test_a_thread_opened_in_the_panel_by_the_keyboard_opens_no_card_beside_it`.
…nswer at its cap

Resolve, Previous and Next each make a new session, and a new session placed the card
afresh. A card risen for a tall thread dropped when a short one took over, so Resolve
went from y 145 to y 405, and a second press at the same spot hit blank margin and closed
the card. A step to another thread at the passage now adopts the frame the card stands
in, as a card the user dropped does (`place-stepped`), and hands over the anchor, whose
press goes on holding. Above its subject the card keeps its foot, since a taller thread
held by its top would cover the words it is about.

An answer past a capped card's foot took the transcript to its end, which hid the user's
turn, the thing the 31 October note says the rising card was for. The card now takes the
floating panel's rule: their turn stays in sight above the answer, with New reply at the
foot, unless the two fit together. The thread says when the answer is its to place
(`answering`), and neither the card's tail following nor a send's kept landing moves the
transcript then. This was done to unify the two under the user's request for one thread
view, not picked by them; card-anchor.js records that. Other agent turns still follow
the tail. `test_a_card_says_new_reply_for_an_answer_past_its_transcript_s_foot` changes
for a reader at the end.

New reply stands a message head's height, under a finger the aim floor, in the shared
rule, where a card's was 17px tall.

A card draws nothing for an unoffered Next unread, since nothing on its line moves for
it; the floating panel keeps its seat. Beside Previous and Next the press stands on its
symbol, because its words left two-thread cards' heads reading "Me ju". Under a finger
beside them it draws nothing, since even the symbol left a head no name.

Also corrects `docs/ui.html` on what a card's Resolve does and a stale name in
floating-panel.js.
`openPageThread` kept two defaults, the reply on a seat and the thread on a card, so a
Page Map row and Show on page landed by which surface drew the thread. A route naming no
part now follows `openingPart`: a press in the reply, a key or a finger on the thread.
The mark, the margin's fallback and a card's step no longer name that default.

Enter on a Threads row into a package's reader names the reply, as it did in effect, so
it stays with the panel's own row.

Two Page Map tests expected a press to land on the thread, and now expect its reply.
…unread

`CardAnchor` no longer records whether the box was typed in, so the two unit tests of
that record move to a browser test of the session: news shows beside the box a send left,
and waits once the user types there, even words they erase, or comes back to it.

A second test holds a two-thread card's first head to its whole author and time beside
Next unread's symbol, and a finger's card to drawing no press there.

Also says why Enter on a row keeps the caret in plainer words.
# Conflicts:
#	browser/AGENTS.md
#	browser/runtime/annotation-overlay/thread-preview.js
A step to another thread at the passage, by Resolve, Previous or Next, kept the frame the
card stood in, so a shorter thread left ✓ under the pointer. The user asked for the
simple thing rather than a placement rule and a press hold for this, so a step places
the card as any new selection does: a shorter thread brings it back beside its passage,
with the controls on its head line. The header of thread-preview.js records the choice.

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

I found nothing to change in the code. Moving New reply and Next unread into ThreadView, with the card and the panel each naming its own scroller, takes out the panel's own copy and CardAnchor's #sentFrom. That gets the two surfaces closer to one thread view.

I'm holding approval only because the description says where Next unread goes in a card is still the user's call and "may change before landing". Once that's settled, this is ready from my side.

# Conflicts:
#	tests/browser/margin/test_opening_threads.py
@max-sixty
max-sixty merged commit a02c20f into main Nov 5, 2026
4 checks passed
@max-sixty
max-sixty deleted the one-thread-view-2 branch November 5, 2026 06:53
leaf-agent added a commit that referenced this pull request Nov 5, 2026
…lick-opens-in-reply (#5543)

Four `--run-main` tests have been red on main since #5375 and #5410.
Each fails because the test still expects behavior one of those changes
replaced, so this PR updates the four tests and leaves product code
alone. All four fail on current main and pass on this branch: `uv run
pytest --run-main` over the four node ids, 8 cases.

- **#5375** made a titled card's pick the float that reserves its corner
slot. Before, a `::before` reserved the slot and the pick was positioned
with `z-index: 1`.
- `test_a_quoted_widget_exhibits_without_taking_input` read the slot
from `::before`, which no longer exists, so both cards read 0. It now
measures the pick's float margin box: 0 on the exhibit, which has no
mark, and >0 on the live card.
- The pick is now unpositioned, so the binding badge positioned in the
same seat paints over it and takes a press there. Playwright refuses to
click the covered mark.
`test_a_queue_row_names_an_answer_whose_widget_module_arrives_last` now
presses the card. `lf-options.js` already takes a press on the card or
on the badge as a pick.
- `test_workspace_end_room_stays_inside_the_last_reading_region` clicked
the mark and then walked with ArrowDown and Space. A press on the badge
leaves focus on the ask, as a press on the card's words already did, so
the test now focuses the mark before the walk.
- **#5410** made a click on a margin marker open the thread in its reply
(`openingPart` in `thread/focus.js`).
`test_the_margin_groups_meanings_at_one_destination_without_moving_the_page`
still expected the reply to be unfocused after a marker click, a case
#5410 didn't update. The test now expects it focused.

**Behavior changed:** a pointer press on a worn digit in a card's corner
still picks, but it no longer focuses the mark. #5375 caused this change
without stating it. This PR records it in the tests rather than undoing
it. #5542 asks the maintainer whether that press should focus the mark.

I tried giving the badge `pointer-events: none` so the press would reach
the mark again. That hides the badges: `command-hints.js` seats a badge
only when hit tests find it on top, and three binding tests in
`test_render_options.py` failed. That approach is dropped.

The margin test first failed at #5375 with a different assertion:
`{'needed': 1163, 'rail': 119}`, in run 41876972397. That assertion
passes on current main, so the only failure left was the reply focus.

Closes #5485 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 7, 2026
…5664)

Two of the three tests in #5643 still expected the behavior that #5410
replaced. Since #5410, a click opens a thread with the caret in its
reply (`openingPart` in `browser/runtime/thread/focus.js`). This PR
updates those two tests and changes no product code. On current main
each fails, and on this branch each passes (`uv run pytest -n0` over
both functions, 5 cases).

- **`test_agent_progress_stays_on_the_thread_control`** (`[reduce]` and
`[no-preference]`) clicks › in a card, then expects a single Escape to
close the card. Now the click leaves the caret in the reply, so the
first Escape stands the user on the thread and a second one closes the
card. A probe of focus after each press confirmed this. The test now
expects the reply focused, presses Escape, and then leaves the card as
before.
-
**`test_back_returns_the_passage_chosen_between_trips[click-True-False]`**
put its "independent paragraph" inside `<section id="first">`, which the
first thread comments on. A click there now opens that thread in its
reply, and the reply takes the selection the test waits for at
`#elsewhere`, so it timed out. The paragraph now follows the section.
The section's tail stays visible above it, which keeps the test's check
that the old landing still shows.

The third test,
`test_a_root_summary_keeps_thread_actions_outside_its_fold[1400-True-10]`,
is a real layout regression rather than a stale expectation. On a 298px
touch card, the Next unread words that #5410 added to one-thread cards
leave the summary header a 57px column. "Earlier discussion" then breaks
mid-word over three lines, and the disclosure is cut to "Sho…". Fixing
it means choosing between Next unread's words and the summary header's
room. That choice stays open on #5643.

Refs #5643 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 7, 2026
…opens (#5679)

Two nightly journeys still expected a click to land on a thread, which
#5410 replaced: a click now opens a thread in its reply (`openingPart`
in `browser/runtime/thread/focus.js`). This updates both tests the same
way #5664 updated the browser tests #5643 tracks. No product code
changes.

-
**`tests/journeys/margin/test_card_placement.py::test_every_card_keeps_the_placement_rules`**
(all six cases). The test opens each card by its margin marker and
closed it with one Escape, so `expect(card).to_be_hidden()` timed out.
Now the test checks that the caret is in the reply, then presses Escape
twice: the first stands the user on the thread and the second takes the
card down.
-
**`tests/journeys/test_render_playwright_trace.py::test_trace_comments_restore_an_exact_image_and_duplicate_named_element`**.
After a click on ‹ or ›, the test expected `.lf-page-thread` to hold
focus and then pressed `t`. Focus is now in the reply, where `t` would
type a letter. The test now checks the reply and presses Escape, which
stands the user on the thread, before it walks with `t`.

Run locally with `--run-nightly`, all seven cases fail at `a02c20ff0`
(#5410) and pass at its parent `3795150ae`. With this change they pass
on main `ccecec2c0`.

Refs #5657 — automated triage. This settles 7 of the 18 cases listed
there. The other causes are linked from that issue.

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit that referenced this pull request Nov 18, 2026
…iage workers (#5700)

When the push and schedule `ci` reports on `main` (#3985, #4225) are
diagnosed together, their workers now divide the failures instead of
each bisecting the same tests. The push report owns any failure a push
run also shows. The schedule report covers only what pushes don't run
(`journeys`, `nightly` tests, `test-macos`) and links the push report's
causes for the rest. The change is one paragraph in `running-tend`'s **A
red `ci` on main is live**.

A scheduled run includes every test a push runs (`ci.yaml`'s header), so
the two reports' failures overlap almost entirely. The daily sweep's
recovery dispatches both reports in one triage batch, and they run in
parallel. Nothing in the bundled triage reference or this overlay
divides the shared failures between them. The bundled ownership recheck
before filing catches only part of it: the bisect work is spent long
before a session files anything.

Changes to agent instructions wait for the control-plane owner. #5197
also edits this file, in a different section (**Weekly: test tier
budgets**), and the two don't conflict.

<details><summary>Evidence</summary>

- **Triage batch 42353712556 (2026-11-07).** Its #3985 job ran 193 min
and its #4225 job ran 196 min, almost all of it local `--run-main`
reruns and `git bisect` runs.
- #4225 found #5591's breakage and opened #5631 at 08:51. #3985 had
checked for owners only once, at 08:06, so at 10:31 it filed #5639 for
the same cause, which #5631 then closed.
- Both jobs tested #5428 against its parent (09:19 and 10:34), and both
bisected #5410's test (#4225 at 09:20–09:35, #3985 again before filing
#5643 at 11:01).
- #4225 noticed its sibling only at 11:05 ("A concurrent #3985 session
is filing the same causes right now"). It then waited about 12 min on
that job's filings, and its confirmed attributions "matched theirs".
That is roughly 60–90 min of browser-suite work that produced no new
owner.
- **Triage batch 41591090041 (2026-11-03).** The same pair ran in
parallel and filed three duplicate cause pairs (#5166/#5167,
#5168/#5170, #5153/#5154), which the sessions consolidated within
minutes.
- Both occurrences are recorded in the review-runs tracker #5067.

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