Repository navigation
Show each part's question state in a page of parts' list, and mark a waiting row with On Me's tray - #6152
Conversation
… queue's rows do A page of parts listed each part's name and summary but not the state of the obligations it holds, so a page with one question per part read the same in its list untouched, answered, sent back and reopened. Each row down the column now draws the side list's obligation line under its summary: an open mark while one waits on the user, "On <agent>" while one is the agent's, and a check with the answer's own words once every one is answered. A row whose part asks something keeps that line either way, so an answer moves no row, and a part that asks nothing reserves none. The tab's accessible description says the same, as a queue row's does. The phone's row of parts sticking over the open part shows names alone: it already hid the summary to stay one line high, and now hides the state line with it. Parts placed anywhere else still list their names in a row. Side lists drew the line before parts existed (#2633). When #3198 gave parts the side list's row, it widened the summary from `side` to the list running down (`#down`) and left the state line on `side`; neither that commit, its pull request nor the module header records a reason. The `lf-tabs.js` header now says a part's row is drawn as a side list's is. Parts take the side list's path, one `obligationsIn` per row that authors an obligation, and so its cost, which grows with rows times obligations: a switch on a generated page of 400 parts, one question each, took 37 ms of main thread in Chromium against 4 ms before, and a 400-item queue already takes 40 ms. Tests: adds `test_each_part_s_row_says_where_its_question_stands`. No existing test changed. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
left a comment
There was a problem hiding this comment.
The cost bullet postpones a fix that AGENTS.md doesn't let this change postpone. Each row calls obligationsIn(panel), which filters the page's whole obligation list. So drawing the list walks every obligation once per part, which is the "one collection for each member of another" case that Responsiveness rules out. Your own numbers show it growing that way: the time per part switch rose 10× at 400 parts (3.7 → 37 ms). Before this change, only a side list paid that cost. With it, every page of parts does too, and that is the main navigation on large pages.
The reason given for deferring is that the fix "adds a widget API export". By AGENTS.md, that isn't a cost to avoid. Fix the underlying issue says to extend the canonical API when its own job is incomplete. Pages across Leaf updates says changing widget-api.js during alpha needs no protocol bump. A one-pass form, for example one that files obligations under a set of regions by walking each obligation's source up to the nearest region, fixes tabs, parts and the deck together, as the description says. Building it here makes the fix cheaper than this change, not harder. If it lands later, a second surface depends on the quadratic path in the meantime.
|
Agreed on the finding. Correction to what I first wrote here: nothing is being built for it on this branch, because #6151 already builds exactly this ( This change goes through the same
|
|
Confirmed. #6151's |
# Conflicts: # packages/default/widgets/lf-tabs.js
# Conflicts: # packages/default/widgets/lf-tabs.js
…roup labelled with the question, and no choose attribute The test's markup used lf-ask and lf-options' choose, which main dropped, so page check refused the fixture. It protects the same behavior.
A side list's or page of parts' row whose panel waits on the user drew a bare open circle on its answer line, which read as an empty list bullet. That row now ends its name's line with On Me's symbol, the panel's mark for what waits on the user, and leaves the answer line empty; the line shows only the answer or whose turn it is. The symbol keeps its room in every state, as the line does, so a long name wraps the same whatever its answer. Leaf's dot already means an unread reply, and a mark before the name read as a bullet too. The side-list and parts tests assert the symbol where they asserted the open mark.
leaf-agent
left a comment
There was a problem hiding this comment.
The feature gallery's queue steps (examples/developer/feature-gallery.html, #bg-side-list-steps) still say the first obligation's row "carries an open mark" and that undo "restores the open mark and tally". With this change, a row waiting on the user ends its name's line with On Me's tray instead, so those two sentences on the published page now describe a mark readers won't see. Worth updating them in this PR.
…steps and the side-list journey's docstring A row waiting on the user now ends its name's line with On Me's symbol, so the gallery's steps and the journey's description of the row named a mark readers no longer see. Leaf's reviewer flagged the gallery's steps on #6152.
…ws' styles on the mark (#6406) `lf-tabs.js` decides once whether a tab set's list runs down beside its panels: a side list, or a page's parts in a `main` with no Layout. `tabs.css` repeated that decision as `:is(lf-tabs[list="side"], lf-parts)[data-lf-views]` in the eight rules that draw a row's name, summary, state line and On Me's symbol. The module now sets `data-lf-down` on the set and those rules key on it, so the theme draws rows exactly where the module does, and a third kind of downward list needs no CSS edit. The side list's own layout rules (its column, stacking and groups) stay on `lf-tabs[list="side"]`, and the rules that reserve a row's height before upgrade stay on the authored tags, since the mark arrives with the upgrade. Parts placed anywhere but a page's root matched the old selector too and took the column row's grid; they now draw as a boxed set's row of tabs does, their names 1px lower and ringed at the name. Max chose this on the review page for #6152, which it follows. On a root page of parts and on a side list, at desktop and phone widths, every element of the list has the same computed style and box as on the parent commit. The side-list and parts browser tests and the side list's focus and ring tests pass; two of them fail with the module's mark removed. > _This was written by Claude Code on behalf of max-sixty_



A page of parts lists its parts down the window's left edge, each row with its part's summary. A side list of tabs also shows, under each summary, the state of the questions its panel holds: an open mark while one waits on the user, "On " while it is the agent's, and a check with the answer's words once answered. The parts list showed none of that, so a page of parts with a question per part read the same untouched, answered, sent back and reopened. This draws the side list's state for parts too. On a phone, where the list is a one-line row of names, it is hidden as the summary already is.
It also changes how both lists mark a question waiting on the user. That mark was a lone open circle under the summary, which Max read as an empty list bullet. A waiting row now ends its name's line with On Me's tray, the panel's symbol for what waits on the user, and the line under the summary holds only the answer or whose turn it is. The tray keeps its room in every state, as the line does, so answering moves no row and a long name wraps the same either way. An accent dot (Leaf's mark for an unread reply) and a mark before the name were tried and dropped.
The gap was not a decision. Side lists got the line in #2633, before parts existed; #3198 added parts and moved the summary's condition from
sidetodown, leaving the state line onsidewith no reason given.To weigh:
mainand merged into this branch, files a reading's obligations under their regions in one pass (obligationsByRegion), and the parts list takes that pass. Measured before it landed, with the two combined locally: a part switch on 400 parts with a question each takes 5.7 ms in Chromium, against 3.7 ms with no state line and 36.7 ms on the per-row path this change would otherwise have joined; from 100 to 400 rows the time grows 1.8 times.It came out of comparing the
visual-reviewwidget with a page of parts for the same six cases, where this gap was most of the widget's lead. Max didn't ask for it; he read the before/after captures, asked for the lone circles to go, and accepted the tray.Checked with
mainmerged in, with a new browser test covering an untouched part, one answered through its widget, one the user commented on, one reopened by undo, a part that asks nothing, and the phone row; each piece of the change has an assertion that fails without it. The existing parts and side-list tests, the browser type check andpre-commitpass. Before and after captures at three widths in light and dark differ only inside the list column; the desktop pair is in a comment below.