Skip to content

Conversation

@viva-jinyi
Copy link
Member

@viva-jinyi viva-jinyi commented Aug 21, 2025

Summary

  • Enhanced MultiSelect component with improved layout and conditional rendering
  • Added comprehensive Storybook stories for better component testing and documentation
  • Improved UI/UX for MultiSelect header features with proper spacing

Changes

MultiSelect Component (src/components/input/MultiSelect.vue)

  • Improved layout with proper spacing between search box and header controls
  • Added conditional rendering for header section based on feature flags
  • Fixed spacing issues with divider line positioning

Storybook Stories

  • MultiSelect.stories.ts:

    • Added default args for all controls
    • Added 5 new story variants: WithSearchBox, WithSelectedCount, WithClearButton, AllHeaderFeatures, CustomSearchPlaceholder
    • Enhanced controls for hasSearchBox, showSelectedCount, hasClearButton, searchPlaceholder
  • SearchBox.stories.ts:

    • Added default args with placeHolder and hasBorder
    • Added WithBorder and NoBorder story variants
    • Fixed template syntax and improved story structure
  • MoreButton.stories.ts:

    • Updated button type to transparent for better visual consistency
    • Added proper icon sizing (16px)
  • BaseWidget.stories.ts:

    • Updated to showcase MultiSelect with all header features enabled

Test plan

  • Run Storybook (npm run storybook)
  • Test MultiSelect component with all new story variants
  • Verify proper spacing and conditional rendering in MultiSelect header
  • Test SearchBox with border toggle functionality
  • Verify MoreButton displays with transparent styling
  • Test BaseWidget with enhanced MultiSelect features
  • Run component tests (npm run test:component)

🤖 Generated with Claude Code

┆Issue is synchronized with this Notion page by Unito

@viva-jinyi viva-jinyi requested a review from a team as a code owner August 21, 2025 14:31
@github-actions
Copy link

github-actions bot commented Aug 21, 2025

🎭 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!

@github-actions
Copy link

github-actions bot commented Aug 21, 2025

🎨 Storybook Build Status

Build failed!

⏰ Completed at: 08/31/2025, 05:06:52 AM UTC

🔗 Links


⚠️ Please check the workflow logs for error details.

@Myestery
Copy link
Collaborator

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

@DrJKL DrJKL self-assigned this Aug 21, 2025
@DrJKL DrJKL removed their assignment Aug 21, 2025
@viva-jinyi
Copy link
Member Author

🚀 Additional Improvements Made

Beyond the initial review feedback, I've implemented several enhancements to improve the developer experience:

Storybook Enhancements

  • Default options in all stories: Both MultiSelect and SingleSelect stories now have default options in their controls, making it easier to test without manual setup
  • Removed modelValue from controls: The modelValue is now managed internally as it should be, not exposed in Storybook controls
  • Fixed story reactivity: All stories (WithPreselectedValues, MultipleSelectors, etc.) now properly respond to control changes
  • Pre-populated sample data: Stories that demonstrate specific features (like WithSelectedCount, WithClearButton) now come with pre-selected items to better showcase the functionality

Component Improvements

  • Clear event emission: Added a @clear event that fires when the clear button is clicked, giving parent components full awareness of the clear action while maintaining v-model synchronization
  • Proper Option type usage: Fixed all stories to use the correct name property instead of label to match the component's type definition

SingleSelect Updates

  • Applied the same Storybook improvements to SingleSelect for consistency
  • Added default options and proper args binding to all SingleSelect stories

These changes make the components more developer-friendly and the Storybook stories more interactive and useful for testing different configurations.

@viva-jinyi viva-jinyi requested a review from DrJKL August 22, 2025 13:36
@viva-jinyi viva-jinyi force-pushed the feature/multi-select-story branch from 5d5dac8 to 0920504 Compare August 22, 2025 13:36
@DrJKL
Copy link
Contributor

DrJKL commented Aug 22, 2025

I think maybe the most recent commit didn't push. I don't see the changes.

@viva-jinyi viva-jinyi force-pushed the feature/multi-select-story branch from 7b7c992 to 2ef7413 Compare August 23, 2025 12:42
@christian-byrne christian-byrne force-pushed the feature/multi-select-story branch from 2ef7413 to 0db1555 Compare August 23, 2025 19:46
@christian-byrne
Copy link
Contributor

I rebased this for you so we can re-run CI with the fixed tests.

@DrJKL
Copy link
Contributor

DrJKL commented Aug 23, 2025

I'm not seeing any default items. The storybook should update on new commits, right?
image

@viva-jinyi
Copy link
Member Author

@DrJKL Something went wrong. Let me fix it.

@DrJKL
Copy link
Contributor

DrJKL commented Aug 23, 2025

For the searchbox, can we add +icon -border?
image

@viva-jinyi
Copy link
Member Author

@DrJKL What do you mean +icon -border?

@DrJKL
Copy link
Contributor

DrJKL commented Aug 23, 2025

@DrJKL What do you mean +icon -border?

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.

@viva-jinyi
Copy link
Member Author

@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.

@viva-jinyi
Copy link
Member Author

Neutralize Storybook's injected styles that override MultiSelect component styling during build.
스크린샷 2025-08-26 오후 2 07 11

@viva-jinyi viva-jinyi force-pushed the feature/multi-select-story branch from b21cee8 to 53ffff1 Compare August 30, 2025 00:09
DrJKL
DrJKL previously approved these changes Aug 30, 2025
:label="$t('g.clearAll')"
type="transparent"
size="fit-content"
class="text-sm !text-blue-500 !dark-theme:text-blue-600"
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we don’t add the import in this class, the color override won’t work as intended. I think it would be better to open up a new prop in TextButton in new PR, decide on a name for this blue-styled button type, and then discuss with design how it should be defined and applied.

스크린샷 2025-08-31 오전 9 03 08 스크린샷 2025-08-31 오전 9 03 18 스크린샷 2025-08-31 오전 9 03 27 스크린샷 2025-08-31 오전 9 03 36

Comment on lines 73 to 85
: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'
"
Copy link
Contributor

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?

Copy link
Member Author

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.

@christian-byrne christian-byrne added the claude-review Add to trigger a PR code review from Claude Code label Aug 30, 2025
Comment on lines 4 to 16
:options="options"
option-label="name"
unstyled
:placeholder="label"
:max-selected-labels="0"
Copy link
Contributor

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.

Copy link
Member Author

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.

@Comfy-Org Comfy-Org deleted a comment from snomiao Aug 30, 2025
@viva-jinyi viva-jinyi force-pushed the feature/multi-select-story branch from cfd4928 to 07abda2 Compare August 30, 2025 23:50
@viva-jinyi
Copy link
Member Author

viva-jinyi commented Aug 31, 2025

📝 Changes Summary

1. Improved props handling for MultiSelect/SingleSelect (commit: 50db4b7)

  • MultiSelect: Removed options prop, pass all PrimeVue props via v-bind="$attrs"
  • SingleSelect: Kept options prop (required for getLabel function), added v-bind="$attrs"
  • Fixed Storybook type definitions to resolve TypeScript errors

2. Fixed SearchBox v-model bugs (commit: 4ed9222)

  • Fixed defineModel usage (removed empty string parameter)
  • Fixed v-model syntax error: v-model:=v-model
  • Added v-model:search-query binding to MultiSelect
    (cc. @Myestery)

3. Renamed ModelSelector → SampleModelSelector (commit: 4ed9222)

  • Renamed to clarify it's a sample component
  • Updated import path in useModelSelectorDialog

Result: Search functionality working properly, all TypeScript checks passing

@christian-byrne @DrJKL

viva-jinyi and others added 15 commits August 31, 2025 14:06
- 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>
@viva-jinyi viva-jinyi force-pushed the feature/multi-select-story branch from 4ed9222 to d9936fc Compare August 31, 2025 05:06
@viva-jinyi viva-jinyi merged commit f8b8b1c into main Aug 31, 2025
11 checks passed
@viva-jinyi viva-jinyi deleted the feature/multi-select-story branch August 31, 2025 05:50
@viva-jinyi viva-jinyi restored the feature/multi-select-story branch September 1, 2025 08:51
@benceruleanlu benceruleanlu mentioned this pull request Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-review Add to trigger a PR code review from Claude Code size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants