feat(chat): show checkboxes on multi-select question options - #7803
feat(chat): show checkboxes on multi-select question options#78031000i100 wants to merge 3 commits into
Conversation
A multi-select question looked exactly like a single-select one: the same row of options, the same trailing check on whatever was picked last. Nothing on screen said "you may pick several", so users answered in free text instead of selecting. Multi-select options now carry a leading checkbox and keep their number shortcut on screen while the answer is assembled; single-select keeps its trailing check, so the two modes no longer look alike. Both clients render it: web option buttons expose `role="checkbox"` with `aria-checked`, and the mobile pills get the matching `accessibilityRole`/`accessibilityState`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughMulti-select pending-input options now show checked state and checkbox accessibility semantics on web and mobile. Single-select options retain button semantics and their existing selection indicators. Web tests cover both selection modes and keyboard shortcut behavior. ChangesMulti-select checkbox UI
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized UI and accessibility change makes multi-select options visibly distinct while preserving existing selection behavior. No actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2⚔️ Resolve merge conflicts 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Warning |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
One minor consistency note on the new multi-select indicator; the rest of the change (role/aria-checked only in multi-select mode, keeping the number shortcuts, single-select untouched) looks consistent with the panel's existing patterns.
Posted via Macroscope — UI Consistency
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR adds visual checkboxes and accessibility attributes to multi-select question options - a self-contained UI enhancement with no business logic changes. The multiSelect property already exists and is only being read for conditional rendering. Tests are included. You can add or adjust custom eligibility rules. Learn more. |
Hiding the glyph with `text-transparent` breaks down in forced-colors mode: the OS overrides both the text colour and `bg-primary`, so every unchecked box would render a visible check and read as selected. Mounting it conditionally matches the shared checkbox primitive and the mobile pill in this same change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Dismissing prior approval to re-evaluate 2c66fff
|
@coderabbitai review |
✅ Action performedReview finished.
|
What Changed
role="checkbox"witharia-checked; the mobile pills get the matchingaccessibilityRole/accessibilityState.Why
A multi-select question looked exactly like a single-select one — the same row of options, the same trailing check on whatever was picked last. Nothing on screen said "you may pick several", so the affordance had to be discovered by trying.
In practice it was not discovered. Across ~40 questions answered locally, every one of the 7 that carried
multiSelect: truewas answered in free text ("1, 2 and 4") rather than by selecting options, and no answer was ever submitted as an array.A leading box is the conventional signal for "additive choice", and keeping the number shortcuts visible keeps the whole list reachable from the keyboard while several options are being picked. The two modes now differ at a glance rather than after a click.
The empty box borrows the shortcut key's ink (
border-secondary-label/70) rather than the hairline border token:--borderresolves towhite/6%in dark mode, so a box drawn with it faded to roughly 4% white and vanished, while the<kbd>beside it stayed readable on the strength of its digit.This is the interface half of the problem. #6443 is the mechanism half: it fixes multi-select questions auto-advancing after a selection (a stale
useEffectEventread plus an uncancelled single-select timer), which made picking a second option impossible in a[single] [multi] [multi]questionnaire. That PR makes multi-select behave; this one makes it look like what it is. They touch the same file but different parts of it — #6443 the handler and its effects, this one the option markup — and neither needs the other to land first.UI Changes
Each shot stacks a
multiSelect: trueprompt over amultiSelect: falseone, with two options picked in the first and one in the second. Before, the two prompts are indistinguishable.Validation
vp test run --dir apps/web src/components/chat/ComposerPendingUserInputPanel.test.tsx(4 tests, 2 new)vp test run --dir apps/mobile src/lib/threadActivity.test.ts(14 tests)vp run --filter @t3tools/web typecheck,vp run --filter @t3tools/mobile typecheckvp lintandvp fmt --checkon the three touched filesChecklist
Written by Claude Opus 5 (1M context) in T3 Code.
Note
Low Risk
UI and accessibility-only change to option markup; selection behavior is unchanged. Low risk of visual/a11y regressions on pending-input prompts.
Overview
Makes multi-select pending-input options look and announce as additive choices, so they no longer match single-select rows.
On web and mobile,
multiSelectoptions get a leading checkbox and checkbox a11y (role="checkbox"/accessibilityRole). Selected multi-select items keep their number shortcuts instead of swapping them for a trailing check. Single-select is unchanged (trailing check, no box).Web tests cover checkbox markup,
aria-checked, shortcut persistence, and that single-select stays a plain button.Reviewed by Cursor Bugbot for commit 2c66fff. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Show checkboxes on multi-select question options in chat
PendingUserInputCard) and web (ComposerPendingUserInputPanel), tinted via theme colorsaccessibilityRole="checkbox"andaria-checkedon multi-select options; single-select pills keep button semantics and trailing checkmark behavior unchangedaria-checkedstates, numeric shortcuts, and guidance text for both multi-select and single-select modesMacroscope summarized 2c66fff.
Summary by CodeRabbit
New Features
Bug Fixes