Skip to content

feat: add CustomDropdown UX pattern component - #815

Open
an0ushkah wants to merge 5 commits into
mainfrom
feat/add-custom-dropdown
Open

feat: add CustomDropdown UX pattern component#815
an0ushkah wants to merge 5 commits into
mainfrom
feat/add-custom-dropdown

Conversation

@an0ushkah

Copy link
Copy Markdown
Contributor

Summary

  • Adds CustomDropdown, a new UX pattern component combining Aquarium's Dropdown, Checkbox, Button, and Divider
  • Two menu variations: checkbox list only (showFooter: false) and checkbox list with Cancel/Show results footer buttons (showFooter: true)
  • Trigger button uses the same dropdownOpen icon as the Select component; icon color inherits from the button so it renders correctly in the disabled state
  • Exported from src/components/index.ts as CustomDropdown, ICustomDropdownProps, and ICustomDropdownOption
  • Storybook stories added under UX Patterns/CustomDropdown with interaction play tests for Default and WithFooter

Testing Plan

  • Was this tested locally? If not, explain why.
  • Verified in Storybook locally — Default, WithFooter, and Disabled stories all render correctly
  • npm run build passes cleanly
  • Interaction play tests cover: opening the dropdown, selecting an option, and clicking Show results to close

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cursor

cursor Bot commented Jun 17, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Additive UI library component and Storybook stories with no changes to auth, data, or existing consumer behavior until adopted.

Overview
Introduces CustomDropdown, a reusable UX pattern for multi-select filtering via a click-triggered menu of checkboxes, aligned with existing patterns like MoreActionsButton and DimensionPicker.

Selection can work in two modes: immediate updates through onChange when showFooter is false, or draft-then-apply when showFooter is true—checkboxes edit local draft state until Cancel (closes without committing) or Show results (commits draft, calls onChange/onApply, and closes). The trigger reuses the same dropdownOpen icon as Select, with color="inherit" so the chevron matches the button in disabled states.

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.

Comment thread src/components/UXPatterns/CustomDropdown/CustomDropdown.tsx
Comment thread src/components/UXPatterns/CustomDropdown/CustomDropdown.tsx
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
PR Preview Action v1.6.3

🚀 View preview at
https://mParticle.github.io/aquarium/pr-preview/pr-815/

Built to branch gh-pages at 2026-06-25 20:06 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread src/components/UXPatterns/CustomDropdown/CustomDropdown.tsx
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

@AustinFash AustinFash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…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
Comment thread src/components/UXPatterns/CustomDropdown/CustomDropdown.tsx
Comment thread src/components/UXPatterns/CustomDropdown/CustomDropdown.tsx
… 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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 46865f1. Configure here.


const handleOpenChange = (nextOpen: boolean) => {
if (nextOpen) {
committedValue.current = value

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 46865f1. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants