-
Notifications
You must be signed in to change notification settings - Fork 3.3k
improvement(cmdk): refactor search modal to use cmdk + fix icon SVG IDs #3044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR refactors the search modal from a custom implementation to use the Key Changes:
Issues Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Sidebar
participant SearchStore
participant PermissionConfig
participant SearchModal
participant CMDK
Note over Sidebar,SearchStore: On Sidebar Mount
Sidebar->>PermissionConfig: usePermissionConfig()
PermissionConfig-->>Sidebar: { filterBlocks }
Sidebar->>SearchStore: initializeData(filterBlocks)
SearchStore->>SearchStore: Check isInitialized flag
alt Not Initialized
SearchStore->>SearchStore: getAllBlocks()
SearchStore->>SearchStore: Filter & process blocks/tools/triggers
SearchStore->>SearchStore: Set isInitialized = true
end
Note over User,CMDK: User Opens Search Modal (Cmd+K)
User->>SearchModal: Press Cmd+K
SearchModal->>SearchStore: Read pre-computed data
SearchStore-->>SearchModal: { blocks, tools, triggers, toolOperations, docs }
SearchModal->>CMDK: Render Command palette with data
CMDK-->>User: Display search interface
Note over User,CMDK: User Searches
User->>CMDK: Type search query
CMDK->>CMDK: customFilter() scores items
CMDK-->>User: Show filtered results
Note over User,SearchModal: User Selects Item
User->>CMDK: Select item (Enter/Click)
alt Block/Tool/Trigger
CMDK->>SearchModal: handleBlockSelect()
SearchModal->>SearchModal: Dispatch 'add-block-from-toolbar' event
else Tool Operation
CMDK->>SearchModal: handleToolOperationSelect()
SearchModal->>SearchModal: Dispatch with presetOperation
else Workflow/Workspace
CMDK->>SearchModal: handleWorkflowSelect()
SearchModal->>SearchModal: router.push(href)
else Doc/Page
CMDK->>SearchModal: handleDocSelect()
SearchModal->>SearchModal: window.open(href)
end
SearchModal->>SearchModal: onOpenChange(false)
SearchModal-->>User: Close modal
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 2 comments
...im/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx
Show resolved
Hide resolved
...im/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
...im/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx
Show resolved
Hide resolved
…Ds (#3044) * improvement(cmdk): refactor search modal to use cmdk + fix icon SVG IDs * chore: remove unrelated workflow.tsx changes * chore: remove comments * chore: add devtools middleware to search modal store * fix: allow search data re-initialization when permissions change * fix: include keywords in search filter + show service name in tool operations * fix: correct filterBlocks type signature * fix: move generic to function parameter position * fix(mcp): correct event handler type for onInput * perf: always render command palette for instant opening * fix: clear search input when modal reopens
* fix(workflow): update container dimensions on keyboard movement * fix(workflow): avoid duplicate container updates during drag Add !change.dragging check to only handle keyboard movements in onNodesChange, since mouse drags are already handled by onNodeDrag. * fix(workflow): persist keyboard movements to backend Keyboard arrow key movements now call collaborativeBatchUpdatePositions to sync position changes to the backend for persistence and real-time collaboration. * improvement(cmdk): refactor search modal to use cmdk + fix icon SVG IDs (#3044) * improvement(cmdk): refactor search modal to use cmdk + fix icon SVG IDs * chore: remove unrelated workflow.tsx changes * chore: remove comments * chore: add devtools middleware to search modal store * fix: allow search data re-initialization when permissions change * fix: include keywords in search filter + show service name in tool operations * fix: correct filterBlocks type signature * fix: move generic to function parameter position * fix(mcp): correct event handler type for onInput * perf: always render command palette for instant opening * fix: clear search input when modal reopens * fix(helm): move rotationPolicy under privateKey for cert-manager compatibility (#3046) * fix(helm): move rotationPolicy under privateKey for cert-manager compatibility * docs(helm): add reclaimPolicy Retain guidance for production database storage * fix(helm): prevent empty branding ConfigMap creation * fix(workflow): avoid duplicate position updates on drag end Check isInDragOperation before persisting in onNodesChange to prevent duplicate calls. Drag-end events have dragStartPosition still set, while keyboard movements don't, allowing proper distinction.
Summary
Type of Change
Testing
Tested manually
Checklist