Repository navigation
fix(app-shell): Installed Apps module toggle names its module rows in aria-controls - #34941
Conversation
… aria-controls Each folded module line gets its own DOM id; the app's toggle lists those ids in aria-controls while the modules are shown and omits the attribute while they are collapsed. Pinned with an axe aria-valid-attr-value read. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz
… fix Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB L1 review · 2026-11-17T17:13ZL1: ACCEPT This PR is the follow-up to should-fix 1 of L1 6947097720 on #34815 (card #34722, Checklist
Must-fixNone. Should-fixNone. Notes
CI at review timeThere are 49 check-runs on this sha: 13 success, 13 skipped, 23 in progress, 0 failed. Test UI 11–16 had not registered yet. Landing needs every run on the landing head green. RoutingL1 ACCEPT. No L2 is owed (Clause-② no) and the PR is not governed. The area lands it once CI is fully green. |
|
repo:objectstack#3 · os-support-ai · session_01WGufziunkXbDT7wUWqfmWz Landing · area o3-C · head 56ef17e
This is the follow-up to should-fix 1 of L1 6947097720 on #34815 (card #34722, already closed): the module toggle's |
Requested by Yibo Wang · project thread
Refs #34722 (follow-up to #34815; L1 6947097720 should-fix 1; seat-3 follow-up record 6953744953)
Clause-②: no
Metadata-protocol: none
维护者速读
aria-controls现在指向真实存在的模块行:每个模块行有自己的 id,展开时按钮列出这些 id,收起时不带aria-controls(此时模块行不渲染)。aria-expanded不变。aria-controls指向一个不存在的元素,读屏软件无从定位,axe 的aria-valid-attr-value规则会报错。ui/packages/app-shell/src/views/metadata-admin/PackagesPage.tsx的moduleRowDomId与按钮上的aria-controls;测试文件新增的 aria-controls 用例。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/PackagesPage.installedAppsUpdates-34722.test.tsx,预期 17/17 通过。What changes
L1 6947097720 on #34815 found that the module toggle in Setup › Installed Apps carried
aria-controlsset topkg-modules-plus the app's row id, and that no element had that id: the module lines were bare table rows. The seat ruled for ids over dropping the attribute.React.useId()prefix, thenpkg-module-, then the module's row id passed throughencodeURIComponent. The prefix keeps the id unique if the page is ever mounted twice; the encoding keeps it free of whitespace, so it is one token of an IDREF list (row ids with dots, such asapp.objectstack.hotcrm.o2c, pass through unchanged). A module folds under exactly one app (appOfModule), so no id repeats across groups.aria-controlsis the space-separated list of its module rows' ids while they are shown (by click, or opened by a search hit), and is omitted while collapsed, when those rows are not rendered.aria-expandedis unchanged.aria-expanded="false",aria-controlsnames a missing idaria-expanded="false", noaria-controlsaria-expanded="true",aria-controlsnames a missing id (axearia-valid-attr-valueviolation)aria-expanded="true",aria-controlslists the ids of the drawn module rows; axe finds no violationChangeset:
@object-ui/app-shellpatch. The package is private, but its code ships inside the built Console that@objectstack/consolepublishes, and.changeset/config.jsonversions private packages (privatePackages.version: true); #34815 shipped its app-shell change the same way. So a changeset is owed andskip-changesetis not applied.Tests
One new case in the existing harness file
PackagesPage.installedAppsUpdates-34722.test.tsx, inside the foldingdescribe:aria-controls;aria-controlsresolves throughdocument.getElementByIdto a drawn module row of HotCRM, one per module (all four), each withdata-module-ofset to the app;ConsoleLayout.oneMainLandmark-13334.test.tsxalready uses in app-shell), rulearia-valid-attr-valueonly, on the expanded table: zero violations, with a control that the rule judged a node carryingaria-controls;aria-controls.Ablation (one-shot, not kept): deleting the row
idattribute viascripts/ablation-replace.mjs(anchor 1 to 0, blob 049bd99f62bb to d334c876df6c) turned the new case red (expected [ undefined, undefined, …(2) ] to deeply equal [ …(4) ]; 1 failed, 16 passed). Restored: blob equals HEAD (049bd99f62bb),git diff HEADempty.Verification
Commands and exit codes (code at c0eb8ea, changeset at 56ef17e)
turbo run build --filter='@object-ui/app-shell^...' --concurrency=2underos-verify-lock.sh: VERDICT command-exit 0 (68/68 tasks).PackagesPage.installedAppsUpdates-34722,PackagesPage.installedApps-13356,PackagesPage.source-12675: VERDICT command-exit 0, Test Files 3 passed (3), Tests 50 passed (50).pnpm --filter @object-ui/app-shell type-check(bothtsc --noEmitandtsconfig.test.json, which includessrc/**/*.test.tsx) under the lock: VERDICT command-exit 0.node scripts/pm/dispatch-gates.mjs --commands: 39 derived families, each run with its exit code recorded;--ran: 39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN, exit 0. Every one exited 0, includingpnpm --dir ui exec vitest run scripts/(171 files passed, 2 skipped; 5077 tests passed).check:query-options-erasureandcheck:type-check-debthit my 280 s per-command timeout on the shared box the first time and exited 0 on a rerun. The code-reading families ran at c0eb8ea; the changeset families (the 11 the changeset added) ran at 56ef17e, whose only delta is the changeset file.node scripts/pm/overlap-check.mjs --branch=claude/issue-34722-aria-controls-followup: VERDICT clean exit 0 at 56ef17e against origin/main d576509.Generated by Claude Code