Skip to content

feat: update SmartSelect component and add SmartMultiSelect exports - #78

Merged
Aunshon merged 1 commit into
mainfrom
fix/smart-select-props
Apr 5, 2026
Merged

feat: update SmartSelect component and add SmartMultiSelect exports#78
Aunshon merged 1 commit into
mainfrom
fix/smart-select-props

Conversation

@Aunshon

@Aunshon Aunshon commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features

    • SmartMultiSelect component with associated types now available for broader use throughout the application.
  • Improvements

    • Search functionality enhanced to match against both item labels and descriptions when descriptions are available.
    • Select trigger button now uses full-width styling for improved layout flexibility and better visual integration.

@coderabbitai

coderabbitai Bot commented Apr 5, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The SmartSelect component gains enhanced option filtering by combining label and description fields for search, while its trigger button switches to full-width layout. Simultaneously, the SmartMultiSelect component and associated types are added to the public API exports.

Changes

Cohort / File(s) Summary
SmartSelect Component Enhancements
src/components/ui/smart-select.tsx
Added keywords field to CommandItem combining option.label and option.description for broader search matching. Changed trigger button width from fixed (w-[250px]) to full-width (w-full). Updated shouldFilter={!onSearch} to disable internal filtering when external onSearch handler is present. Updated prop documentation.
Public API Exports
src/index.ts
Extended module exports to include SmartMultiSelect component and its associated types: SmartMultiSelectOption, SmartMultiSelectProps, SmartMultiSelectRef, and SmartMultiSelectCreateContext.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit dances through your code,
SmartSelect's filtering's been bestowed,
Keywords blend, descriptions gleam,
Full-width wonders in the theme,
Public exports bloom and grow! 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: updating SmartSelect component behavior and adding SmartMultiSelect exports to the public API.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/smart-select-props

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🧹 Nitpick comments (1)
src/components/ui/smart-select.tsx (1)

327-327: Consider a compatibility-safe default width.

Switching to w-full changes default layout behavior and may stretch existing usages that depended on the previous fixed trigger width. A capped default can reduce regressions while still supporting full-width containers when needed.

Suggested adjustment
-              "w-full justify-between border-input text-foreground font-normal",
+              "w-full max-w-[250px] justify-between border-input text-foreground font-normal",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/ui/smart-select.tsx` at line 327, The trigger currently forces
"w-full" in the class list which can stretch existing layouts; change the
default width to a compatibility-safe cap (e.g., replace "w-full" with "w-64
max-w-full" or "max-w-xs w-full" in the class string inside the
SmartSelect/SmartSelectTrigger component in src/components/ui/smart-select.tsx)
and add an optional prop (e.g., fullWidth: boolean) that when true applies
"w-full" so consumers can opt into full-width behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/ui/smart-select.tsx`:
- Line 327: The trigger currently forces "w-full" in the class list which can
stretch existing layouts; change the default width to a compatibility-safe cap
(e.g., replace "w-full" with "w-64 max-w-full" or "max-w-xs w-full" in the class
string inside the SmartSelect/SmartSelectTrigger component in
src/components/ui/smart-select.tsx) and add an optional prop (e.g., fullWidth:
boolean) that when true applies "w-full" so consumers can opt into full-width
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 215ffe3b-8ca9-4b0a-9e84-93433d90336c

📥 Commits

Reviewing files that changed from the base of the PR and between 0d12e66 and 11ed884.

📒 Files selected for processing (2)
  • src/components/ui/smart-select.tsx
  • src/index.ts

@Aunshon
Aunshon merged commit c68df05 into main Apr 5, 2026
1 check passed
@Aunshon
Aunshon deleted the fix/smart-select-props branch April 5, 2026 14:08
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.

1 participant