#7225 · Default picker opens mutate document-wide overlay state
Verdict: PARTIALLY REPRODUCED · Root-cause confidence: high for the document-wide modal state changes; browser performance impact remains unmeasured here.
1. TL;DR
The reported symptom is slow opening and closing of composer pickers. A focused runtime test of the real model picker confirms that opening it with its production default sets body[data-scroll-locked="1"], sets body.style.pointerEvents = "none", and hides the composer through an aria-hidden ancestor. Escape removes the scroll lock and restores body pointer events. Opening the same component with modal={false} satisfies a no-body-style-mutation assertion. The same agent repeated this result in a second clean checkout of trusted main; neither run measures browser style-recalculation time or recreates the reporter's plugin installation, so the performance claim is only partially reproduced.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| Composer picker defaults enable modal behavior. | Verified in trusted source. | Four pickers explicitly default to true. OptionPicker forwards an absent modal value; SessionOptionsMenu omits it. Installed Radix DropdownMenu defaults to true. See the source table below. |
| Opening a default model picker changes body-level state, and closing reverses it. | Verified at runtime in both checkouts. | The exact real-component A/B test and captured output are inline below. Escape restoration assertions pass before the intended open-state assertion fails. |
| Explicit nonmodal mode avoids those body style changes. | Verified for the model picker. | The nonmodal control passes in each checkout with unchanged production code. |
| Existing model-picker tests bypass the production default. | Verified. | The trusted test helper explicitly supplies modal=false at base line 257. The original 62 tests pass when run separately. |
| Full-page recalculation and hundreds of milliseconds of latency on plugin-loaded new-thread and thread pages. | Unverified here. | jsdom has no browser style/layout performance engine. No real user data, plugin fleet, browser trace, or reported timing was used as proof. |
| All six picker families have the same measured slowdown. | Only source-level exposure verified beyond the model picker. | No runtime/performance measurements of the other five picker families were made. |
| EnvironmentPicker already avoids the modal default. | Verified in source. | Its modal default is false at base line 211. |
3. Environment and trust
- Target repository: public
get-bb/bb. Base commit:e61446e15a0bb3e6df551e45c3aba5c5187ffad3, fetched directly from that repository's main branch and rechecked after reproduction. - Linux x86_64; Node v22.19.0; pnpm 9.15.0; Vitest 4.1.12; jsdom via the existing app test project.
- Two separate detached temporary worktrees, named
baseandverify. Both started clean at the same commit, received frozen installs, and successfully built@bb/appthrough Turbo. - No app server, provider session, browser, listening port, user data directory, or account was used. Tests run entirely in isolated worker DOMs.
- Issue and linked-PR content was treated as untrusted claims. No linked branch, issue script, or patch was executed. The reproduction patch was authored from trusted repository evidence before reading the linked PR diff.
4. Minimal reproduction
The test checks an observable document-state invariant at the real picker boundary. It does not mock Radix, scroll locking, focus handling, or the picker. It extends the existing model test harness, which already mocks unrelated SDK/command integration. No dependency or production seam is added.
- Clone the trusted repository into a fresh directory, check out the recorded main commit, install frozen dependencies, and build the affected app:
git clone https://github.com/get-bb/bb.git bb-repro-7225 cd bb-repro-7225 git checkout --detach e61446e15a0bb3e6df551e45c3aba5c5187ffad3 pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@bb/app
- Save the following investigator-authored test-only diff as
repro-7225.diff, then apply it withgit apply repro-7225.diff. All unchanged fixture data comes from the trusted existing test file.diff --git a/apps/app/src/components/pickers/ModelReasoningPicker.test.tsx b/apps/app/src/components/pickers/ModelReasoningPicker.test.tsx --- a/apps/app/src/components/pickers/ModelReasoningPicker.test.tsx +++ b/apps/app/src/components/pickers/ModelReasoningPicker.test.tsx @@ -6,6 +6,7 @@ import { fireEvent, render, screen, + waitFor, } from "@testing-library/react"; import type { AvailableModel, @@ -181,6 +182,7 @@ function renderPicker({ modelIsLoading = false, modelLoadError = null, compact = false, + modal = false, splitPane = false, muted = false, handoff, @@ -207,6 +209,7 @@ function renderPicker({ modelIsLoading?: boolean; modelLoadError?: SystemExecutionOptionsModelLoadError | null; compact?: boolean; + modal?: boolean | "production-default"; splitPane?: boolean; muted?: boolean; handoff?: ModelReasoningPickerHandoff; @@ -254,7 +257,7 @@ function renderPicker({ onServiceTierChange={onServiceTierChange} serviceTierSupportByProvider={serviceTierSupportByProvider} muted={muted} - modal={false} + modal={modal === "production-default" ? undefined : modal} handoff={handoff} agentSections={agentSections} onAgentOptionChange={onAgentOptionChange} @@ -298,6 +301,45 @@ afterEach(() => { describe("ModelReasoningPicker", () => { beforeAll(() => ModelReasoningMenu.preload()); + it.each(["production-default", false] as const)( + "issue 7225 leaves document styles unchanged with modal=%s", + async (modal) => { + const initialPointerEvents = document.body.style.pointerEvents; + renderPicker({ modal, modelOptions: manyCodexModels }); + fireEvent.click( + screen.getByRole("button", { + name: "Provider, model and reasoning", + }), + ); + await screen.findByPlaceholderText("Search models"); + const opened = { + mode: modal, + scrollLock: document.body.getAttribute("data-scroll-locked"), + bodyPointerEvents: document.body.style.pointerEvents, + composerHidden: + document + .querySelector("[data-app-composer]") + ?.closest('[aria-hidden="true"]') !== null, + }; + fireEvent.keyDown(screen.getByRole("dialog"), { key: "Escape" }); + await waitFor(() => { + expect(document.body.getAttribute("data-scroll-locked")).toBeNull(); + expect(document.body.style.pointerEvents).toBe(initialPointerEvents); + }); + console.log( + JSON.stringify({ + opened, + closed: { + scrollLock: document.body.getAttribute("data-scroll-locked"), + bodyPointerEvents: document.body.style.pointerEvents, + }, + }), + ); + expect(opened.scrollLock).toBeNull(); + expect(opened.bodyPointerEvents).toBe(initialPointerEvents); + }, + ); + it.each([ ["ArrowRight", "medium", "high"], ["ArrowLeft", "high", "medium"], - Run the focused A/B reproduction:
pnpm exec turbo run test --filter=@bb/app -- src/components/pickers/ModelReasoningPicker.test.tsx -t 'issue 7225'
Expected vs actual
Expected by the regression invariant: opening a composer model picker must leave the body without a scroll lock and without a changed pointer-events style. The control explicitly supplies nonmodal mode. The production-default case supplies undefined, allowing the actual component default to take effect.
Actual open/close snapshot (verbatim JSON emitted by the failing default case in both runs):
{"opened":{"mode":"production-default","scrollLock":"1","bodyPointerEvents":"none","composerHidden":true},"closed":{"scrollLock":null,"bodyPointerEvents":""}}
Actual assertion and result (verbatim excerpts):
AssertionError: expected '1' to be null - Expected: null + Received: "1" Tests 1 failed | 1 passed | 62 skipped (64)
The failed case is modal=production-default; the passing case is modal=false. Both cases first verify Escape restores body state. The aggregate command exits 1 as intended; no production fix was applied. Test durations are not pointerdown latency measurements.
For the surrounding baseline tests:
pnpm exec turbo run test --filter=@bb/app -- src/components/pickers/ModelReasoningPicker.test.tsx -t '^(?!.*issue 7225)' Test Files 1 passed (1) Tests 62 passed | 2 skipped (64)
No screenshot is included: this report verifies a document mutation and coverage gap, not a visual rendering defect. Raw logs and the saved patch are kept outside the public report repository; the complete repeatable evidence is inline.
5. Root cause
Trusted composer code renders the model picker without overriding modal behavior: ExecutionControls. The picker then supplies an explicitly true default to the shared responsive Popover. On noncompact viewports, the shared primitive forwards that value to Radix unchanged. The installed, lockfile-selected Radix Popover modal-content path invokes hideOthers, wraps content in RemoveScroll, and enables outside-pointer suppression.
| Trusted source at recorded base | Verified behavior |
|---|---|
| ModelReasoningPicker:238 and :1027 | modal = true; passes modal={modal} to Popover. |
| ProjectSelector:72 | modal = true. |
| MachinePicker:79 | modal = true. |
| BranchPicker:202 | modal = true. |
| OptionPicker:72 and :145 | No explicit default; forwards modal to DropdownMenu. Installed Radix DropdownMenu defaults it to true. |
| SessionOptionsMenu:232 | Omits modal on DropdownMenu. |
| Shared Popover and shared DropdownMenu | Compact viewports use the responsive drawer context; desktop forwards props to Radix. The confirmed modal path is desktop/noncompact. |
| EnvironmentPicker:211 | Already defaults to false. |
| Existing test helper:257 | Explicitly supplies false, concealing the production-default behavior from its usual test cases. |
In the installed dependencies, react-remove-scroll-bar uses the data-scroll-locked body attribute and the --removed-body-scroll-bar-size custom property; Radix DismissableLayer sets and later restores ownerDocument.body.style.pointerEvents. Body-level inherited values can invalidate descendant styles, so these are plausible document-wide style invalidation sources. The DOM transitions are established by execution; the affected-element count, number of recalculation events, forced getComputedStyle call chain, and plugin-dependent time cost are not established by these jsdom runs.
6. Proposed fix and autopilot boundary
Prefer explicit nonmodal defaults in the six affected picker implementations, preserving callers that deliberately request modal behavior. Stop overriding the production default in the primary test fixture and add behavioral assertions for scroll lock, body pointer events, Escape, outside interaction, focus, and model selection. Verify the unchanged compact responsive-drawer path separately, including Safari. A real Chromium trace with synthetic or isolated plugin content is the next experiment for quantifying style invalidation; it must not use the owner's runtime data.
No fix branch or PR is safe under this rule. The complete scoped default correction touches at least six existing implementation files before tests, exceeding the five-file autopilot limit. A global primitive change would alter unrelated menus and still cannot undo the explicit true defaults in four pickers. A model-only change would leave the other reported families unfixed. No production patch, commit, or branch was pushed.
7. Linked PR review
PR #7226 is closed and unmerged according to GitHub metadata read during this investigation. Its diff changes the six picker implementations plus three test files, consistent with the source-derived default correction. This is static alignment only, not verification of that branch or its claimed measurements. No PR branch was checked out, built, or executed. Its existence does not mean main is fixed; the trusted main reproduction still fails.
8. Verification
The same agent created the second detached worktree verify at the recorded base, checked that it was clean, ran a separate frozen install and Turbo app build, and applied only the investigator-authored test diff. The production component was unchanged in both worktrees. Re-running the exact focused command produced the same open/close JSON and the same intended default-case failure plus a passing nonmodal control.
| Check | First clean checkout | Second clean checkout |
|---|---|---|
| App build through Turbo | 5 tasks successful | 5 tasks successful; cache reused |
| Focused A/B regression | 1 failed, 1 passed, 62 skipped | 1 failed, 1 passed, 62 skipped |
| Failure reason | Expected null scroll lock; received "1" | Expected null scroll lock; received "1" |
| Escape restoration before assertion | Passed | Passed |
| Existing model-picker suite excluding repro | 62 passed, 2 skipped | Not rerun; targeted repeat was sufficient |
| Production component modified? | No | No |
This is a second clean run by the same agent, not independent verification. An initial test draft looked for a search field with too few model options; it was corrected to use the existing multi-model fixture before either final run. No correction to the final finding was necessary after the second run. The report intentionally narrows its verdict to partial reproduction instead of presenting unmeasured performance claims as observed facts.
9. Related issues
The linked PR metadata references older menu-performance work, but those historical claims were not investigated here. This report is restricted to issue #7225 and its verified code paths. GitHub search found no open PR linked to #7225 at the final check.
10. Appendix
All code permalinks above were checked against files at the recorded base commit. The test-only patch adds 43 lines and deletes 1 line; it is not a proposed production fix. git diff --check passed in both worktrees. Trusted main was fetched again and remained at the same commit. Public output contains no runtime data, credentials, host identifiers, private plugin names, screenshots, or raw machine paths.
Commands used, apart from read-only source searches and GitHub classification/metadata queries:
git fetch https://github.com/get-bb/bb.git main:refs/remotes/origin/main git worktree add --detach base e61446e15a0bb3e6df551e45c3aba5c5187ffad3 git worktree add --detach verify e61446e15a0bb3e6df551e45c3aba5c5187ffad3 In each worktree: pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@bb/app Apply only the test diff printed above. pnpm exec turbo run test --filter=@bb/app -- src/components/pickers/ModelReasoningPicker.test.tsx -t 'issue 7225' git diff --check First worktree only: pnpm exec oxfmt apps/app/src/components/pickers/ModelReasoningPicker.test.tsx pnpm exec turbo run test --filter=@bb/app -- src/components/pickers/ModelReasoningPicker.test.tsx -t '^(?!.*issue 7225)' git diff --numstat
No long-lived app, daemon, browser, server, or provider process was started, so there are no isolated app ports or runtime data directories to clean up. Local test artifacts remain outside the public reports repository.