Skip to content

Add search to project picker - #2939

Merged
ymichael merged 1 commit into
mainfrom
bb/read-discord-post-thr_dds9vhf8bi
Sep 2, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/read-discord-post-thr_dds9vhf8bi

Conversation

@ymichael

@ymichael ymichael commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The project picker rendered every project as a static dropdown list, so workspaces with many projects required scanning the entire menu to find a target. This addresses #2696.

What changed

Replaced the project dropdown with the shared responsive Popover and Command primitives. When more than five projects exist, the picker now shows a focused search input and filters names case-insensitively. Project creation and no-project actions stay visible for no-match queries, search resets after close, short lists preserve keyboard navigation, and only the results region scrolls. No wire, CLI, guide, or protocol changes.

How you verified

  • pnpm exec turbo run test --filter=@bb/app --force -- src/components/pickers/ProjectSelector.test.tsx (5 passed)
  • pnpm exec turbo run typecheck --filter=@bb/app --force
  • pnpm exec turbo run test --filter=@bb/app --force (467 files, 3,741 passed, 4 skipped)
  • Desktop and mobile manual QA with Doobie, including filtered results and empty-search states

Fixes #2696

AGENT GENERATED

@ymichael
ymichael merged commit c4e73fb into main Sep 2, 2026
15 checks passed
@ymichael
ymichael deleted the bb/read-discord-post-thr_dds9vhf8bi branch September 2, 2026 17:17
ymichael added a commit that referenced this pull request Sep 2, 2026
## Human comments

## What was wrong

The searchable Project picker used cmdk's moving `aria-selected` state
as its only option-selection signal after #2939. That state identifies
the keyboard-highlighted row, not the persisted project value, so
assistive technology could report Alpha selected while Charlie was the
actual checked project; the trigger also exposed only the generic name
“Project.” Parent Thread had the same current-value ambiguity.

## What changed

- Name the Project trigger with its displayed current value.
- Mark the persisted Project, no-project choice, and Parent Thread value
with `aria-current`.
- Keep cmdk's `aria-selected` behavior for the movable keyboard
highlight.
- Hide decorative check icons from assistive technology.
- Add focused regressions proving current value remains stable while
keyboard highlight moves.

This is semantically separate from #2943's open search-matching change
and composes with it. No daemon wire contract, server API, public Plugin
SDK API, CLI, documentation, or protocol version changed.

## How you verified

- The four focused accessibility assertions failed before the
implementation and passed afterward.
- `pnpm exec turbo run test --filter=@bb/app --force -- --run
src/components/pickers/ProjectSelector.test.tsx
src/components/pickers/ParentThreadPicker.test.tsx` — 11 tests passed.
- Full app suite — 3,744 tests passed and 4 skipped.
- `pnpm exec turbo run typecheck --filter=@bb/app` — passed.
- `pnpm exec oxfmt --check
apps/app/src/components/pickers/ProjectSelector.tsx
apps/app/src/components/pickers/ProjectSelector.test.tsx
apps/app/src/components/pickers/ParentThreadPicker.tsx
apps/app/src/components/pickers/ParentThreadPicker.test.tsx` — passed.
- `git diff --check origin/main...HEAD` — passed.
- Matching desktop and compact QA confirmed the current project remains
visually checked while ArrowDown moves the command highlight.

> AGENT GENERATED
ymichael added a commit that referenced this pull request Sep 2, 2026
## Human comments

## What was wrong

Project, Branch, and Model each implemented the same autofocus policy
differently. That duplication made picker behavior easy to drift:
desktop search should receive focus, compact and touch-oriented layouts
should wait for a deliberate tap so they do not raise the keyboard, and
clicking a Model provider should not steal focus from a search field the
user is already typing in. This is a follow-up to #2939.

## What changed

The shared Popover now owns the picker autofocus policy. It suppresses
passive autofocus on compact or coarse-pointer layouts and focuses an
explicit target on fine-pointer desktop, including targets realized
after the drawer opens. Branch and Model no longer carry their own
platform checks, and pointer-based Model provider switching preserves an
already-focused search field while keyboard behavior stays unchanged.

The plugin registry's generated Popover item, item index, and new
transitive `use-pointer-coarse` hook item were regenerated with the
repository generator. There are no wire-contract, daemon-protocol, CLI,
or documentation changes.

## How you verified

- Added red/green coverage for compact, coarse-pointer, delayed
search-target, and Model provider-switch focus behavior.
- `pnpm exec turbo run test --filter=@bb/app --force --
"src/components/ui/responsive-overlay.test.tsx"
"src/components/pickers/ProjectSelector.test.tsx"
"src/components/pickers/BranchPicker.scroll.test.tsx"
"src/components/pickers/ModelReasoningPicker.test.tsx"
"src/components/pickers/ParentThreadPicker.test.tsx"` — 5 files and 61
tests passed.
- `pnpm exec turbo run test --filter=@bb/plugin-registry --force` —
registry freshness and vendoring test passed; 58 items are current.
- `pnpm exec turbo run typecheck --filter=@bb/app --filter=@bb/shared-ui
--filter=@bb/plugin-registry --force` — all three packages passed.
- `pnpm exec oxfmt --check` on the five manually authored source files
passed. Generator-owned JSON was preserved exactly as emitted.
- `node packages/plugin-registry/scripts/build-registry.mjs --check` and
`git diff --check origin/main...HEAD` passed.
- The full `@bb/app` suite passed previously: 468 files and 3,754 tests,
with 4 skipped.
- Browser QA confirmed desktop search autofocus, no compact search
autofocus or app-root `inert`/`aria-hidden`, and preserved focus while
switching populated Model providers.

Follow-up to #2939.

> AGENT GENERATED
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.

[UI] Add search to the project picker dropdown

1 participant