GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(browser): wait for the menu's first row before End by Hona · Pull Request #65336 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Nov 21, 2026

Copy link
Copy Markdown
Member

The flake

  • browser-pane.spec.ts, "restores the full pane when the toolbar closes and keeps the selected device on reopen", fails at expect(moreDevices).toBeFocused() after End: focus is on the first row, "Responsive".
  • It fails alone, so no earlier test or shared worker state is involved.

Cause

  • A menu opened from the keyboard shows its rows before it takes the keyboard. Kobalte defers the menu's autofocus (deferAutoFocus) until its items are mounted.
  • The test pressed End once the rows were visible. When that came before the first row had focus, the key went to the trigger, which ignores it, and focus then landed on the first row.

Measured from the opening ArrowDown, 30 runs per row (ms, min / median / max):

Rows visible First row focused
Normal speed 12 / 14 / 21 21 / 33 / 38
4× CPU throttling 101 / 121–141 / 222 169 / 194–227 / 348

Events from an instrumented run (ms since page load):

Failing run Passing run
ArrowDown on the trigger 517 5194
menu rows in the page 531 5207
End 547 on the trigger, ignored 5227 on "Responsive"
focus 569 "Responsive" 5222 "Responsive", 5230 "More devices"

Fix

await expect(option("Responsive")).toBeFocused()
await page.keyboard.press("End")
await expect(moreDevices).toBeFocused()
  • The test waits for the menu's first row to be focused, which is the menu's own signal that it has the keyboard.
  • No timeout, retry or product change.

Counts (Windows, 2 workers, retries off)

Run dev With the fix
The test alone 5 of 40 failed (an instrumented copy: 9 of 40) 0 of 80
Whole file 2 of 10 runs failed 0 of 20
  • browser-pane* and plugin-host specs, cold story server: 148 passed, no dependency re-optimization.
  • Three other tests press a key on a menu right after it opens: browser-pane-restore.spec.ts:328 and :360, and browser-pane.spec.ts:2021. They focus the menu item they press, so the key cannot go to the trigger, and each passed 40 of 40. They are unchanged.

Limits

  • On a slow or busy machine (4× CPU throttling: 170–350 ms) a fast ArrowDown-then-End can lose the End in any dropdown menu, because the shared menu focuses its first row after it shows it. This PR does not change that.

Feature flag: none needed. Test only.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Hona added 2 commits November 21, 2026 14:18
@Hona
test(browser): wait for the menu's first row before End
7179da2
@Hona
Merge remote-tracking branch 'origin/dev' into toolbar-restore-flake
2683c34
opencodejr[bot]
opencodejr Bot reviewed Nov 21, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks right to me. Waiting for Responsive to be focused is a deterministic signal that the menu has taken the keyboard. Responsive is both the first and the checked row, so the wait can't pass for the wrong reason, and there are no timeouts or retries involved. I couldn't reproduce the flake on Linux: the base spec passed every run, including with CPU contention and 6x CDP throttling. With the change, the test passed 40/40. Public API: unchanged (test-only).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
Hona merged commit a4b7cc9 into dev Nov 21, 2026
26 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Hona
Hona deleted the toolbar-restore-flake branch November 21, 2026 04:44
@kobzevvv kobzevvv mentioned this pull request Nov 24, 2026
chore(upstream): порт v2.4.1 — 67 в порт, 38 на решение gpt-mem/opencode-mem#223
Open
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Hona
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.