feat(sidebar): add search trigger that opens the command palette#2072
Merged
jschwxrz merged 2 commits intoMay 18, 2026
Conversation
Click-through input above pinned tasks and projects that opens the ⌘K modal with the current project/task/workspace context.
Contributor
Greptile SummaryThis PR adds a
Confidence Score: 4/5Safe to merge; the change is additive and well-scoped to the sidebar UI with no side effects on existing flows. The context-derivation logic is correct: projectId, taskId, and workspaceId are each gated appropriately behind the active view. Both nits are cosmetic and carry no runtime risk. src/renderer/features/sidebar/sidebar-search-trigger.tsx — the new component with the minor style issues mentioned above.
|
| Filename | Overview |
|---|---|
| src/renderer/features/sidebar/sidebar-search-trigger.tsx | New component that renders a clickable search trigger in the sidebar; correctly derives context-aware projectId/taskId/workspaceId and forwards them to the command palette. Minor style issue with a redundant ?? undefined expression. |
| src/renderer/features/sidebar/left-sidebar.tsx | Trivial one-line insertion of <SidebarSearchTrigger /> above the pinned task list; import added correctly, no structural changes. |
Sequence Diagram
sequenceDiagram
participant User
participant SidebarSearchTrigger
participant useWorkspaceSlots
participant useParams
participant getRegisteredTaskData
participant CommandPalette
User->>SidebarSearchTrigger: click search button
SidebarSearchTrigger->>useWorkspaceSlots: read currentView
SidebarSearchTrigger->>useParams: read taskParams / projectParams
SidebarSearchTrigger->>getRegisteredTaskData: lookup workspaceId (task view only)
SidebarSearchTrigger->>CommandPalette: "showCommandPalette({ projectId, taskId, workspaceId })"
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
src/renderer/features/sidebar/sidebar-search-trigger.tsx:24
The `?? undefined` at the end is redundant: `?.workspaceId` already evaluates to `undefined` when the optional chain short-circuits (the `??` operator only replaces `null` or `undefined`, so it only has any effect if `workspaceId` can be `null` — which would be worth confirming against the `Task` type). In the common case this has no runtime impact but adds noise.
```suggestion
return getRegisteredTaskData(currentProjectId, currentTaskId)?.workspaceId;
```
### Issue 2 of 2
src/renderer/features/sidebar/sidebar-search-trigger.tsx:8
`SidebarSearchTrigger` is a plain function component that relies on three separate `useObserver` calls (inside `useWorkspaceSlots`, `useParams`, and the explicit one for `currentWorkspaceId`) rather than a single `observer()` wrapper. Every other reactive component in the sidebar (e.g. `LeftSidebar`) uses the `observer()` HOC. While the hybrid approach is technically valid, it means each `useObserver` creates an independent subscription/reaction scope, so a change to navigation params triggers multiple separate re-render passes instead of one. Wrapping the component with `observer()` and removing the explicit `useObserver` call for `currentWorkspaceId` would align with the codebase convention and be slightly more efficient.
Reviews (1): Last reviewed commit: "feat(sidebar): add search trigger that o..." | Re-trigger Greptile
- Wrap in observer() instead of explicit useObserver - Drop redundant ?? undefined on optional-chained workspaceId
jschwxrz
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan