Skip to content

Add side panel thread search - #94

Merged
brsbl merged 13 commits into
mainfrom
spec/side-panel-thread-search
Jun 17, 2026
Merged

Add side panel thread search#94
brsbl merged 13 commits into
mainfrom
spec/side-panel-thread-search

Conversation

@brsbl

@brsbl brsbl commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds side-panel thread search for active and archived threads. The search entry sits beside New thread, morphs into a search input on click or Cmd/Ctrl+K, and renders grouped active, archived, and recent thread rows in the sidebar.

What Changed

  • Added a typed /api/v1/threads/search route backed by SQLite FTS thread search segments.
  • Indexed thread titles, title fallbacks, visible user messages, assistant messages, and manager user messages while excluding agent-only prompt input.
  • Added frontend API/query hooks, cache invalidation, sidebar search controller, result rendering, keyboard navigation, and a Ladle story.
  • Added regression coverage for migration backfill, live indexing, route validation, cache invalidation, and sidebar interaction.

Validation

  • pnpm exec turbo run test --filter=@bb/db -- --run test/data/thread-search.test.ts
  • pnpm exec turbo run test --filter=@bb/server -- --run test/public/public-thread-search.test.ts
  • pnpm exec turbo run test --filter=@bb/app -- --run src/hooks/queries/thread-queries.test.tsx src/components/sidebar/SidebarThreadSearch.test.tsx src/components/sidebar/AppSidebarThreadSearch.test.tsx src/hooks/realtime-cache-effects.test.ts src/hooks/system-cache-effects.test.ts src/hooks/cache-owners/cache-owner-registry.test.ts
  • pnpm exec turbo run typecheck --filter=@bb/db --filter=@bb/server --filter=@bb/app

Smoke Test

Launched the dev app with scripts/bb-dev-app current, seeded one active user-message match and one archived assistant-message match, and verified the running server returned both groups from /api/v1/threads/search. The app URL returned HTTP 200. Browser-driven UI smoke was unavailable because no in-app browser target was registered in this session.

brsbl added 11 commits June 11, 2026 05:38
…d-search

# Conflicts:
#	apps/app/src/components/sidebar/AppSidebar.tsx
#	apps/app/src/components/sidebar/ProjectList.tsx
#	apps/app/src/components/sidebar/SidebarOverview.stories.tsx
#	apps/app/src/hooks/queries/query-keys.ts
#	apps/app/src/hooks/queries/thread-queries.test.tsx
#	apps/app/src/hooks/queries/thread-queries.ts
#	apps/app/src/hooks/realtime-cache-effects.test.ts
#	apps/app/src/hooks/system-cache-effects.test.ts
#	apps/app/src/lib/api.ts
#	apps/server/src/routes/threads/base.ts
#	packages/db/drizzle/meta/_journal.json
#	packages/db/src/data/events.ts
#	packages/db/src/migrate.ts
#	packages/db/src/schema.ts
#	packages/db/test/data/pending-interactions.test.ts
#	packages/db/test/migrate.test.ts
#	packages/domain/src/index.ts
#	packages/host-daemon-contract/test/contract.test.ts
#	packages/server-contract/src/api-types.ts
#	packages/server-contract/src/index.ts
#	packages/server-contract/src/public-api.ts
…d-search

# Conflicts:
#	apps/app/src/components/sidebar/AppSidebar.tsx
#	apps/app/src/components/sidebar/ProjectList.tsx
#	apps/app/src/hooks/queries/query-keys.ts
#	apps/app/src/hooks/queries/thread-queries.ts
#	packages/db/drizzle/meta/_journal.json
#	packages/db/src/data/events.ts
#	packages/db/src/data/index.ts
#	packages/db/src/data/threads.ts
#	packages/db/src/schema.ts
#	packages/db/test/migrate.test.ts
#	packages/domain/src/index.ts
#	packages/server-contract/src/api/threads.ts
#	packages/server-contract/src/public-api.ts
@brsbl
brsbl marked this pull request as ready for review June 17, 2026 18:19
@brsbl
brsbl merged commit f4e84c6 into main Jun 17, 2026
6 checks passed
@brsbl
brsbl deleted the spec/side-panel-thread-search branch June 17, 2026 19:00
SawyerHood added a commit that referenced this pull request Jun 17, 2026
…read-cancel #199)

Resolve conflicts and reconcile our automations migration with main's
hand-authored thread-search migrations:

- Backfill drizzle snapshots for main's hand-authored 0039_thread_search and
  0040_thread_search_rowid_fts (replayed via drizzle-kit against main's schema,
  preserving main's FTS SQL); regenerate our automations migration as
  0041_add_automations with its own snapshot. Full snapshot chain now intact.
- migration-journal.test.ts: add a CI guard that every journal entry has a
  snapshot and the prevId chain is unbroken (prevents snapshot-less
  hand-authored migrations from recurring).
- migrate.test.ts: keep both cleanup paths in the thread-provenance rewind;
  add resetMigrationsAfterThreadSearch so the thread-search replay tests stay
  valid now that a migration (automations) lands after thread search.
- AppSidebar.tsx / ProjectList.tsx: keep both main's thread-search UI and our
  Automations nav entry.
- CLI timeline fixtures: add systemMessageKind/systemMessageSubject (required
  on the user conversation row since #192).
- pnpm install for main's new remark-breaks dependency.

Verified: turbo build typecheck lint test --force --continue -> 69/69 tasks pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant