Skip to content

feat(sidebar): scoped command palette for task search#2175

Merged
jonathanlab merged 3 commits into
mainfrom
posthog-code/sidebar-task-search
May 19, 2026
Merged

feat(sidebar): scoped command palette for task search#2175
jonathanlab merged 3 commits into
mainfrom
posthog-code/sidebar-task-search

Conversation

@posthog
Copy link
Copy Markdown
Contributor

@posthog posthog Bot commented May 18, 2026

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.

2026-05-19 00 42 00

Context https://posthog.slack.com/archives/C09G8Q32R6F/p1779108205662669

Changes

  • Sidebar nav: nothing => new Search nav item; opens the command palette
  • Tasks section: search icon button next to the label => opens the command palette
  • Command palette: separate command list => one merged list of commands + tasks (no scope picker)
    • Task rows render the same status icon as the sidebar (cloud / PR / branch / state)
    • Long task names wrap instead of truncating (min-height, not fixed height)
  • TaskIcon: inline icon logic in TaskItem => extracted shared component used by both sidebar and palette
  • Icon colors: text-* classes => phosphor color prop (SVG fill), so they survive quill's highlighted-row color reset
  • Nav item shortcuts: hidden => keyboard shortcut Kbd revealed on hover (⌘K Search, ⌘N New task, ⌘I Inbox)
  • Inbox: tooltip shortcut= prop => inline hover Kbd; @components/ui/Badge color="amber" => quill Badge variant="warning"
  • useTaskPrStatus: TaskData param => minimal Pick<TaskData, "id" | "cloudPrUrl">
  • CommandMenuAction: added "open-task"

Notes

  • The earlier inline-search-header approach and the scope-Select were both reverted along the way.
  • The palette fires getTaskPrStatus per task so task rows show PR/branch status with full parity to the sidebar — a query per task on open for large workspaces.
  • Couldn't verify in a running Electron build.

🤖 Generated with Claude Code

PostHog Code and others added 2 commits May 18, 2026 09:58
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>
@adamleithp adamleithp changed the title feat(sidebar): inline search for tasks list feat(sidebar): scoped command palette for task search May 18, 2026
@adamleithp adamleithp marked this pull request as ready for review May 18, 2026 12:49
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

Prompt To Fix All With AI
Fix 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

Comment thread apps/code/src/renderer/features/command/components/CommandMenu.tsx
Comment thread apps/code/src/renderer/features/command/components/CommandMenu.tsx Outdated
- 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>
Copy link
Copy Markdown
Contributor

@jonathanlab jonathanlab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@adamleithp adamleithp requested a review from a team May 19, 2026 11:58
@jonathanlab jonathanlab merged commit bd96700 into main May 19, 2026
15 checks passed
@jonathanlab jonathanlab deleted the posthog-code/sidebar-task-search branch May 19, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants