feat: fix rerenders on search input#3784
Conversation
PR SummaryLow Risk Overview Moves shared types/styles and the Written by Cursor Bugbot for commit 23f9952. This will update automatically on new commits. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR refactors the Key changes:
One P2 style issue remains: Confidence Score: 4/5Safe to merge after fixing the rounded-sm visual regression in command-items.tsx All previously raised issues are resolved. The refactoring is well-structured and achieves its goal of eliminating unnecessary re-renders. The only outstanding issue is a minor visual regression (rounded-sm → 2px instead of the original 4px corner radius on icon containers), which is a targeted one-line fix per affected component. apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/_components/command-items.tsx — lines 23 and 64 (rounded-sm → rounded) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
SM["SearchModal\n(search-modal.tsx)"]
SG["search-groups.tsx\n(9 memoized groups)"]
CI["command-items.tsx\n(5 memoized items)"]
UT["utils.ts\n(interfaces, filterAndSort, constants)"]
IX["index.ts\n(barrel export)"]
SM -->|"imports group components"| SG
SM -->|"imports filterAndSort"| UT
SG -->|"imports item components"| CI
SG -->|"imports GROUP_HEADING_CLASSNAME"| UT
CI -->|"imports COMMAND_ITEM_CLASSNAME\nCommandItemProps"| UT
IX -->|"re-exports SearchModal"| SM
IX -->|"re-exports types"| UT
SM -->|"stable refs"| R1["routerRef\nonOpenChangeRef"]
SM -->|"stable callbacks via useCallback empty deps"| R2["handleBlockSelect\nhandleWorkflowSelect\nhandleTaskSelect\n..."]
R2 --> SG
Reviews (2): Last reviewed commit: "chore: fix review changes" | Re-trigger Greptile |
...ace/[workspaceId]/w/components/sidebar/components/search-modal/_components/command-items.tsx
Outdated
Show resolved
Hide resolved
...ace/[workspaceId]/w/components/sidebar/components/search-modal/_components/search-groups.tsx
Outdated
Show resolved
Hide resolved
...im/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx
Outdated
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/utils.ts
Outdated
Show resolved
Hide resolved
|
@greptile |
|
@cursor review |
24314f9 to
23f9952
Compare
Summary
Type of Change
Testing
Checklist