feat(sidebar): scoped command palette for task search#2175
Merged
Conversation
Adds a magnifying glass button to the Tasks section header (left of the filter menu). Clicking it swaps the "Tasks" label and search icon for an inline search input that autofocuses, while keeping the filter button visible. Typing filters the rendered task list (pinned, chronological, and by- project views) by title. Date group labels (Yesterday, This week, etc.) remain inline because they're derived from the filtered tasks. Keyboard: - ESC clears the query, exits search mode, and stopPropagation prevents it from bubbling to any agent-interruption handler - ArrowDown from the input focuses the first task row - ArrowUp/Down between task rows performs roving focus; ArrowUp from the first task returns focus to the input Generated-By: PostHog Code Task-Id: 79c010cc-9d8d-494b-b55e-9b44c64734a1
Replace the inline task-search header with a Search nav item and a scoped command palette. - Sidebar: add "Search" nav item => opens cmd palette in tasks scope; Tasks-section search icon button does the same - Command palette: add a quill Select to the input that switches scope Commands => Tasks; Tab cycles scope - Tasks scope lists every task; selecting one navigates to it - Nav items reveal their keyboard shortcut (⌘K / ⌘N / ⌘I) on hover - Inbox: tooltip-shortcut => inline hover Kbd; Alpha badge => quill Badge Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Prompt To Fix All With AIFix the following 3 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 3
apps/code/src/renderer/features/sidebar/components/items/SearchItem.tsx:14-19
**`⌘K` hint opens Commands scope, not Tasks scope**
The Search nav item's `onClick` calls `openCommandMenu("tasks")`, correctly landing in the Tasks scope. However, the shortcut hint `SHORTCUTS.COMMAND_MENU` (`⌘K`) is wired to `toggle()` in the store, which always resets `scope` to `"commands"` when opening. Hovering this item implies `⌘K` replicates the click, but it doesn't — the user lands in Commands scope instead. Either use a dedicated shortcut for task search or omit the hint until a dedicated shortcut exists.
### Issue 2 of 3
apps/code/src/renderer/features/command/components/CommandMenu.tsx:286-302
**Empty-task state shows misleading "No tasks match """ message**
When `tasks.length === 0` the memo returns `[]`, so `AutocompleteStatus` renders its `emptyContent` regardless of `query`. With an empty query this produces "No tasks match **""**", implying tasks exist but nothing matched. A distinct empty-state path (e.g. checking `tasks.length === 0 && !query`) would let you show "No tasks yet" or similar instead.
### Issue 3 of 3
apps/code/src/renderer/features/command/components/CommandMenu.tsx:99-102
The "Commands" and "Tasks" label strings inside `SelectItem` duplicate what's already in `SCOPE_LABELS`. By the OnceAndOnlyOnce principle these can be derived from the constant directly, so a future rename only needs one change.
```suggestion
<SelectGroup>
{(Object.keys(SCOPE_LABELS) as CommandMenuScope[]).map((s) => (
<SelectItem key={s} value={s}>
{SCOPE_LABELS[s]}
</SelectItem>
))}
</SelectGroup>
```
Reviews (1): Last reviewed commit: "feat(sidebar): scoped command palette fo..." | Re-trigger Greptile |
- Extract TaskIcon (cloud/PR/branch/state logic) into a shared component;
sidebar TaskItem and the command palette both render it
- Command palette: one merged list (no scope Select / Tab cycling);
commands + tasks together, task rows show full status icons
- Icon colors set via the phosphor `color` prop (SVG fill) => survive
quill's highlighted-row color reset
- Task list items grow (min-height) so long task names wrap, not truncate
- useTaskPrStatus accepts a minimal { id, cloudPrUrl } shape
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Task search lives in the command palette. The Search nav item and the Tasks-section search button both open one unified palette listing commands and tasks together.
Context https://posthog.slack.com/archives/C09G8Q32R6F/p1779108205662669
Changes
min-height, not fixedheight)TaskIcon: inline icon logic inTaskItem=> extracted shared component used by both sidebar and palettetext-*classes => phosphorcolorprop (SVGfill), so they survive quill's highlighted-row color reset⌘KSearch,⌘NNew task,⌘IInbox)shortcut=prop => inline hover Kbd;@components/ui/Badge color="amber"=> quillBadge variant="warning"useTaskPrStatus:TaskDataparam => minimalPick<TaskData, "id" | "cloudPrUrl">CommandMenuAction: added"open-task"Notes
Selectwere both reverted along the way.getTaskPrStatusper task so task rows show PR/branch status with full parity to the sidebar — a query per task on open for large workspaces.🤖 Generated with Claude Code