Repository navigation
fix(dashboard): tell assistive technology whether a question takes one answer or several - #24865
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing on screen changes: the PR adds only a hidden sentence and ARIA attributes, and the plain [DESIGN-REVIEWED] 94f5dea Description read[DESCRIPTION-READ] ffa52f3b95a3eeb8cf07c511d175ae325a6204ad1ccc6f62ebacae4660c7deb5 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (4 items) — 4 justifiedIntent: A screen-reader user can tell whether a question card takes one answer or several. This is a FIX (#15571).
[FIRST-PRINCIPLES-REVIEWED] 94f5dea Description read[DESCRIPTION-READ] f084237c11b1080181c57acaa970a0ac6c44dc15cff62693c414017334a04c64 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing visible changes: the diff adds only an Notes
[UX-REVIEWED] 94f5dea Description read[DESCRIPTION-READ] f9f50cf7439764f99ae24a579387f379315eff81e294eae132a68fd6585fcb27 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
…e answer or several
043eecc to
94f5dea
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (15 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: names the question card's option group and describes its one-or-many selection rule for assistive technology; locale strings and tests.
Problem / Motivation
Goal: A screen-reader user can tell whether an
ask_questioncard takes one answer or several.QuestionCardrenders both selection modes as the same set of toggle buttons.aria-pressedgives each option's state. But nothing on the options or the question carriesmultiSelect: the multi-select checkbox isaria-hidden, and the options sit in a plaindiv. So assistive technology can read whether an option is selected, but not the rule for choosing.Why it matters
A user who cannot see the checkbox has to guess. They may press a second option on a multi-select card and not know the first one stayed on. Or they may never try a second option because nothing says they can.
Not a goal
role="radiogroup"/role="radio"would misdescribe it, as the component's own comment says.Intended? / Repro
Intended? No. #9507 added
aria-pressedand explicitly left group semantics out of scope; nothing in the component or its tests says the selection rule should be hidden. The option comment atwebsite/src/components/QuestionCard.tsx(thearia-pressedblock) explains why it is not a radio, not why the rule goes unannounced.Repro (code read on current main): in
QuestionCard.tsx, the options render inside<div className="pt-2.5 flex flex-col gap-1.5">, with norole,aria-labelledbyoraria-describedby. The question text is a bare<span>with no id. The onlymultiSelectcue is the checkboxspan, which isaria-hidden="true". Render a card withmultiSelect: falseand another withmultiSelect: true. In the accessibility tree both show the same list of toggle buttons witharia-pressed, and neither exposes its one-choice or many-choice rule.What changed (motivation → approach → change)
Symptom: the selection rule is visual only. Cause: no element in the accessibility tree carries
multiSelect. Change: the options' container becomes a named, described group.website/src/components/QuestionCard.tsx:role="group",aria-labelledbythe question text andaria-describedbya visually hidden rule sentence (sr-only).multiSelect: "Choose one option. Choose it again to clear it." or "Choose one or more options." The first one also says a second press clears the pick, which is the behavior a radio group would hide.useId().components.questionCard.select_one_ruleandselect_many_rule, inen.manual.json(beside the other hand-authoredquestionCardstrings) and in all eleven translations.en-XA.jsonwas regenerated withscripts/gen-pseudolocale.mjs.Backwards compatibility
Compatible: the buttons, their
aria-pressed, their names and their behavior are unchanged. The change only adds a group role, a name and a description around them.Removes nothing: no element, attribute, key or behavior is removed.
Tests
website/src/test/QuestionCard.test.tsx:names the single-select options group by its question and describes its one-choice rule:getByRole('group', { name: <question> })has the description "Choose one option. Choose it again to clear it." and contains the options.describes the multi-select options group with its many-choice rule: the description is "Choose one or more options."Both fail on main, where no element has
role="group".Proof: not provable -- frontend test
Manual verification
No screen reader was run. Static gates run locally:
eslintandtsc --noEmiton the website, andscripts/i18n-check.mjs(all diff-scoped checks pass). The tests run in CI.Screenshots / video
Why no screenshot: the only added element is an
sr-onlysentence plus ARIA attributes on an existing container, so nothing on screen changes.Related Issues
Fixes #15571
Sibling sweep
Swept: git grep -ln "multiSelect" -- website/src/components
Siblings: none -- QuestionCard is the only component that renders ask_question options; PendingQuestionCard renders QuestionCard itself
Pattern harvest
Not generalizable: one component whose selection mode was shown only by an aria-hidden checkbox.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.