Skip to content

Cmd+F / app.search shortcut doesn't activate session search (works only via the sidebar button) #43

Description

@DragonnZhang

Summary

The Search action (app.search, bound to Cmd/Ctrl+F) does not activate the
session-list search box when triggered by its keyboard shortcut — reported to fail
from any screen, including the chat view. The same search does work when
invoked from the sidebar's in-navigator "Search" menu item.

Because the command palette (#41 / #42) invokes the app's own app.search action,
its Search entry inherits this bug too. This issue is about the underlying
app.search defect, which pre-dates and is independent of the command palette.

Repro

  1. Open the app.
  2. Press Cmd+F (macOS) / Ctrl+F anywhere (chat view, etc.).
    • Expected: the session-list search box appears and is focused.
    • Actual: nothing happens.
  3. Contrast: open the sidebar's Chats filter dropdown → click Search.
    • The search box appears correctly.

Investigation so far

Static analysis shows the two paths should be identical, yet they diverge:

  • There is exactly one app.search handler
    (AppShell.tsx:1309() => setSearchActive(true)) and exactly one
    searchActive state (AppShell.tsx:1225). The working sidebar button
    (AppShell.tsx:4584) calls the same setSearchActive(true).
  • useSessionSearch.ts:377 focuses the search input whenever searchActive
    flips to true, regardless of who set it.
  • No native-menu Cmd+F accelerator and no before-input-event /
    globalShortcut interception exists in the main process, so the keystroke
    should reach the renderer's capture-phase keydown listener in the action
    registry.

So by code the shortcut should behave like the button. The divergence must be a
runtime condition (focus/zone/render state) that a headless CI run can't
reproduce — the e2e sandbox has no sessions, so SessionList doesn't render
the search header even when searchActive is set, making this invisible to the
existing harness.

Plan

  • Reproduce locally with a seeded session so SessionList actually renders
    the search header, then diff the button path vs. the app.search /
    registry-execute path to find the real cause (likely focus/zone or a
    re-render/reset timing difference).
  • Fix app.search so it robustly activates + focuses search from any context
    (keyboard shortcut and command palette), and add a CDP assertion that seeds a
    session and asserts the search box appears from the shortcut.
  • Ship as its own PR (not folded into the command-palette PR).

Part of the autonomous desktop-feature loop (loop-bot).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingloop-bot

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions