-
Notifications
You must be signed in to change notification settings - Fork 447
[feat] Enhance MultiSelect component and Storybook stories #5154
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🎭 Playwright Test Results✅ All tests passed across all browsers! ⏰ Completed at: 08/31/2025, 05:31:13 AM UTC 📊 Test Reports by Browser🎉 Your tests are passing across all browsers! |
🎨 Storybook Build Status❌ Build failed! ⏰ Completed at: 08/31/2025, 05:06:52 AM UTC 🔗 Links |
|
I had to make the following mods to multiselect yesterday : https://github.com/Comfy-Org/ComfyUI_frontend/pull/5142/files#diff-2ad6dfa2673924c2a03f905f5e6142f97eaf34067500f9a37447c6d915b0c961. Pls see if it makes sense to do it here |
🚀 Additional Improvements MadeBeyond the initial review feedback, I've implemented several enhancements to improve the developer experience: Storybook Enhancements
Component Improvements
SingleSelect Updates
These changes make the components more developer-friendly and the Storybook stories more interactive and useful for testing different configurations. |
5d5dac8 to
0920504
Compare
|
I think maybe the most recent commit didn't push. I don't see the changes. |
7b7c992 to
2ef7413
Compare
2ef7413 to
0db1555
Compare
|
I rebased this for you so we can re-run CI with the fixed tests. |
|
@DrJKL Something went wrong. Let me fix it. |
|
@DrJKL What do you mean |
One that has the icon set to visible but without the border. Right now the default and borderless are identical. And it looks like the icon is tied to the border being present. |
|
@DrJKL The version where the icon is visible but the border is removed is actually the default one. I think this might just be an issue with the deployed public Storybook. Anyway, I’ll check into the issue of components breaking when Storybook is deployed. |
b21cee8 to
53ffff1
Compare
| :label="$t('g.clearAll')" | ||
| type="transparent" | ||
| size="fit-content" | ||
| class="text-sm !text-blue-500 !dark-theme:text-blue-600" |
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.
nit: Do these need the important?
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.
| :class=" | ||
| slotProps.selected | ||
| ? 'border-blue-400 bg-blue-400 dark-theme:border-blue-500 dark-theme:bg-blue-500' | ||
| : 'border-neutral-300 dark-theme:border-zinc-600 bg-neutral-100 dark-theme:bg-zinc-700' | ||
| " |
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.
nit: Can these be extracted and use the cn function?
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.
Thanks for the review! I'd prefer to keep the Tailwind classes inline in the template as it follows Tailwind's utility-first philosophy - being able to see the styles directly in the template improves developer experience. Since we don't use a cn utility elsewhere in the codebase, introducing it here would break consistency. The PrimeVue PT configuration is already properly organized in the computed property below, which handles that abstraction well.
src/components/input/MultiSelect.vue
Outdated
| :options="options" | ||
| option-label="name" | ||
| unstyled | ||
| :placeholder="label" | ||
| :max-selected-labels="0" |
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.
Is it necessary to include options, optionLabel, placeholder, and maxSelectedLabels explicitly? They will already be set by the parent. At the very least, we probably don't need to alias them.
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.
I’ve removed the unnecessary parts, and for the props needed due to custom styling I added comments above the component to explain them.
cfd4928 to
07abda2
Compare
📝 Changes Summary1. Improved props handling for MultiSelect/SingleSelect (commit: 50db4b7)
2. Fixed SearchBox v-model bugs (commit: 4ed9222)
3. Renamed ModelSelector → SampleModelSelector (commit: 4ed9222)
Result: Search functionality working properly, all TypeScript checks passing |
- Update MoreButton story with transparent button styling and icon sizes - Add new controls to MultiSelect story for searchBar, selectedCount, and clearButton - Add hasBorder control to SearchBox story for border customization 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Improved MultiSelect component layout with proper spacing and conditional rendering - Added default args to MultiSelect and SearchBox stories for better control - Added new story variants: WithSearchBox, WithSelectedCount, WithClearButton, AllHeaderFeatures, CustomSearchPlaceholder - Added WithBorder and NoBorder variants to SearchBox story - Updated BaseWidget story to showcase MultiSelect with all header features enabled - Fixed conditional rendering of header section in MultiSelect based on feature flags 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add focused state styles to MultiSelect option passthrough - Add focused state styles to SingleSelect option passthrough - Ensures keyboard navigation highlights options like hover state 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…ponents
MultiSelect:
- Remove explicit options prop to pass all PrimeVue props via v-bind="$attrs"
- Add defineOptions({ inheritAttrs: false }) for controlled attribute inheritance
- Extend PrimeVue MultiSelectProps type in Storybook for type safety
- Add component comments explaining differences from SingleSelect and prop requirements
SingleSelect:
- Keep options prop (required for getLabel function to map values to labels)
- Add v-bind="$attrs" to maximize PrimeVue API compatibility
- Add defineOptions({ inheritAttrs: false }) for controlled attribute inheritance
- Add component and function comments explaining why options prop is necessary
Common changes:
- Keep option-label="name" as custom option template directly references it
- Use label prop instead of placeholder
- Improve Storybook type definitions to resolve TypeScript compilation errors
This refactor allows MultiSelect to flexibly utilize PrimeVue APIs while
SingleSelect maintains necessary customizations with type safety.
Co-Authored-By: Claude <noreply@anthropic.com>
…ampleModelSelector SearchBox: - Fix defineModel usage to use default 'modelValue' prop name - Remove incorrect empty string parameter that caused Vue warning - Add comment explaining defineModel behavior SampleModelSelector (formerly ModelSelector): - Rename ModelSelector.vue to SampleModelSelector.vue to indicate it's a sample component - Fix v-model syntax error in SearchBox binding (remove extra '=' character) - Add v-model:search-query binding to MultiSelect for search functionality - Add watch handlers for searchText and searchQuery debugging - Import watch from Vue and add searchText ref for MultiSelect search useModelSelectorDialog: - Update import to use renamed SampleModelSelector component These changes fix the v-model binding issues preventing search functionality from working properly in both the header SearchBox and MultiSelect components. Co-Authored-By: Claude <noreply@anthropic.com>
4ed9222 to
d9936fc
Compare







Summary
Changes
MultiSelect Component (
src/components/input/MultiSelect.vue)Storybook Stories
MultiSelect.stories.ts:
SearchBox.stories.ts:
MoreButton.stories.ts:
BaseWidget.stories.ts:
Test plan
npm run storybook)npm run test:component)🤖 Generated with Claude Code
┆Issue is synchronized with this Notion page by Unito