Skip to content

Conversation

@tenphi
Copy link
Member

@tenphi tenphi commented Sep 19, 2025

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Sep 19, 2025

🦋 Changeset detected

Latest commit: d0ed1cb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
cube-ui-kit Ready Ready Preview Comment Sep 22, 2025 9:11am
cube-ui-kit-cursor Ready Ready Preview Comment Sep 22, 2025 9:11am

@github-actions
Copy link
Contributor

github-actions bot commented Sep 19, 2025

📦 NPM canary release

Deployed canary version 0.0.0-canary-45e7944.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a clear button feature to FilterPicker, Select, and ComboBox components, enabling users to reset their selections. It also redesigns the clear button in the SearchInput component for consistency.

  • Adds isClearable prop to FilterPicker, Select, and ComboBox components
  • Implements consistent clear button styling and behavior across components
  • Refactors TextInput styling to support the new clear button design

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/components/fields/TextInput/TextInputBase.tsx Refactors height styles using a new $size variable for cleaner size management
src/components/fields/Select/Select.tsx Adds clear button functionality with isClearable prop and proper state management
src/components/fields/Select/Select.stories.tsx Adds story documentation for the new clearable feature
src/components/fields/SearchInput/SearchInput.tsx Updates clear button styling to match the new design pattern
src/components/fields/FilterPicker/FilterPicker.tsx Implements clear button with comprehensive selection clearing logic
src/components/fields/FilterPicker/FilterPicker.stories.tsx Adds story example for clearable FilterPicker
src/components/fields/ComboBox/ComboBox.tsx Adds clear functionality supporting both custom values and selection modes
src/components/fields/ComboBox/ComboBox.stories.tsx Documents the clearable feature in stories
src/components/content/ItemBase/ItemBase.tsx Adds grid layout support for items with icons but no other content
.changeset/modern-tigers-impress.md Documents the feature addition in the changelog

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 19, 2025

🧪 Storybook is successfully deployed!

@github-actions
Copy link
Contributor

github-actions bot commented Sep 19, 2025

🏋️ Size limit report

Name Size Passed?
All 297.92 KB (+0.12% 🔺) Yes 🎉
Tree shaking (just a Button) 31.46 KB (0% 🟰) Yes 🎉
Tree shaking (just an Icon) 19.35 KB (0% 🟰) Yes 🎉

Click here if you want to find out what is changed in this build

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

let validationIcon = isInvalid ? InvalidIcon : ValidIcon;
let validation = cloneElement(validationIcon);

// Clear button logic
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

The logic for determining hasValue is complex and warrants explanation. Consider adding a comment explaining why custom value mode checks input value while regular mode checks selected key.

Suggested change
// Clear button logic
// Clear button logic
// In custom value mode, the user can type arbitrary input, so we check if the input field is non-empty.
// In regular mode, only selections from the list are allowed, so we check if a key is selected.

Copilot uses AI. Check for mistakes.
Comment on lines +332 to +341
// Clear function
let clearValue = useEvent(() => {
// Always clear input value in state so UI resets to placeholder
state.setInputValue('');
// Notify external input value only when custom value mode is enabled
if (props.allowsCustomValue) {
props.onInputChange?.('');
}
props.onSelectionChange?.(null);
state.setSelectedKey(null);
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

The clear function handles two different modes (custom value vs regular selection) with different notification behaviors. Consider adding a comment explaining why onInputChange is only called in custom value mode.

Copilot uses AI. Check for mistakes.
cursor[bot]

This comment was marked as outdated.

@tenphi tenphi merged commit 78dc7da into main Sep 22, 2025
14 checks passed
@tenphi tenphi deleted the feat-clear-button branch September 22, 2025 09:13
@github-actions github-actions bot mentioned this pull request Sep 22, 2025
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