Repository navigation
fix(app-shell): page block inspector list labels name their group - #27307
Merged
Merged
Conversation
The Columns (field list), string-list and array editors drew a label over a list of rows with no association, so the rows had no group name. Each container now takes role="group" and aria-labelledby the label's id, minted per instance by a small LabelledListGroup component (renderField runs in a loop and cannot call a hook). Text row inputs that carried only a repeated placeholder are named from the label plus their position. Claude-Session: https://claude.ai/code/session_01JQwxbZEzQNxEeTKF7YTgo6 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · seat 席位意见:Studio 页面块检查器里有三个列表编辑器(列、字符串列表、数组),它们的标题标签原先不指向任何控件,屏幕阅读器读不出这组行属于哪个属性。现在每个列表都包在
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Warren · project thread
Fixes #27256
Clause-②: no
Metadata-protocol: none
维护者速读
PageBlockInspector.tsx里新增的LabelledListGroup及三处调用;新测试PageBlockInspector.listGroupLabels-27256.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/PageBlockInspector.listGroupLabels-27256.test.tsx,预期 4 passed。What changes
ui/packages/app-shell/src/views/metadata-admin/inspectors/PageBlockInspector.tsx, the three list editors only:LabelledListGroupcomponent: the container takesrole="group"andaria-labelledbypointing at the label'sid, minted withReact.useId()per instance. It is a component (not inline inrenderField) becauserenderFieldis a function run in a loop over array items and cannot call a hook, and a caller-derived id would repeat across array rows. This is the same patternColorPropFieldalready uses in this file.FieldListField(Columns, Fields, Card fields …), thestring-listcase and thearraycase ofrenderFieldall render through it.aria-label= the list label plus its 1-based position ("Action names 1"). Chosen overaria-labelledbyplus an index element because no visible per-row index exists to point at. The field-list text fallback rows (shown when the object has no fields) had the same gap and get the same name. The field-listSelecttrigger rows are left alone: their name is the selected value's text, and anaria-labelwould hide it.app-shellisprivate: true, so no changeset (skip-changeset).Why
Each of the three labels headed a list of rows and named nothing:
getByLabelText('Columns')found the label and no control, and a screen reader heard the rows with no group name. Aforpairing does not fit, since one label heads several controls.Tests
PageBlockInspector.listGroupLabels-27256.test.tsx(4 cases):record:related_list:getByRole('group', { name: 'Columns' })(field list) and{ name: 'Sort' }(array) each resolve; the row controls (combobox,#1, the remove buttons) sit inside their group; the IDREF resolves to the label element inside the group; the two ids differ.record:quick_actions: theAction namesgroup holds textboxes namedAction names 1andAction names 2.Columnsgroup holds a textbox namedColumns 1.record:detailswith two sections: twoFieldsgroups inside theSectionsgroup, each named by its own label with distinct ids.Acceptance notes
scripts/ablation-replace.mjsswapped the group'saria-labelledby={labelId}for an inert attribute → 4 of 4 cases red (Unable to find an accessible element with the role "group" and name …); restore verified blob equal to HEAD andgit diff HEADempty. A first attempt was refused by the tool before running anything (the replacement text already occurred in the file), so it measured nothing.Verification
All on head
3402dbdd(base5b5cff15), each exit captured before any pipe.pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' buildunder the lock: exit 0.pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/PageBlockInspector.listGroupLabels-27256.test.tsx: 4 passed, exit 0.PageBlockInspector*.test.tsxfiles: 14 files, 90 tests passed, exit 0.pnpm --filter @object-ui/app-shell run type-check(source andtsconfig.test.json): exit 0.pnpm --dir ui run check:new-line-citations: 0 new citations, exit 0.node scripts/pm/dispatch-gates.mjs --commandsderived 24 commands;--ranreconciles 24 run, 0 NOT-MEASURED.Derived gates (24)
pnpm --dir ui exec vitest run scripts/first exited 1 on an unlocked run beside the app-shell type-check: two tree-sweep tests (check-i18n-dead-keys,check-vi-mock-inherit) hit the 15 s test timeout. Rerun alone under the lock: 2 files, 229 tests passed; then the whole suite under the lock: 174 files passed, 2 skipped, exit 0. The recorded exit is that rerun.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (CI runs the repo lint)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code