Skip to content

fix(studio): a refusal in a Studio strip is announced to screen readers - #29224

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-bjrk0p
Nov 2, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-bjrk0p

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #29139

Clause-②: no
Metadata-protocol: none

The two lines are copied from the claim (comment 6572863221).

维护者速读

  • 改了什么:Studio 所有支柱共用的拒绝条(StudioRefusalStrip)里,那句拒绝说明现在是 role="alert",读屏软件会在它出现时立即朗读,朗读内容就是服务器原话;"Show me" 按钮和 Details 展开区留在 alert 之外。视觉上没有任何变化。
  • 为什么改:Setup 的 Packaged automation 页退役、开关搬进 Studio 后,开关被拒(409/403)只显示在这条没有 role、没有 live region 的拒绝条里,使用读屏的管理员拨开关时什么也听不到,开关只是不动。退役前的 Setup 页用一个带 role="alert" 的段落播报同一句话(18.3.0 RC 清单项 automation.setup-packaged-automation-board 的 acceptance[5])。
  • 风险与回滚:只加一个 ARIA 属性,影响所有用这条拒绝条的地方(Interfaces、Data、Automations、发布清单的行);不改文案、不改布局、不改数据。回滚即撤销本 PR。
  • 先看:StudioDesignSurface.tsx 中 StudioRefusalStrip 的 studio-refusal-message 那一行;新测试 StudioDesignSurface.refusalAnnounced-29139.test.tsx;AutomationsPillar.ledgerSwitch-28148.test.tsx 新增的 409 用例。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.refusalAnnounced-29139.test.tsx packages/app-shell/src/views/studio-design/AutomationsPillar.ledgerSwitch-28148.test.tsx,预期 12 个用例全部通过。
  • 需要你做的:无,席位落地。

What changes

  • StudioRefusalStrip (ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx, the strip block only): the sentence element, data-testid="studio-refusal-message", carries role="alert". Nothing else in the strip moves: no new string, no new prop, no layout change.
  • Every pillar that draws the strip gets it from the one component: the Interfaces leaf and nav strips, the Data object strip, the Automations flow strip (where the ledger switch's 409 and 403 land), and the publish sheet's per-row refusal.

Why this role, on this element

  • role="alert", not a polite region. The strip is mounted with its sentence already in it (every call site renders it only when there is a refusal). An alert is announced when it is inserted; a polite live region inserted already filled is not reliably announced, because a live region must exist before its content changes. And what it shows is a refusal that stopped what the author just did, which is what an assertive alert is for.
  • On the sentence, not on the strip. The retired Setup › Packaged automation page rendered the refusal as a paragraph with role="alert" holding the server's sentence verbatim, beside the switch, and the checklist item automation.setup-packaged-automation-board acceptance[5] scores exactly that: the alert's text equals the server sentence. With the role on the whole strip, the alert would also read "Show me" and "Details", and opening the Details disclosure would change the alert's content and announce it again. On the sentence alone, the announcement is the sentence, and the strip's two controls stay ordinary, reachable controls after it.
  • A second refusal of the same flip is announced again: the Automations pillar clears its error before each toggle request, so the strip leaves while the request is in flight and the alert that comes back is a new element.

Tests

  • New StudioDesignSurface.refusalAnnounced-29139.test.tsx (the strip itself, so every pillar is covered):
    • a one-line and a multi-line refusal are each exactly one alert, inside the strip, whose text is the sentence verbatim;
    • with a target, an input and a detail, "Show me" and the Details disclosure are outside the alert, before and after Details opens, and "Show me" still calls onShow with the target and input.
  • AutomationsPillar.ledgerSwitch-28148.test.tsx, one new case on the card's reproduction (the ledger switch, the subflow guard's 409 DELETE_RESTRICTED naming the caller): no alert before the flip; after it, one alert inside studio-refusal whose text is the 409 sentence verbatim; flipped again with the same refusal, no alert while the request is in flight (the toggle door is held on a gate), then a new alert element with the same sentence; the switch still reads the ledger.
  • Ablation, one leg: role="alert" dropped from the sentence through scripts/ablation-replace.mjs (anchor 1 to 0, blob changed, restore proven equal to HEAD with an empty git diff HEAD): 4 of the 12 cases in the two files went red (the three strip pins and the 409 case), the 8 others stayed green.
  • Neighbours: the 24 test files that render or query the strip, or query an alert in Studio, 125/125 green.
  • Live in a real browser, before and after: see Verification.

Acceptance notes

  • aria-describedby from the switch to the sentence: not added; not a local change. The ledger switch (FlowLedgerSwitch) takes its description ids from its own hint, the not-running reason and the walled reason. The strip is drawn in the pillar body from the pillar's shared error state, which load, save, delete and toggle failures all set, and it has no id. Pointing the switch at the sentence needs an id on the strip, a new prop on FlowLedgerSwitch, and the pillar telling a toggle refusal apart from its other failures: three places outside the strip block. Measured live, the switch's aria-describedby names one id (its hint) before and after the refusal, on both legs. With the alert, the sentence is announced when it lands; the link would let a reader hear it again from the switch. Reported to the seat as a finding.
  • Focus leaves the ledger switch on every flip (pre-existing, measured on both legs). With the switch focused, Space flips it; while the request is in flight the switch is disabled (busy), and after the answer document.activeElement read body, on origin/main's strip and on this branch alike. Most likely the disabled state drops the focus, and nothing puts it back. A keyboard or screen-reader author has to find the switch again after each flip. It is in FlowLedgerSwitch.tsx, outside this card's file surface; reported to the seat as a finding.

Verification

  • Live, the card's reproduction (head 3d6fa84): a fresh showcase (objectstack dev --seed-admin --fresh on a private port) with the Console served from source by Vite, signed in as the seeded admin, Studio › Automations › showcase_notify_owner (a read-only package, so the ledger switch), flipped with Space from the keyboard, twice. The real door answered both flips 409 DELETE_RESTRICTED, naming the caller showcase_task_done_notify_owner.
    • This branch: before the flip, no alert on the page. After it, one role="alert" inside studio-refusal, its text the response's error.message byte for byte, and Playwright's aria snapshot of the strip reads - alert: "Flow 'showcase_notify_owner' cannot be disabled while 1 packaged flow still calls it as a subflow: ...". A DOM observer counted two alert insertions over the two refusals, each with the sentence.
    • origin/main's strip (its file swapped in under Vite, then restored, blob and empty git diff HEAD proven): the same sentence is a - paragraph, no alert on the page, no insertion over two refusals.
    • The strip's screenshot is byte-identical on the two legs (same md5): nothing visual moved.
  • Gates: node scripts/pm/dispatch-gates.mjs --commands derived 34 commands for this diff; all 34 ran at 5c8cc56 (the fix commit; the two later commits merge main and leave the delta to main at these four files), each exit 0, including node scripts/check-sdui-manifest.mjs and pnpm --dir ui exec vitest run scripts/ (169 files, 4900 tests). --ran reconciliation: 34 derived, 34 run, 0 NOT-MEASURED.
  • Tests: the two touched files 12/12 and the 24 neighbour files 125/125 at 5c8cc56 and again at 3d6fa84. The second merge of main (0dffec2) brings four commits, none under ui/packages/app-shell; CI's Test UI runs the head.
  • Type-check: turbo run type-check --filter=@object-ui/app-shell (both tsc --noEmit and tsc -p tsconfig.test.json) green at 5c8cc56 and at 3d6fa84.
  • Lint: eslint on the three touched ui files, 0 errors; its 43 warnings are all on existing lines of StudioDesignSurface.tsx, none in the strip block or the tests. The repo-wide run is CI's Lint UI.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (Measured on the touched files only; see Verification.)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jReFyNpMGkARoUHPD3


Generated by Claude Code

The shared StudioRefusalStrip had no role and no live region, so a refusal
it showed (a refused flow switch, save, load or publish) was silent to a
screen reader. Its sentence is now a role="alert" holding the sentence
verbatim; "Show me" and Details stay outside it.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jReFyNpMGkARoUHPD3
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m

席位核对 · ACCEPT · 2026-11-02T10:03Z

Head-sha: 0dffec2aafdcee3d5a8d0a4bde15f0a3f9c16382

  • Shape: draft → main, Fixes #29139 in the body only. 4 files, +136 / −2 (138 lines ≤ 3000). No governed path: check-governed-merges --pr 29224 reports NOT governed. Clause-②: no and Metadata-protocol: none are line-initial in the body and the changeset, as claimed (6572863221). The changeset is patch for @object-ui/app-shell.
  • Contract review: none owed (Clause-②: no; no prop, type, string or key added).
  • File surface: inside the claim: StudioDesignSurface.tsx (one attribute plus its doc comment), a new strip test, one added case in the Studio: switch a read-only package's flow off for this deployment from the Automations pillar — ledger switch on the item, posture-aware, refusal verbatim #28148 ledger-switch test, and the changeset.
  • Read in the diff: StudioRefusalStrip's sentence <p data-testid="studio-refusal-message"> gains role="alert"; nothing else moves. "Show me" and Details stay outside the alert, so the announcement is the sentence verbatim, and opening Details does not re-announce it. Every pillar draws this one strip, so every Studio refusal is now announced.
  • Tests (dev): new StudioDesignSurface.refusalAnnounced-29139 pins one alert per strip with the sentence verbatim, one-line and multi-line, and Show me / Details outside it; the ledger-switch case pins the 409 sentence as one alert and a new alert element on a second refusal of the same flip. 12 of 12 touched, 24 neighbour files 125 of 125. Ablation (drop the role) reds 4 of 12, restored. Type-check green; derived gates 34 of 34.
  • Measured (dev): on a fresh showcase, a real 409 DELETE_RESTRICTED from the flow switch is one alert holding error.message verbatim (on origin/main: a paragraph, 0 alerts); strip pixels identical.
  • Gates (check-runs on this head): 44 success, 11 skipped, 0 failed or pending. mergeable_state is clean.
  • Findings: focus dropping to the body after a ledger-switch flip (pre-existing, both legs) is filed as Studio Automations: keyboard focus drops to the page after toggling the flow ledger switch #29228. The switch→sentence aria-describedby link is not local (strip id, a FlowLedgerSwitch prop and a pillar discriminator); recorded in the PR's acceptance notes, no card.
  • Serial: seat 2's Studio: a draft autosave names nothing — only the top bar's "Saved HH:MM" shows, which the write-feedback convention does not count (ruling on #28345) #28984 (same file, draft-autosave path) opens its PR after this one lands.
  • Landing: ordinary queue landing, pr_ready then automerge_enable. Fixes #29139 closes the card on merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant