This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 93a689d
fix(components): the ui:select label names its combobox through htmlFor and the trigger id (objectui#10435) (#10548)
Fixes #10435
Clause-②: no
## What changed
`ui:select` (`packages/components/src/renderers/form/select.tsx`) now
writes `htmlFor={schema.id}` on its `Label` and `id={schema.id}` on the
Radix `SelectTrigger`. This is the
`record-picker-label-association-5771` shape the triage ruled. Before,
neither end carried the wiring. The trigger is a `button` with
`role="combobox"`, a role that takes no name from its content, so a
labelled select's combobox had an empty accessible name.
- A labelled select authored with an `id` is found by
`getByRole('combobox', { name: 'Title' })`.
- A required one's name stays `Title`: the objectui#10368 marker span is
`aria-hidden`.
- A select authored without an `id` mints none. Its caption stays
unassociated, as on the sibling `input` / `textarea` renderers and
`element:record_picker`. This half is pinned as deliberate. See
Acceptance notes for the dispatch hypothesis it contradicts.
## Files (vs base `111fa4c`)
| File | + / - |
|---|---|
| `packages/components/src/renderers/form/select.tsx` | +13 / -2 |
|
`packages/components/src/renderers/form/__tests__/select-label-association.test.tsx`
(new, 7 cases) | +128 / -0 |
| `packages/components/src/__tests__/required-marker-markup.test.tsx` |
+3 / -5 |
| `.changeset/10435-select-label-association.md`
(`@object-ui/components` patch) | +20 / -0 |
`required-marker-markup.test.tsx` is outside the claim's declared file
surface. Its select site carried the comment "This label carries no
`for` today", which this change made false. The comment is rewritten,
and the locator becomes `label[for="sel-ctl"]`, the same form as the
other five sites.
## Verification, on final head `4e99a54` (merge of `origin/main`
`d461b0d`)
- `pnpm exec vitest run packages/components/src/renderers/form/
packages/components/src/__tests__/required-marker-markup.test.tsx
packages/components/src/__tests__/form-renderers.test.tsx` gave exit 0,
with `Test Files 67 passed (67)` and `Tests 494 passed | 10 skipped
(504)`.
- `pnpm turbo run type-check --filter @object-ui/components
--concurrency=2` gave exit 0 with `Tasks: 9 successful, 9 total`. It ran
on `a75bf59`. The merge after that only touched `packages/app-shell`,
`packages/plugin-dashboard`, `content/docs` and two changesets, all
outside `@object-ui/components` and its `@object-ui/*` dependencies.
`tsc -p tsconfig.test.json --listFilesOnly` lists both touched test
files.
- eslint on the 3 changed source and test files gave exit 0 with 0
errors and 4 warnings. All 4 warnings are pre-existing on the unchanged
signature line, and the BASE `select.tsx` also shows 4.
- These gates each gave exit 0: `check:control-bytes`,
`check:test-path-roots`, `check:vi-mock-specifiers`,
`check:vi-mock-inherit`, `check:vi-mock-override-shape`,
`check:new-line-citations` (0 new), `check:changeset-claims`,
`check:pending-changeset-literals`, `check-changeset-presence`,
`check-changeset-no-major`, `check-changeset-overwrite`,
`check-changeset-fixed`, `check-lint-coverage`.
- NOT MEASURED: `check:sdui-registration-pins` exits 2 with a
prerequisite refusal, because it needs a console build. This diff does
not change the registration block. That gate is declared to CI.
## Reverse verification (ablation)
The fix was committed first as `a75bf59`. The script then overwrote
`select.tsx` with the BASE blob `4296933c`: `htmlFor={schema.id}` count
went 1 to 0 on disk and `SelectTrigger id={schema.id}` count went 1 to
0. It ran the pin and `required-marker-markup.test.tsx`, then restored
with `git checkout HEAD --` under an `EXIT INT TERM` trap.
- Mutated run: exit 1, `Tests 8 failed | 14 passed (22)`.
- 6 of the 7 new cases failed, starting with `Unable to find an
accessible element with the role "combobox" and name "Title"`.
- The no-`id` case stayed green, as expected.
- Both select-site cases of `required-marker-markup` failed, because of
the tightened `label[for]` locator.
- Restore: file hash `8fc729cb` equals the HEAD blob, and `git diff
HEAD` is empty.
## Acceptance notes
- The dispatch's hypothesis H2 conflicts with the ruled shape. H2 said a
select with no `schema.id` still needs a minted id, for example from
`useId`. The ruled 5771 shape explicitly declines a `useId()` fallback,
and its own test pins the no-`id` case as unassociated. The ruling was
followed. The alternative is raised to the dispatching seat as an open
question, not decided here.
- Related to that question: the docs catalog examples
`components-form-select/basic-select` and
`components-form-input/with-label` author a `label` with no `id`. They
render an unnamed control under the ruled shape. This is noted, not
filed.
Implementation session:
`https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy` (dispatched by
the `domain:ui` seat 5).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 4a7ef0d commit 93a689d
4 files changed
Lines changed: 164 additions & 7 deletions
File tree
- .changeset
- packages/components/src
- __tests__
- renderers/form
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
50 | 61 | | |
51 | | - | |
| 62 | + | |
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
| |||
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
75 | | - | |
| 86 | + | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
| |||
0 commit comments