Skip to content

Make multiple-choice Asks finish with Done - #966

Merged
max-sixty merged 3 commits into
mainfrom
codex/keep-focus-after-message-send
Sep 23, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/keep-focus-after-message-send

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Page multiple-choice Asks closed on the first selection, while the same Ask in a thread stayed open until Done. Apply the declared completion verb to both surfaces and show Done after the page write-in field. Single-choice Asks still complete on selection.

The write-in now says that adding selects the option. Submitting from Add leaves focus on its visible control after the field clears. Static copies and print omit Done.

Verified with 1,323 passing Python tests, 47 runtime tests, the focused nightly write-in tests, lint, and a matched browser comparison of the old and new Ask interactions.

This was written by Codex on behalf of max-sixty

This was referenced Sep 23, 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.

$awaits.until in skills/leaf/assets/registry.json now states the opposite of what this diff does, and it is the entry that owns the rule. skills/leaf/assets/CLAUDE.md says "Each x- key's meaning is its $keys entry in registry.json; read that entry before editing a declaration", and that entry still reads:

The verb that closes a thread Ask a record can't … Consulted only in the thread layer: on the page the record answers as ever, versions can honor and retire, and no submit stands between a pick and the agent.

All three clauses are now false. registry/widgets.py's inline comment and authoring-asks.md were updated for the same change; this one is the declaration a package author reads to learn what until means, and it is the one left behind.

The clause worth a deliberate decision rather than a rewording is "versions can honor and retire". Retiring still works — settled is in the group's when — but honoring no longer answers. Measured on 8ef10d80 against e84a03ad with page state, using one page carrying a choose multiple group and a plain choose group, each with an authored chosen option and no reader action: on main neither group is in asks; on this head the multiple group is. So a page that records a set-valued pick in markup — which lf-options' own description still offers ("Authored chosen can record the pick") — now ships an Ask nobody can close except by pressing Done as the reader.

That may well be the right rule: only the reader can say the set is whole, and restated behaves correctly either way (I checked — a rewrite is refused until restated retracts both the choose and the answer, and then the Ask reopens with the state cleared). But the declaration should say which rule it is, and lf-options' authored-chosen sentence should say what it now means for a multiple group. Happy to push the declaration edit if you'd rather not hand-write it.

How the authored-`chosen` reading was measured

A temporary test under tests/, run in both trees with uv run pytest -n0 -s:

from interact_support import PAGE, publish, state_json
# one lf-ask holding <lf-options id="m" choose multiple> and a second
# <lf-options id="s" choose>, each with its first option authored `chosen`
(page_dir / "index.html").write_text(PAGE.replace("<h2>Plan</h2>", "<h2>Plan</h2>" + MULTI + SINGLE))
publish(page_dir)
print([a["source"] for a in state_json(page_dir)["asks"]])

e84a03ad: []. 8ef10d80: ['m'].

Comment thread tests/test_render_options.py Resolved
@max-sixty
max-sixty merged commit 897bd18 into main Sep 23, 2026
5 checks passed
@max-sixty
max-sixty deleted the codex/keep-focus-after-message-send branch September 23, 2026 02:17
max-sixty added a commit that referenced this pull request Sep 23, 2026
The nightly case
`test_a_widget_move_keeps_one_target_seat_across_revisions_until_honored`
fails on current main because it expects a receipt immediately after
ticking an option in a multiple-choice Ask. Since #966, that Ask is
answered by Done; the tick alone hands the agent no receipt.


`test_an_acknowledgment_uses_status_until_an_active_claim_restores_a_disclosure`
already covers the `jobs` receipt and work-seat lifecycle using a
single-choice Ask: Sent, pickup, Working, DOM identity through those
states, and completion. Remove the redundant stale case. Preserve its
separate assertion that a local work-seat control survives an unrelated
page revision in
`test_a_widget_without_a_thread_says_what_the_agent_is_doing`, using a
board card that owns such a seat.

Verification: reproduced the failure on main at `591e06af`; the full
`test_render_options.py` nightly file passes 62/62 after the change. The
updated board-card case and pre-commit pass on the final diff.

> _This was written by Codex on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Sep 23, 2026
The scheduled [nightly
run](https://github.com/max-sixty/leaf/actions/runs/35851210059) on
`895a629c` failed nine browser cases. Five are covered by merged #1002
and #1003. The other four reproduce on current main at `3aa1888` and are
repaired here.

These are stale test arrangements after two intentional changes:

- A multiple-choice options tick no longer answers its Ask before Done
(#966). The margin-label paint test now uses a single-choice Ask, so the
pick produces the receipt whose label it measures.
- Only an answered Ask creates an agent workflow (#983). The export test
marks its draft `needed`, making its edit a real Ask answer before
checking that export strips the live pickup status. The two-unit arrival
test classifies two cards in a swipe-deck Ask, then checks their
distinct pickup and work pulses in the margin and Page Map. Ordinary
board moves no longer serve that role.
- The shipped triage-board rail test now creates and resolves an
anchored thread. It verifies that a real margin entry appears and
disappears without moving the readable column.

Verification: all four repaired cases and the neighboring receipt
lifecycle case pass together under `--run-nightly -n0` (5/5). Pre-commit
passes on the changed files.

> _This was written by Codex on behalf of max-sixty_
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