feat: add CustomDropdown UX pattern component - #815
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR SummaryLow Risk Overview Selection can work in two modes: immediate updates through The component and its option/props types are exported from the public barrel. Storybook coverage under UX Patterns/CustomDropdown includes Default, WithFooter, and Disabled, with interaction plays for open/select and footer apply. Reviewed by Cursor Bugbot for commit 46865f1. Bugbot is set up for automated code reviews on this repo. Configure here. |
…ections on cancel #agentic
|
Ant Design pre-renders dropdown portal content in the DOM before it is CSS-visible, causing toBeVisible() to fail. Matches the pattern used by other Ant Design component stories in this codebase. #agentic
…w padding - Cancel now discards changes (draft pattern) instead of clearing all selections - Replace Space with Flex align=center for vertically centered dropdown caret - Remove bottom padding from option rows to fix extra spacing #agentic
… apply - Use setDraft(prev => ...) in handleCheck to prevent stale closure on rapid clicks - Store committedValue.current = draft on apply so immediate reopen snapshots correctly #agentic
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 46865f1. Configure here.
| committedValue.current = draft | ||
| onChange?.(draft) | ||
| onApply?.() | ||
| setOpen(false) |
There was a problem hiding this comment.
onApply sees stale value
Medium Severity
Clicking Show results calls onChange with the new draft, then invokes onApply with no arguments in the same turn. Parent handlers that read controlled value state inside onApply still see the previous selection, unlike DimensionPicker, which passes applied keys into onApply.
Reviewed by Cursor Bugbot for commit 46865f1. Configure here.
|
|
||
| const handleOpenChange = (nextOpen: boolean) => { | ||
| if (nextOpen) { | ||
| committedValue.current = value |
There was a problem hiding this comment.
committedValue ref never read
Low Severity
committedValue is written when the menu opens and when Show results is clicked, but its value is never read anywhere in the component, so it adds state with no effect on behavior.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 46865f1. Configure here.


Summary
CustomDropdown, a new UX pattern component combining Aquarium'sDropdown,Checkbox,Button, andDividershowFooter: false) and checkbox list with Cancel/Show results footer buttons (showFooter: true)dropdownOpenicon as theSelectcomponent; icon color inherits from the button so it renders correctly in the disabled statesrc/components/index.tsasCustomDropdown,ICustomDropdownProps, andICustomDropdownOptionDefaultandWithFooterTesting Plan
Default,WithFooter, andDisabledstories all render correctlynpm run buildpasses cleanly