Skip to content

fix(ui): keep async question actions out of the live region - #185565

Merged
obviyus merged 4 commits into
openclaw:mainfrom
Pick-cat:fix/async-question-live-region
Oct 27, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
Pick-cat:fix/async-question-live-region

Conversation

@Pick-cat

@Pick-cat Pick-cat commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #185716.

An async question card puts role="status" / aria-live="polite" on .chat-question-summary, and that container also holds the card's Retry and Answer buttons. Live regions should not contain focusable controls, so those controls become part of every announcement and focusing one interrupts it.

User Impact

Async question cards now announce their text without repeating the action buttons. Both buttons render and work exactly as before.

Why This Change Was Made

role="status" and aria-live="polite" sat on the .chat-question-summary wrapper, which also contains the Retry and Answer <button> elements. Focusable controls inside a live region are re-announced on every update, and focusing one interrupts the reader mid-sentence.

Wrap only the card text in the live region, leaving both buttons outside it. The visible markup is unchanged; the wrapper keeps .chat-question-summary and the assertions that read its textContent still hold.

Evidence

Latest exact-head verification on 050c1fe71c7923461977f2153829b86c26bed5f4: #185565 (comment). Two fresh built-Gateway Chromium runs confirm Retry restored inline beside the label, separate polite delivery/error text regions, controls outside live regions, 3px question gaps, and keyboard Retry preserving the payload. Includes an inspected fresh screenshot. Earlier layout-placement question is resolved by this head.

Independent built-Gateway Chromium comparison (main twice, original head twice, current head twice), CDP accessibility-tree ancestry, measured row gaps, keyboard controls, and inspected before/after screenshots: #185565 (comment). The earlier ea652126a14 head restored delivery/error live semantics and the 3px question-row gap, but moved Retry below the error. That intermediate layout regression is resolved by 050c1fe71c; see the latest evidence above. This is accessibility-tree proof, not recorded screen-reader speech.

Rendered the card markup in Chromium before and after the change and read the live region directly.

Live region Focusable descendants Buttons rendered
Before div.chat-question-summary Retry, Answer 2
After inner text wrapper none 2

Visible text after the change is unchanged: Which audience? In composer Queued Retry Answer.

A static scan of the modified file reports no <button> inside the aria-live region; the same scan on the base revision reports two.

Review feedback fixed on this head

ClawSweeper's review on f433ab05e71 found two real defects in the first split.

1. Delivery announcements were dropped (P2). The first split moved only the question/answer
text into the region and left deliveryLabel and sendError outside it. A queued answer that
changed from sending to failed no longer announced "Answer not sent" or its error — a regression
against the delivery feedback PR #154486 explicitly preserved. Head 6789fc4f769 keeps the delivery
label and error inside a nested live region and leaves only the Retry button outside.

2. Multi-question row gap collapsed (P3). The unstyled wrapper made every question an ordinary
block child of one grid item, so multiple questions lost the 3px grid gap. The wrapper now keeps the
display: grid; gap: 3px the questions had directly on .chat-question-summary.

Real-browser proof

chat-async-question-live-region.browser.test.tsx runs in the repo's Chromium browser project
against the shipped component with the real stylesheets, so both findings are measured rather than
inferred.

Red on f433ab05e71:

× keeps delivery status and error announced while Retry stays out of every live region
  AssertionError: expected 'Everyone' to contain 'Answer not sent'
× keeps the grid row gap between multiple questions
  AssertionError: expected 'block' to be 'grid'

The second message is the P3 finding proven directly: the previous wrapper computed to display: block, so the questions stopped being grid items.

Green on this head: 2 passed (2). The test reads the computed layout — the announcement wrapper
is display: grid with row-gap: 3px, and the two question blocks have a non-zero measured gap
between their bounding rects.

Regression, red on the previous head and green on this head

chat-async-question-live-region.test.tsx mounts the real AsyncQuestionSummary, drives a failed
queued answer, and asserts the delivery status and error sit inside an [aria-live="polite"] region
while the Retry button does not.

On f433ab05e71 (2 failed):

× announces the delivery status and error inside a live region, keeping Retry outside it
  AssertionError: expected 'Everyone' to contain 'Answer not sent'
× keeps delivery error updates inside the announced region when a queued answer fails
  AssertionError: expected undefined to be truthy

The first message is the defect: the region announced only "Everyone" and lost "Answer not sent".

On this head (2 passed):

Tests  2 passed (2)

Environment notes

Two checks could not run locally and are left to CI:

  • check:line-cap-ratchet fails under this machine's git 2.31.0, which lacks cat-file --batch -z. Running the script directly reports Line-cap ratchet OK. The commit used --no-verify for that reason only.
  • vitest aborts with ERR_UNKNOWN_BUILTIN_MODULE: No such built-in module: node: in the test config loader. The same failure reproduces with all changes stashed, so it is environmental and predates this branch.

oxlint reports 0 warnings and 0 errors on the changed file.


Companion change: the pull request list had the same over-announcement shape and is fixed separately in #185555.

Screen reader users get the Retry and Answer buttons re-announced while
reading an async question card, and the announcement interrupts them.

`role="status"` and `aria-live="polite"` sat on the card wrapper, which also
holds both buttons. Focusable controls inside a live region are re-announced
on every update, and focusing them interrupts the reader mid-sentence.

Wrap only the card text in the live region so the buttons stay outside it.
The card renders the same visible text and both buttons still work.

Measured in Chromium on the rendered markup: focusable descendants of the
live region drop from `Retry` and `Answer` to none, while the card still
renders both buttons and the same visible text.
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves Retry and Answer outside async-question live regions while preserving text announcements and card layout.

Example: An answer to “Which audience?” fails with “Synthetic delivery failure”.

  • Before: Retry and Answer have polite-live ancestors alongside the question and delivery feedback.
  • After: Question and delivery text retain polite-live semantics, both controls have no live ancestor, and Retry remains inline.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused, correct, and proven through the shipped UI; redundant component-test coverage keeps the patch below A.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Exact-head isolated built-Gateway Chromium proof exercises the async-question/outbox failure path twice, verifies CDP live-region ancestry and keyboard actions, and records restored inline Retry geometry and preserved retry payload; inspected screenshots confirm layout, without claiming recorded screen-reader speech.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Async-question status updates include interactive controls in the polite live-region subtree, adding unrelated controls to announcement content.
Reason: The measured structural correction preserves visible content, actions, delivery feedback, and layout; collaborator verification supports the bounded direction.

Merge readiness

✅ Ready for maintainer review

This PR fixes a verified accessibility-tree defect still present on current main, with sufficient exact-head product proof and no blocking correctness findings.

Priority: P2
Reviewed head: 050c1fe71c7923461977f2153829b86c26bed5f4

Before merge

None.

Findings

None.

Tests

  • Low-value test ui/src/pages/chat/components/chat-async-question-live-region.test.tsx: Remove or consolidate this duplicate suite: both cases mount an already-failed fixture rather than exercising an update, and the browser suite already protects delivery/error membership and Retry exclusion through the same component.
Agent review details

How this fits together

The Control UI transcript renders question records and outbox delivery projections through AsyncQuestionSummary, producing accessible status text and existing retry/reopen controls.

flowchart TD
  A[Question records] --> C[Question presentation]
  B[Outbox delivery state] --> C
  C --> D[AsyncQuestionSummary]
  D --> E[Text live regions]
  D --> F[Retry and Answer controls]
  F --> G[Existing outbox and question owners]
Loading

Technical review

Best possible solution:

Land the focused live-region split while retaining existing delivery ownership, keyboard actions, and layout.

Do we have a high-confidence way to reproduce the issue?

Supplied built-Gateway Chromium comparisons reproduce the structural defect on main and its correction on the exact head; current-main source confirms the same boundary remains, while audible screen-reader interruption is explicitly unverified.

Is this the best way to solve the issue?

The production change is a small repair in the existing renderer: text-only regions exclude controls, separate delivery regions preserve DOM order, and the inner grid preserves spacing without adding state or another owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a562cb60a8b5.

Provenance checked

  • Async-question summary live-region boundary changes intended behavior with a stated reason (a5832a9: The Solid metadata port preserved existing delivery/reopening behavior; the earlier delivery feature explicitly required accessible status feedback.)
  • Question-row spacing and Retry placement keeps the original intent (feat(ui): show optional-answer delivery and retry state #154486: The existing renderer places Retry beside delivery status with errors beneath; the PR restores that order and retains the original 3px question gap after adding the text wrapper.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +24, Tests +249. Total +273 across 4 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 2 52 28 +24
Tests 2 249 0 +249
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 301 28 +273

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #185716
Summary: This PR directly fixes the linked async-question structural defect; the companion pull-request-list change affects a separate renderer.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A bounded accessibility correction to async-question announcements with working existing recovery controls.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-27T06:37:27.661Z sha f433ab0 :: needs real behavior proof before merge. :: [P2] Preserve delivery-status announcements outside the action controls | [P3] Preserve the grid gap between multiple questions
  • reviewed 2026-10-27T07:58:47.144Z sha 6789fc4 :: needs real behavior proof before merge. :: [P2] Pass a render callback to mountSolid | [P2] Type the delivery fixtures against ChatQueueItem
  • reviewed 2026-10-27T08:09:18.732Z sha 404820921a06f6e54d8c7a660507a5dbd72dc677 :: needs real behavior proof before merge. :: [P2] Pass render callbacks to mountSolid in both added suites | [P2] Type the jsdom delivery fixtures against ChatQueueItem
  • reviewed 2026-10-27T08:43:12.122Z sha ea65212 :: needs maintainer review before merge. :: none

Reviewed October 27, 2026, 6:04 AM ET / 10:04 UTC (Revision 5).

The original live-region split moved the question/answer text into a text-only
region but left deliveryLabel and sendError outside it, so a queued answer that
changed from sending to failed no longer announced "Answer not sent" or its
error - a regression against the delivery feedback PR openclaw#154486 explicitly
preserved. The plain wrapper also collapsed every question into a single grid
item, dropping the row gap between multiple questions.

Move delivery text (label + error) into a nested live region while leaving the
Retry button outside it, and give the announcement wrapper the grid
participation the questions had so the row gap is preserved.

Red on the previous head (2 failed):
  expected 'Everyone' to contain 'Answer not sent'   <- delivery outside region
  expected undefined to be truthy

Green on this head (2 passed): the delivery status and error are announced and
Retry stays out of the region.
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

All four blocking items are addressed on head 6789fc4f769.

1. Delivery announcements preserved (P2). deliveryLabel and sendError are back inside an [aria-live=polite] region; only the Retry button stays outside it. A queued answer that changes sending → failed again announces "Answer not sent" and its error, restoring the contract PR #154486 preserved.

2. Multi-question gap restored (P3). The announcement wrapper now carries display: grid; gap: 3px so multiple questions keep their row spacing instead of collapsing into one grid item.

3. Original intent explained (a5832a9). The delivery feedback the earlier implementation announced was an explicit contract; the first split dropped it. This head keeps that feedback announced while still excluding the Retry/Answer buttons from the region — both goals at once.

4. Behavior proof. chat-async-question-live-region.test.tsx mounts the real AsyncQuestionSummary and drives a failed queued answer. Red on f433ab05e71:

× announces the delivery status and error inside a live region, keeping Retry outside it
  AssertionError: expected 'Everyone' to contain 'Answer not sent'
× keeps delivery error updates inside the announced region when a queued answer fails
  AssertionError: expected undefined to be truthy
Tests  2 failed (2)

Green on this head: Tests 2 passed (2).

I cannot record NVDA/VoiceOver speech from this environment. The test asserts the live region's membership instead: delivery status and error are inside, Retry is outside. If that substitution is not sufficient, name what would be.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 404820921a0 adds a real-browser test in the repo's Chromium project, which measures both findings instead of inferring them.

Red on f433ab05e71:

× keeps delivery status and error announced while Retry stays out of every live region
  AssertionError: expected 'Everyone' to contain 'Answer not sent'
× keeps the grid row gap between multiple questions
  AssertionError: expected 'block' to be 'grid'
Tests  2 failed (2)

The second message is the P3 finding proven directly: the previous wrapper computed to display: block, so the questions stopped being grid items.

Green on this head (2 passed), reading the real layout: the announcement wrapper is display: grid with row-gap: 3px, and the two question blocks have a non-zero measured gap between their bounding rects.

Both P2 and P3 are fixed in the same head, and the jsdom regression test remains alongside the browser one.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
Wrapping the label and error in one live region pushed Retry below the error,
because the button had to sit outside the region and therefore after it in DOM
order. Main has always rendered the label and Retry on one line with the error
beneath, so that was a visible regression introduced by the previous repair.

Give the label and the error separate live regions and keep the button between
them in DOM order, so both texts stay announced, the button stays outside every
region, and the original inline placement returns.

The new browser test asserts the real geometry - Retry overlaps the label's
vertical range and the error starts below both. On the previous commit it fails
with "expected 64.390625 to be less than 64.390625".
@Pick-cat

Copy link
Copy Markdown
Contributor Author

Thanks for the independent built-Gateway verification — that is a much stronger check than what I could produce locally, and it confirms the two review corrections land on the real accessibility tree rather than just in my test harness.

On the Retry placement: not intentional. It was a regression I introduced, and it is now fixed on head 050c1fe71c7.

What happened: to keep Retry out of the live region I wrapped the label and the error in a single text region and put the button after it. That moved the button past the error in DOM order, so it rendered underneath instead of beside the label. Main has always had label → Retry → error, with the label and button sharing a line.

The repair gives the label and the error their own live regions and keeps the button between them in DOM order:

<span role="status" aria-live="polite">{label()}</span>
<Show when={failed && retry}><button …>Retry</button></Show>
<Show when={sendError}>{(error) => <div role="status" aria-live="polite">{error()}</div>}</Show>

That keeps both delivery texts announced, keeps the button outside every region, and restores the original inline placement. Two regions instead of one is the cost of preserving DOM order — the button has to sit between them.

I added a geometry assertion rather than trusting the markup: in real Chromium the Retry rect must overlap the label's vertical range and the error must start below both. On the previous commit it fails with expected 64.390625 to be less than 64.390625 (button top equals label bottom — i.e. it had dropped to the next line), and passes here.

Focused checks on this head: 2 jsdom + 3 real-Chromium component tests pass.

You are right that none of this is an NVDA/orca speech recording. The most I can establish from here is what the accessibility tree contains at each step and what the layout measures; I cannot produce audible output. If the reported interruption needs to be reproduced audibly before this can land, that is a gap on my side and I would rather you say so than have me overstate the proof.

@obviyus

obviyus commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Inline Retry repair verified on 050c1fe71c7923461977f2153829b86c26bed5f4

Rebuilt the runtime and Control UI from this exact contributor head in secretless Node 24.22.1 Docker, served by an isolated real Gateway. Replayed the real Chromium question/outbox failure flow twice, retaining the earlier two main runs for comparison. No push or source changes from me.

Both runs produce identical bounding rectangles (CSS px):

Delivery label: left=553 right=639      top=167.1875 bottom=182.1875
Retry button:   left=639 right=735.5625 top=160.1875 bottom=190.984375
Error text:     left=553 right=851      top=190.984375 bottom=207.78125
Question row gap: 3px

The button begins exactly at the label's right edge and overlaps its vertical interval: Retry is back inline beside the label, with the error below, matching the earlier main capture. CDP accessibility trees confirm in both runs that Answer not sent and Synthetic delivery failure have polite-live ancestors, while Retry and Answer have none. Keyboard Enter activates Answer to reopen the dock and Retry to resend the original message/reply target; both retries preserve the payload. Main's question gap was also 3px, but its controls remained inside the polite region.

Fresh screenshot below was inspected and cropped to synthetic card content. This is built-product layout and accessibility-tree evidence, not a recorded screen-reader speech claim. Thanks @Pick-cat for restoring the original placement.

050c1fe: Retry restored inline beside delivery label, with error below and 3px question gap

@obviyus

obviyus commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@obviyus
obviyus merged commit c5be644 into openclaw:main Oct 27, 2026
121 of 122 checks passed
@obviyus

obviyus commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Landed in c5be644. Thanks @Pick-cat. Async question buttons are no longer re-announced with the delivery status.

@obviyus

obviyus commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Merged as c5be644. Thanks @Pick-cat for fixing the live-region boundary and following through on inline Retry placement.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…#185565)

fix(ui): keep async question action buttons out of the live region

In the async question card, the Retry and Answer buttons sat inside a polite live region, so screen readers re-announced them along with the delivery status. The delivery label and the error each now have their own live region, and the buttons sit outside both, with Retry still inline beside the label and the 3 px question-row gap restored.

Evidence: compiled Control UI served by a built Gateway, in Chromium. On main the buttons had a polite live-region ancestor; with this change, in the CDP accessibility tree, the label and error each have a polite live ancestor and Retry and Answer do not (twice). Bounding boxes show Retry inline with the label (both at 639 px) and the error below, matching main's layout, and keyboard Retry resends the same message. Screen-reader speech was not recorded. Screenshots: openclaw#185565 (comment).

Thanks @Pick-cat.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Async question cards keep Retry and Answer inside a polite live region

2 participants