Skip to content

Make composer popup switch focus coverage deterministic - #4775

Merged
SawyerHood merged 1 commit into
mainfrom
bb/composer-popup-focus-thr_g2ychqg7i9
Oct 2, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/composer-popup-focus-thr_g2ychqg7i9

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The composer popup switch test could pass when the first popup’s pending focus animation frame ran after opening the second popup. That timing masked a focus-transfer regression: switching popup content while the host stayed open did not focus the new input.

What changed

Wait for the first popup to receive focus before opening the second, making the existing focus assertion reliably exercise switching after the initial animation frame has completed. The equivalent product fix already landed in #4765, which re-runs focus when the popup key changes; this PR adds its deterministic regression coverage.

This is layer 1 of 2, based on main. Layer 2 is #4776, which extends Windows CI and needs reliable popup switching coverage.

How you verified

  • pnpm exec turbo run test --filter=@bb/app -- src/components/promptbox/PromptBoxInternal.test.tsx: all 151 tests passed after resolving the overlap with Prepare bb-app 0.45.0 #4765.
  • pnpm exec turbo run lint typecheck --filter=@bb/app: passed before the rebase; CI checks the final head.
  • The original investigation reproduced this deterministic test failure before the equivalent product fix on Linux.
  • Formatting and git diff --check: passed. This PR also runs the full CI workflow on its final head.

AGENT GENERATED

@SawyerHood
SawyerHood added this pull request to stack #4777 October 2, 2026 22:49
@SawyerHood SawyerHood changed the title bb/composer popup focus thr g2ychqg7i9 Focus a composer popup opened from another popup Oct 2, 2026
@SawyerHood
SawyerHood marked this pull request as ready for review October 2, 2026 22:50
Opening a second popup from inside the first kept the popup host open, so
its focus effect never ran again and focus fell to the document body once
the first popup's input unmounted. The popup switch test only passed when
the first popup's pending animation frame fired after the switch, which
slower Windows runners did not guarantee.

Co-Authored-By: Claude Code <[email protected]>
@SawyerHood
SawyerHood force-pushed the bb/composer-popup-focus-thr_g2ychqg7i9 branch from c6cc028 to 7954fcd Compare October 2, 2026 22:52
@SawyerHood SawyerHood changed the title Focus a composer popup opened from another popup Make composer popup switch focus coverage deterministic Oct 2, 2026
@SawyerHood
SawyerHood merged commit b4ab0d9 into main Oct 2, 2026
27 checks passed
@SawyerHood
SawyerHood deleted the bb/composer-popup-focus-thr_g2ychqg7i9 branch October 2, 2026 22:59
SawyerHood added a commit that referenced this pull request Oct 2, 2026
## Human comments

## What was wrong

Windows CI ran only nine host package suites and application smoke
checks, leaving the app, server, plugins, CLI, parity, and other package
tests untested on Windows. Running those suites on actual runners
exposed filesystem assumptions, process cleanup races, coarse CPU
timing, and contention on four-vCPU machines.

## What changed

Add seven Windows test shards for the app, server, plugins, and
remaining packages. Run the test step under `cmd` with the runner temp
directory, install Bun for the Pi plugin suite, and retain bounded
OS-specific Turbo caches and timing artifacts. Serialize the
process-heavy host shard and limit plugin and other-package concurrency.

Fix the observed test portability failures: use an actual temporary log
directory, disable Git text conversion in the clone fixture, increase
the CPU measurement sample, retry asynchronous cleanup while child
processes release directories, allow Windows stdin EPIPE during child
exit, and use 15-second timeouts for process-spawning suites. Update the
Windows coverage, platform support, and CI performance docs.

This is layer 2 of 2, based on #4775. The equivalent popup focus fix
landed in #4765; #4775 retains its deterministic regression test. Bump
the Plugin SDK from 0.6.15 to 0.6.16 because the replay helper is
bundled into its published provider testing entry point. No
server/daemon wire fields change.

## How you verified

- The Windows matrix and portability patch match the original branch
validated by [all 30 CI
jobs](https://github.com/get-bb/bb/actions/runs/37069591771).
- The original investigation forced Windows shard execution across
repeated real-runner trials; the final stress validation passed all 13
shard copies.
- `pnpm exec turbo run build lint typecheck --filter=@get-bb/plugin-sdk
--filter=@bb/provider-bridge-protocol`: passed.
- `pnpm exec turbo run test --filter=@bb/provider-bridge-protocol`:
passed.
- `node packages/plugin-sdk/scripts/check-npm-version-guard.mjs`: passed
after the patch bump.
- `git diff --check`: passed. The [final PR
workflow](https://github.com/get-bb/bb/actions/runs/37075661524) passed
all 26 jobs on commit `2f26b6ca6112e74098a3875e3724bde15396b9fa`,
including all seven new Windows test shards, Linux tests,
Linux/macOS/Windows packaging smoke checks, lint, typechecks, and the
npm version guard. The conditional compatibility and mobile E2E jobs
were skipped.

Seven additional Windows runners took approximately 3.8–5.3 minutes each
in the original final run. Serializing the host shard avoids an
unresolved integration-server close hang under contention; broader
cleanup retries and short-path plugin validation remain follow-up work.

> AGENT GENERATED

---------

Co-authored-by: Claude Code <[email protected]>
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