#8248 · Provider browse state is absent from the model picker

Bug Priority: Low Effort: Low ui providers

GitHub issue #8248 · Investigated November 26, 2026 · Trusted base b0ddaad731565d7e4de68d824120d802fc78f7d5

REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro

TL;DR

The model picker displays provider icons and underlines the provider whose models are being browsed. In a healthy catalog, it does not display that provider's name beside the list, and its native buttons do not expose which provider is active. Switching providers changes the models and underline but supplies neither a textual provider heading nor a programmatic pressed/selected state. The state and provider label already exist inside the picker; the rendering omits them. A regression test reproduces the missing heading on two clean checkouts of the same trusted main commit, and a real browser confirms the missing accessibility state.

Claims vs findings

Claim under investigationFindingEvidence
Icon-bearing provider controls do not visibly identify the active catalog by name.VerifiedReal picker screenshots below show icon-only controls followed directly by the model search/list.
The active provider is indicated by an underline rather than an accessible selected state.VerifiedAll three provider buttons have null aria-pressed and aria-selected; the accessibility snapshot contains ordinary buttons without a selected/pressed marker.
The picker already knows the provider label.VerifiedactiveProviderLabel is derived from the active provider at base lines 439–442.
Keyboard activation is unavailable.Not established, and not required to explain the bugThe base uses native buttons, which already have keyboard activation and names from their titles. The defect is missing active-state semantics and a visible catalog name, not the absence of a button action. The fix preserves native keyboard behavior and adds a visible keyboard focus ring.
Provider changes must keep the label and accessibility state synchronized.Verified after repairRegression cases cover desktop and compact viewports; real-browser Enter and Space activation update the heading and exactly one pressed button.

Environment

Minimal reproduction

  1. Clone the public target and select the trusted main commit:
git clone https://github.com/get-bb/bb.git bb-repro
cd bb-repro
git checkout --detach b0ddaad731565d7e4de68d824120d802fc78f7d5
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build --filter=@bb/app

2. In apps/app/src/components/pickers/ModelReasoningPicker.test.tsx, replace the existing test named commits a provider tab immediately and keeps its models selectable with the following case. It deliberately reuses that file's existing fixtures and query harness; it does not create a test-only production export or mock a database.

it.each([false, true])(
  "names the active provider and exposes selection while switching (compact=%s)",
  async (compact) => {
    const { onSelectedProviderChange, onModelChange } = renderPicker({
      compact,
      pickerProviderOptions: providerOptions.map((provider) => ({
        ...provider,
        icon: () => <svg aria-hidden="true" />,
      })),
    });
    fireEvent.click(screen.getByRole("button", {
      name: "Provider, model and reasoning",
    }));
    expect(await screen.findByRole("heading", { name: "Codex" })).not.toBeNull();
    expect(screen.getAllByText("5.5")).toHaveLength(2);
    expect(screen.getByRole("button", {
      name: "Codex", pressed: true,
    })).not.toBeNull();
    const alternateProvider = screen.getByRole("button", {
      name: "Claude Code", pressed: false,
    });
    fireEvent.click(alternateProvider);
    expect(onSelectedProviderChange).toHaveBeenCalledWith("claude-code");
    expect(await screen.findByText("Opus 4.7")).not.toBeNull();
    expect(screen.getByRole("heading", { name: "Claude Code" })).not.toBeNull();
    expect(screen.queryByRole("heading", { name: "Codex" })).toBeNull();
    expect(screen.getByRole("button", {
      name: "Codex", pressed: false,
    })).not.toBeNull();
    expect(screen.getByRole("button", {
      name: "Claude Code", pressed: true,
    })).toBe(alternateProvider);
    expect(screen.getAllByText("5.5")).toHaveLength(1);
    expect(onModelChange).not.toHaveBeenCalled();
    fireEvent.click(screen.getByText("Opus 4.7"));
    expect(onSelectedProviderChange).toHaveBeenCalledTimes(1);
    expect(onModelChange).toHaveBeenCalledWith("claude-opus-4-7");
  },
);

3. Run the focused regression against unchanged production source:

pnpm exec turbo run test --filter=@bb/app -- \
  src/components/pickers/ModelReasoningPicker.test.tsx \
  -t 'names the active provider'

Expected: a visible Codex heading and one pressed provider, switching to a Claude Code heading and the alternate pressed provider. Actual before repair: both viewport cases fail at the missing heading. Verbatim diagnostic excerpts from both runs:

TestingLibraryElementError: Unable to find role="heading" and name "Codex"
Test Files  1 failed (1)
     Tests  2 failed | 72 skipped (74)

4. For the visual path, render the real ModelReasoningPicker inside the existing ModelPickerStoryQueryProvider from apps/app/.ladle/model-picker-query-provider.tsx. Supply STORY_PROVIDER_OPTIONS, STORY_CODEX_MODELS, and STORY_CODEX_REASONING from the adjacent story fixtures. Start with selectedProviderId="codex", modelValue="gpt-5.5", hasMultipleProviders, and modal={false}; use non-persisting callbacks. Open the picker, then select the second provider. These are the actual component and application CSS, not a recreation of the control.

Closed picker showing the selected model
Before opening: the real picker trigger in the isolated fixture.
Open base picker with provider icons and no provider heading
Base, open: an underline beneath the first icon identifies the catalog visually. No visible provider name appears between the icon controls and models.
Base picker after switching providers, still without provider heading
Base, after selecting the second icon: the model catalog and underline change, but a visible provider name and accessible active state are still absent.

In that real-browser session, the following read-only DOM inspection independently verifies the state omission:

[...document.querySelectorAll("button[title]")].map(button => ({
  title: button.title,
  text: button.textContent,
  pressed: button.getAttribute("aria-pressed"),
  selected: button.getAttribute("aria-selected"),
}))

[
  { title: 'Codex', text: '', pressed: null, selected: null },
  { title: 'Claude Code', text: '', pressed: null, selected: null },
  { title: 'Pi', text: '', pressed: null, selected: null }
]

Root cause

The provider selection logic is already centralized. The active catalog provider is the preview provider when browsing, otherwise the selected provider. Its label is also already resolved. The problem is the final JSX: isActive selects border and text classes only; the native button receives no pressed state, and the healthy catalog has no provider-name heading.

const activeProviderLabel = activeProvider?.label ?? activeProviderId;

const isActive = provider.value === activeProviderId;

isActive
  ? "border-foreground text-foreground"
  : "border-transparent text-muted-foreground hover:text-foreground"

This is a UI presentation/accessibility omission, not provider discovery, stale query data, or a server/daemon policy failure. The existing title supplies an accessible button name; adding a second name is unnecessary. Exposing aria-pressed={isActive} on the existing button is sufficient for active-state semantics without pretending the controls implement the additional keyboard contract of an ARIA tablist.

Proposed fix and verification

Render activeProviderLabel as a visible heading immediately after the provider controls. Name their group, expose aria-pressed from the same isActive value used by the underline, and restore a visible keyboard focus ring. Keep the existing title-derived accessible names and native Tab/Enter/Space activation. Reuse the original provider-switch test as the regression owner, parameterized over desktop and compact modes.

The repair changes only the picker and its existing test: 59 additions + 19 deletions = 78 changed text lines in two files. It adds no dependency, persisted data, public API, protocol, schema, packaging, permission change, or alternative selection path. The existing SDK/CLI selection behavior is unchanged.

pnpm exec turbo run test --filter=@bb/app -- \
  src/components/pickers/ModelReasoningPicker.test.tsx \
  src/components/pickers/ModelReasoningPicker.cold-open.test.tsx

Test Files  2 passed (2)
     Tests  75 passed (75)

pnpm exec turbo run test --filter=@bb/app -- src/components/pickers

Test Files  11 passed (11)
     Tests  179 passed (179)

pnpm exec turbo run typecheck lint --filter=@bb/app

Found 0 warnings and 0 errors.
Tasks:    7 successful, 7 total

git diff --check

No output; exit status 0.
Repaired picker with the provider name above its model list
Repair, initial catalog: the active provider name is visible above the search/model list.
Repaired picker after keyboard selection with a visible focus ring and updated provider heading
Repair, keyboard activation: Shift+Tab navigates from search through the provider buttons; Enter selects the second provider. The heading updates, the second button is pressed, and the keyboard focus ring remains visible. Space activation back to the first provider was also checked.
Repaired compact drawer with active provider heading
Repair at a 390 × 844 touch viewport: the persistent drawer realizes the same provider heading and pressed state. Switching providers updates both. The app root remains without inert or aria-hidden. This is Chromium emulation, not iOS Safari verification.

Verification: second clean reproduction

The same agent repeated the baseline failure directly, without a workflow or another agent. A second detached worktree was created at the exact base commit, followed by a separate frozen install. Only the regression test file was copied into it; the picker production source remained unchanged. Its diff named only apps/app/src/components/pickers/ModelReasoningPicker.test.tsx. Both desktop and compact cases again failed at the missing Codex heading. No report correction was required.

git worktree add --detach "$CHECKOUT_B" b0ddaad731565d7e4de68d824120d802fc78f7d5
cd "$CHECKOUT_B"
pnpm install --frozen-lockfile --prefer-offline
cp "$CHECKOUT_A/apps/app/src/components/pickers/ModelReasoningPicker.test.tsx" \
  apps/app/src/components/pickers/ModelReasoningPicker.test.tsx
pnpm exec turbo run test --filter=@bb/app -- \
  src/components/pickers/ModelReasoningPicker.test.tsx \
  -t 'names the active provider'

TestingLibraryElementError: Unable to find role="heading" and name "Codex"
Test Files  1 failed (1)
     Tests  2 failed | 72 skipped (74)

CHECKOUT_A and CHECKOUT_B stand for separate local checkout paths, omitted for privacy. These are two clean-base runs by the same investigator, not independent verification. The second reproduction required no server, port, or application data directory. The repair was tested only in the first worktree.

Related issues and pull requests

The issue closing references and cross-reference timeline contained no linked open pull request when checked. Similar model-picker issues were inspected for triage patterns; none was used as executable evidence. No external issue link or linked branch was fetched or run.

Appendix and limits

The publication contains only this self-contained report, screenshot assets, and its summary metadata. The focused test is inline above; raw logs, build files, and test artifacts remain outside the public report repository. Each source permalink was checked against the recorded base. All screenshot images are real captures of the production component and application CSS with repository-owned catalog fixtures.

Issue content was treated only as untrusted claims. No supplied issue command, patch, attachment, external URL, or linked PR code was executed. The report establishes the UI and accessibility-tree defect without claiming a live-provider session, a physical screen reader session, or an iOS Simulator test. Temporary browser and HTTP resources were cleaned up after verification.