- Notifications
You must be signed in to change notification settings - Fork746
Add DatasetCombobox and DatasetSelect#5208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:simeonlee/function-selector-combobox
Are you sure you want to change the base?
Add DatasetCombobox and DatasetSelect#5208
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…onSelector- Create DatasetComboboxSelector for input-style dataset selection- Rename DatasetSelector to DatasetButtonSelector for button-style selection- Add ComboboxContent and ComboboxHint components- Update imports across codebase to use appropriate selector variant- DatasetComboboxSelector used in: LaunchEvaluationModal, playground, NewDatapointForm- DatasetButtonSelector used in: CloneDatapointButton, AddToDatasetButton, evaluation page
- Extract useDatasetSelector hook for shared data fetching and helpers- Extract ComboboxMenuItems for shared menu rendering- Add count pill to DatasetButtonSelector selected state- Update Combobox to use ComboboxMenuItems internally- Update e2e tests for new placeholder text
…elector with variant prop
- Add DatasetCombobox for input-as-trigger pattern- Add DatasetSelect for button-as-trigger pattern- Add shared use-dataset-options hook for data fetching and filtering- Add searchPlaceholder for DatasetSelect CommandInput- Add default styles to CommandEmpty (text-fg-tertiary)- Update test placeholders to match new text
e248cba to17a84abCompare- Simplify DatasetCombobox to use Combobox directly (~146 to ~53 lines)- Rename getItemIcon/getItemSuffix to getPrefix/getSuffix- Fix create icon showing when allowCreation is false- Fix creationHint/createHeading only passed when allowCreation is true- Remove default allowCreation=true from DatasetFormField- Export items from useDatasetOptions hook- Unify suffix styling as styled pill elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In the future, this will also reuse a standard Select
- Extract shared fixtures to dataset-stories-fixtures.ts- Add Disabled story to both components- Add TODO for virtualization on large lists- Rename creationHint to createHint for consistency
Uh oh!
There was an error while loading.Please reload this page.
| }, | ||
| }; | ||
| // TODO: we should handle extremely long lists (1000+) of datasets gracefully (e.g. virtualization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This TODO comment was pre-existing (but noted)
Uh oh!
There was an error while loading.Please reload this page.
Summary
Splits the monolithic
DatasetSelectorinto two specialized components:ComboboxcomponentBoth share data fetching and filtering logic via
useDatasetOptionshook.This addresses consistency issues with the other comboboxes implemented as part of#4804 as well as closes the loop on some dataset selector updates as part of#1236. From conversation with@GabrielBianconi we decided to keep the button-style selector as-is but upgrade the combobox creation flow for a consistent creation pattern with our model selector combobox work from last week.
Test plan
Important
Introduce
DatasetComboboxandDatasetSelectcomponents to replaceDatasetSelector, with shared logic and updated tests and stories.DatasetComboboxfor input-style selection in forms, usingComboboxcomponent.DatasetSelectfor button-style selection for inline actions.useDatasetOptionshook.DatasetSelectorwithDatasetComboboxinNewDatapointForm.tsxandDatasetBuilderForm.tsx.DatasetSelectorwithDatasetSelectinCloneDatapointButton.tsxandAddToDatasetButton.tsx.DatasetCombobox.stories.tsxforDatasetCombobox.DatasetSelector.stories.tsxtoDatasetSelect.stories.tsxand update forDatasetSelect.dataset-stories-fixtures.tsfor mock dataset data.formatCompactNumberinchart.tsfor number formatting.This description was created by
for5595577. You cancustomize this summary. It will automatically update as commits are pushed.