Use shadcn InputGroup in ProjectSwitcher#2810
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 4813fe7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
|
TL;DR — Adds the shadcn Key changes
Summary | 3 files | 6 commits | base:
The new
|
There was a problem hiding this comment.
Clean refactor — the InputGroup component is a solid reusable primitive that replaces ad-hoc div + Input wiring. One import-ordering nit and an accessibility question.
| DropdownMenuTrigger, | ||
| } from '@/components/ui/dropdown-menu'; | ||
| import { Input } from '@/components/ui/input'; | ||
| import { InputGroup, InputGroupAddon, InputGroupInput } from '@/components/ui/input-group'; |
There was a problem hiding this comment.
The checked-out file shows this import ended up on line 20, after @/lib/query/projects. Biome's organizeImports expects @/components/ui/input-group to sort before @/components/ui/sidebar. Run pnpm format to auto-fix.
| return ( | ||
| // biome-ignore lint/a11y/useKeyWithClickEvents: use official shadcn example, todo: maybe refactor in the future | ||
| <div | ||
| role="group" |
There was a problem hiding this comment.
Nit: InputGroupAddon uses role="group" while its parent InputGroup already uses role="group". Nested ARIA groups imply a sub-grouping of related controls, but this element is a decorative icon container. Consider dropping role here or using role="presentation" to avoid misleading assistive technology.
There was a problem hiding this comment.
PR Review Summary
(1) Total Issues | Risk: Low
This PR cleanly introduces a new shadcn InputGroup compound component and refactors ProjectSwitcher to use it. The implementation follows established codebase patterns well — uses cva for variants, cn for class merging, data-slot attributes, and function declaration style matching other UI components.
🟡 Minor (1) 🟡
🟡 1) input-group.tsx:65 Redundant ARIA role on addon
Issue: InputGroupAddon has role="group" which is semantically incorrect — the addon is a visual container for icons/buttons, not a grouping of form controls.
Why: The parent InputGroup already has role="group" for the entire input group. Adding another role="group" on the addon can confuse assistive technologies.
Fix: Remove role="group" from the InputGroupAddon div.
Refs: WAI-ARIA group role
Inline Comments:
- 🟡 Minor:
input-group.tsx:65Remove redundant role="group"
💭 Consider (1) 💭
💭 1) input-group.tsx:113-122 Add data-slot to InputGroupText
Issue: InputGroupText is missing a data-slot attribute unlike most other compound component parts.
Why: While ButtonGroupText also lacks data-slot, the majority of UI subcomponents include it for CSS targeting and identification.
Fix: Add data-slot="input-group-text" to the span.
Refs: card.tsx CardTitle pattern
Inline Comments:
- 💭 Consider:
input-group.tsx:113-122Add data-slot attribute
✅ APPROVE
Summary: Clean implementation that follows established patterns. The component API is well-designed with proper composition support. The one Minor finding (redundant ARIA role) is a small accessibility improvement but doesn't block merge. Nice work simplifying the ProjectSwitcher search input! 🎉
Discarded (2)
| Location | Issue | Reason Discarded |
|---|---|---|
input-group.tsx:13-14 |
InputGroup role="group" without aria-label | Valid pattern — the input inside has its own aria-label="Search projects", making a group-level label redundant for single-input groups |
project-switcher.tsx:104 |
Search icon missing aria-hidden | Lucide-react icons have aria-hidden="true" by default, so this is already handled |
Reviewers (3)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
pr-review-frontend |
3 | 1 | 0 | 0 | 1 | 0 | 2 |
pr-review-consistency |
3 | 0 | 1 | 0 | 1 | 0 | 0 |
pr-review-standards |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Total | 6 | 1 | 1 | 0 | 2 | 0 | 2 |
| return ( | ||
| // biome-ignore lint/a11y/useKeyWithClickEvents: use official shadcn example, todo: maybe refactor in the future | ||
| <div | ||
| role="group" |
There was a problem hiding this comment.
🟡 Minor: Redundant role="group" on addon
Issue: InputGroupAddon has role="group" which is semantically incorrect for this element. The addon is not a grouping of interactive elements — it contains visual decorations or buttons.
Why: Using incorrect ARIA roles can confuse assistive technology users about the element's purpose. A role="group" suggests a collection of related form controls, but this addon just contains an icon or button. The parent InputGroup already has role="group" which is appropriate for the entire input group.
Fix: Remove role="group" from InputGroupAddon:
| role="group" | |
| <div |
Refs:
| function InputGroupText({ className, ...props }: React.ComponentProps<'span'>) { | ||
| return ( | ||
| <span | ||
| className={cn( | ||
| "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", | ||
| className | ||
| )} | ||
| {...props} | ||
| /> | ||
| ); |
There was a problem hiding this comment.
💭 Consider: Add data-slot attribute for consistency
Issue: InputGroupText is missing a data-slot attribute unlike most other UI subcomponents in this codebase.
Why: Most compound component parts use data-slot for CSS targeting and component identification (e.g., CardTitle, AlertTitle, DialogTitle, FormItem). While ButtonGroupText also lacks data-slot (making this not unprecedented), the majority pattern includes it.
Fix: Consider adding data-slot="input-group-text" to the span element for consistency:
| function InputGroupText({ className, ...props }: React.ComponentProps<'span'>) { | |
| return ( | |
| <span | |
| className={cn( | |
| "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", | |
| className | |
| )} | |
| {...props} | |
| /> | |
| ); | |
| function InputGroupText({ className, ...props }: React.ComponentProps<'span'>) { | |
| return ( | |
| <span | |
| data-slot="input-group-text" | |
| className={cn( | |
| "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", | |
| className | |
| )} | |
| {...props} | |
| /> | |
| ); | |
| } |
Refs:
|
@claude add a changeset based on changes in this PR |
|
Claude finished @dimaMachina's task in 1m 2s —— View job Adding changeset
Added a patch changeset for |
Co-authored-by: Dimitri POSTOLOV <dimaMachina@users.noreply.github.com>
Ito Test Report ✅18 test cases ran. 18 passed. The unified local verification run passed all 18/18 test cases with zero failures, confirming the ProjectSwitcher is stable, opens reliably on project-scoped pages, and showed no uncaught console/runtime errors across the covered scenarios. Key findings were that filtering works correctly by name, description, and case-insensitive matching (including blank/whitespace, no-description, no-match, and large-list states), navigation and recovery are robust (including unknown-project recovery, double-clicks, rapid open/close, and Back/Forward sync), keyboard/focus behavior is safely isolated to prevent accidental route changes, malicious script-like input is treated as inert text, and mobile behavior remains usable with transient search state resetting after refresh. ✅ Passed (18)Commit: Tell us how we did: Give Ito Feedback |
|
@claude audit where InputGroup can be used too instead of manual placing |
|
Claude finished @dimaMachina's task in 1m 33s —— View job Auditing
|
| Pattern | Count | Files |
|---|---|---|
| Search icon (left) only | 3 | test-case-filters, evaluation-results-filters, nango-providers-grid |
| Search icon (left) + clear button (right) | 2 | conversation-stats-card, channel-defaults-section |
All 5 use the same anti-pattern: a relative container with absolute-positioned icons and manual padding offsets (pl-8/pl-9/pl-10, pr-8) on the Input. These are direct candidates for InputGroup + InputGroupAddon + InputGroupInput (and InputGroupButton for the clear buttons).
| Branch: input-group
There was a problem hiding this comment.
PR Review Summary
(0) Total Issues | Risk: Low
This is a delta review scoped to changes since the last automated review (c99af215ac77).
Changes Reviewed
| Commit | Description |
|---|---|
8b1eaa93d |
Add changeset for InputGroup component |
4813fe731 |
fix review |
Delta: 2 files, +6/-1 lines
Assessment
✅ Changeset — Properly formatted patch bump for @inkeep/agents-manage-ui with clear description.
✅ Shadow fix — Added shadow-none to InputGroup className in project-switcher.tsx, addressing sarah-inkeep's approved review feedback to remove the subtle shadow on the search input.
🕐 Pending Recommendations (2)
Prior issues raised in the previous automated review that remain unaddressed:
- 🟡
input-group.tsx:65Redundantrole="group"on InputGroupAddon - 💭
input-group.tsx:113-122Consider addingdata-slotto InputGroupText
✅ APPROVE
Summary: Delta changes are clean — the changeset is properly formatted and the shadow fix correctly addresses the human reviewer's feedback. The PR is ready to merge. The prior accessibility suggestions (redundant ARIA role, missing data-slot) remain valid considerations for a follow-up but don't block merge. Nice work on this clean InputGroup component! 🎉
Reviewers (0)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
| N/A — delta review | — | — | — | — | — | — | — |
Note: Delta review — no subagents dispatched as changes were minimal (changeset + 1-line fix addressing human feedback).
Ito Test Report ✅20 test cases ran. 20 passed. The unified test run passed completely with 20/20 test cases green and no confirmed production defects, validating the project switcher’s new InputGroup search UI (search icon addon, aria-label, placeholder) across project-scoped routes including agents, components, skills, artifacts, settings, direct deep links, and mobile viewport navigation. Key behaviors were consistently verified: name and description filtering, correct no-results empty state, reset on close/reopen and refresh, stable back/forward history behavior, keyboard containment, icon-to-input focus, resilience under rapid toggling/double-click/rapid type-delete, safe handling of HTML/script payloads plus long and Unicode/RTL queries, and correct authorization gating where non-admin users could search but could not see a Create project action. ✅ Passed (20)Commit: Tell us how we did: Give Ito Feedback |








































before
after