fix(admin): name every accounts-row control after the row it acts on - #62
Conversation
PR #59 put `restName="revoke admin for <identity>"` on REVOKE while resolving a rebase conflict, which was outside its scope. It was the right name — a row-per-account table makes the bare word "revoke" identical on every row, and `ConfirmSubmit`'s docblock already argues the case — but it was reached by noticing one gap next to a labelled neighbour, not by looking at the page. Looking at the page: REVOKE was the most visible gap, not the only one. Every control inside the drawer named its row already — tier, auto, wake, freeze, and the note field — and every control in the row itself did not. `grant`, `sync now` and `save note` were all bare, and nothing about them is less anonymous out of their row than "freeze" was. So REVOKE stays and the other three join it, which is the sweep rather than the accident. Each name leads with the visible label, so speech input still reaches the control by the word written on it (WCAG 2.5.3). One consequence worth stating: "save note for X" contains the note field's own "Note for X" as a substring, and `getByLabel` matches on a substring, so six existing assertions were quietly counting the pair. They are `exact` now. The nesting is fine for a screen reader — the two are a field and a button with different roles, the same way "freeze X" and "confirm freeze X" already coexist — but it is not fine for an assertion that means to be about the field. The test covering this grew from tier-and-cryo to all four swept controls and is renamed to say so. It fails closed: with an aria-label dropped, the exact-name lookup finds the bare visible text instead and the count assertion fails.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe admin accounts page now adds account-specific accessible names to account controls and note-save actions while preserving visible labels. E2E tests use exact note-label matching and verify accessible names for grant, sync, save-note, and revoke controls. ChangesAdmin account accessibility
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Carried out of #59 as item 2:
restName={revoke admin for ${identity}}landed on REVOKE during a rebase conflict resolution, outside that PR's scope. The question was keep it, or revert and land it deliberately alongside an audit of the page. Conclusion: keep it, and finish the sweep it started.The audit
REVOKE was the most visible gap, not the only one. The split ran exactly along the drawer boundary:
Nothing about those three makes them less anonymous out of their row than "freeze" was — on a table with one row per account the visible word names the verb and nothing else, and a speech-input or screen-reader user never sees the pinned Name column that supplies the object. So REVOKE stays and the other three get the same treatment:
grant→grant admin to <identity>sync now→sync now for <identity>save note→save note for <identity>Each leads with its visible label, so speech input still reaches the control by the word written on it (WCAG 2.5.3).
The page's remaining controls — the tier/status filters and the column-sort links — act on the whole list rather than a row, and are already inside labelled
role="group"s. Correctly unswept.One consequence
save note for Xcontains the note field's ownNote for Xas a substring, andgetByLabelmatches on a substring, so six existing assertions were quietly resolving to the field and the button. They'reexactnow, with a comment saying why. The nesting itself is fine for a screen reader — a field and a button, different roles, the same wayfreeze Xandconfirm freeze Xalready coexist — but it's not fine for an assertion that means to be about the field.Test
the tier and cryo controls name the row they act on→every per-account control names the row it acts on, now covering all four swept controls. It fails closed: drop anaria-labeland the exact-name lookup finds the bare visible text instead, so the count assertion fails rather than silently passing.Verification
npm run typecheck— cleannpm test—Test Files 52 passed (52),Tests 430 passed (430)(scoped DB perdocs/ops.md; the shared:5433lock was held)npx playwright test—56 passed (1.3m)npm run lint— 0 errors, 5 pre-existingno-img-elementwarningsnpx prettier --check— cleanSummary by CodeRabbit