Repository navigation
Count and walk a region's asks: one region rule, a scoped walk, lf-tally - #2633
Conversation
A queue page could not say how many of its decisions were left except as a
static chip or sentence the agent wrote, which went stale at the first answer,
and the rule for "the asks inside this element" existed in several places that
already disagreed.
- `asksIn(region)` (questions/place.js, exported from widget-api.js) is the one
membership rule: a widget ask, not withdrawn, whose source element is the
region or stands under it. Membership reads the complete inventory; each
consumer selects from the members. A side-list lf-tabs row and lf-tally count
every member and how many are answered, so an ask the user discussed and left
with the agent still counts as open. work.js's interventions take the members
whose next actor is the user, since only those stop work on the user; it no
longer re-derives membership from x-awaits elements. questionHolding stays the
converse question (which ask holds the node the user stands in), with its
context fallback, as standing rather than membership.
- `questionActions.next({within, dir})` is the q walk within a region: its stops
are the region's asks waiting on the user, stepped by the walk's own standing
and page order, announced as "N of M waiting on you here · Ask". A press from
outside the region enters it at its edge.
- `lf-tally for="…" [next]` (default package) shows "7 of 8 to answer", then
"All 8 answered", with its room reserved by x-prepaint so a changing count
moves nothing, nothing until the first reading is in, and an optional Next
question button that keeps the user standing where they are on a press (native
button: Tab/Enter and tap).
- A side-list row now shows its item's state while undecided too: a quiet open
mark (○, muted) until every ask is answered, then the existing check. Its tab
description says "Unanswered" or "k of n Questions answered". The withdrawn
test and the side-list journey assert the open mark where they asserted no mark.
- alert-review's header carries the tally and its footer drops the static
"Nine decisions open"; the feature gallery's side-list scenario gains one.
- page-authoring's workspace section names lf-tally for a queue's count instead
of a chip, and "Page behavior" points page modules at watchQuestions with
asksIn and questionActions.next; module-authoring documents both.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/runtime/queue-walk.js # skills/leaf/references/module-authoring.md
leaf-agent
left a comment
There was a problem hiding this comment.
The tally’s Next question restarts at the first ask when activated from keyboard focus. After Enter moves focus to the first ask, tabbing back to the tally button puts walkOrigin() on that button in the header, outside the for region. The scoped walk then takes its “outside” branch and selects the first ask again. I reproduced this with two asks: Enter on the tally reached the first; focusing the button and pressing Enter again left focus on the first instead of reaching the second. The mouse test passes because its mousedown handler keeps focus on the ask. Please make repeated keyboard activation advance through the region too, and cover that route in the tally test.
Enter on lf-tally's Next question, reached by Tab from the ask the user was on, restarted at the region's first ask, because Tab had moved the user's place onto the control outside the region. The walk within a region now keeps the id of the ask the user last went to (any standing change but Tab/Shift+Tab replaces it) and counts from it when the press comes from outside the region; with none, it counts from the first of the region's asks the user can see, as a place they are at, and only then enters at the edge. The tally test now drives a side-list region by real Shift+Tab traversal. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The documented entry rule for questionActions.next still differs from the new behavior when no prior ask is kept.
…st in sight Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…waiting row with On Me's tray (#6152) 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 <agent>" 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 `side` to `down`, leaving the state line on `side` with no reason given. To weigh: - A page of parts is the page's navigation, and a side list is the documented shape for one decision per item. This puts a second display of what On Me already counts on a surface whose job is to say what each part is. For a part holding many questions the tray stays until the last is answered. - Leaf's symbols otherwise mark controls; the tray here marks state, in the summary's grey, and the row is pressed as before. - Cost on a large page: #6151, now on `main` and 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-review` widget 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 `main` merged 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 and `pre-commit` pass. 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. > _This was written by Claude Code on behalf of max-sixty_
A queue page could only say how many of its decisions were left as a chip or sentence the agent wrote, which went stale at the first answer, and the rule for "the asks inside this element" existed in several places that already disagreed. This gives the page one region rule, a walk within a region, and an element that counts and walks a queue, and marks each queue row's state while it is still open.
What changed
asksIn(region)(runtime/questions/place.js, exported fromwidget-api.js): a widget ask, not withdrawn, whose source element is the region or stands under it. Membership reads the complete inventory and each consumer selects from the members: a side-listlf-tabsrow andlf-tallycount every member and how many are answered (an ask the user discussed and left with the agent still counts as open), whilework.js's interventions take the members whose next actor is the user, since only those stop work on the user.work.jsno longer re-derives membership fromx-awaitselements.questionHoldingstays the converse, standing question, with its context fallback.questionActions.next({within, dir})is theqwalk restricted to the region's asks waiting on the user, by the walk's own standing, page order and wrapping, announced as "N of M waiting on you here · Ask". A press from outside the region, such as Enter on the tally's control after Shift+Tab, counts from the ask the user last went to (Tab and Shift+Tab keep it; any other move replaces it), else from the first of the region's asks in sight, else enters at the region's edge.lf-tally for="…" [next](default package): "7 of 8 to answer", then "All 8 answered", in the chip face of a header's.tags. Its box is reserved byx-prepaint(up to two-digit counts), it shows nothing until the first reading is in, and its optional Next question is a native button (Tab/Enter, tap) that keeps the user standing where they are on a press, so repeated presses step on. Disabled when nothing in the region waits on the user.alert-review's header carries the tally and its footer drops the static "Nine decisions open"; the feature gallery's side-list scenario gains a tally and steps.page-authoring.md's workspace section nameslf-tallyfor a queue's count instead of a chip, and "Page behavior" points page modules atwatchQuestionswithasksInandquestionActions.next;module-authoring.mddocuments both. A newalert-queue-tallystills state captures the tally after Next and one answer.Review notes
test_a_tally_counts_its_regions_asks_and_walks_them(count, outside ask excluded, pointer and real Shift+Tab/Enter step-on in a side list, disabled when done, box stable); the side-tabs withdrawn test and the side-list journey now assert the open mark; a runtime test forasksIn.