Skip to content

test(browser): open the message-link context menu by keyboard - #1884

Merged
matt2e merged 1 commit into
mainfrom
flakey-test-fix
Oct 29, 2026
Merged

matt2e merged 1 commit into
mainfrom
flakey-test-fix

Conversation

@matt2e

@matt2e matt2e commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a WebKit CI flake in buzz-links.spec.mjs: "a message link's context menu opens its thread as a tab without leaving the channel" sometimes found an empty menu after link.click({ button: "right" }) (runs 40809436911, 40568494289, 40449417643).

Cause: the right-click hit Virtua's 150 ms pointer-event hold, so the channel timeline scroller intercepted it. Playwright's retry scrolled the timeline 53 px, which restarted the hold. Playwright only checks the hit target on the press, so it reported success even though the contextmenu event went to the scroller and the link's trigger never ran.

Fix: focus the link and press Shift+F10. MessageLink's ContextMenuTrigger already opens on Shift+F10 and the ContextMenu key, anchored to the link, and MessageLink.test.tsx covers both keys. This journey tests the menu, preview and tab owner working together, not hit testing. The activation journey earlier in the same spec already uses the keyboard (Enter).

Only the test changed; product code is untouched.

Browser coverage

  • Browser cases added/removed: none. One case now opens the menu by keyboard instead of pointer.
  • The pointer path for link menus is still covered:
    • navigation-thread-history.spec.mjs right-clicks a link in the thread panel. That panel isn't virtualized, so it has no hold.
    • external-links.spec.mjs right-clicks a channel-timeline link. It has the same exposure but isn't known to flake, so it's unchanged.

Verification (local macOS, Playwright Chromium + WebKit; the repo has no Firefox project)

  • Fail-then-pass: in a scratch spec (not committed), a 1 px scrollTop nudge every frame kept the hold active. The right-click timed out with an empty menu in both engines; Shift+F10 opened the menu in both.
  • The fixed test with --repeat-each=40 passed 40/40 on WebKit and 40/40 on Chromium.
  • All of buzz-links.spec.mjs passed 9/9 on WebKit and 9/9 on Chromium.

Remaining gaps

  • Not yet run on hosted CI. A green run doesn't prove the flake is gone.
  • external-links.spec.mjs still has the same timeline right-click exposure.

🤖 Generated with Claude Code

"a message link's context menu opens its thread as a tab without leaving
the channel" flaked on WebKit CI (runs 40809436911, 40568494289,
40449417643) with an empty menu after `link.click({ button: "right" })`.
The first attempt met Virtua's 150 ms pointer-event hold, so the
channel timeline section intercepted it. Playwright's retry scrolled the
timeline 53 px, restarting the hold, and reported success because it
checks the hit target only on the press; the contextmenu event reached
the scroller and the link's trigger never ran.

The link's ContextMenuTrigger in MessageLink.tsx opens its menu on
Shift+F10 and the ContextMenu key, anchored to the link, and
MessageLink.test.tsx covers both keys. This journey is about the
composed menu, preview and tab owner, not hit testing, so focus the
link and press Shift+F10, as the activation journey earlier in the spec
already does with Enter.

Other right-clicks on message links:
- navigation-thread-history.spec.mjs right-clicks a link in the thread
  panel, which is not virtualized, so it has no hold and keeps the real
  pointer path for the link menu.
- external-links.spec.mjs right-clicks a channel-timeline link after
  end() without virtuaIdle and shares the exposure. It is not known to
  flake and is the remaining timeline pointer path, so it is unchanged.

Verification (local macOS, Playwright Chromium and WebKit; the repo
defines no Firefox project):
- With the hold kept active by a 1 px scrollTop nudge every frame
  (scratch spec, not committed), Shift+F10 opened the menu in both
  engines; the right-click timed out with an empty menu in both.
- The fixed test with --repeat-each=40: WebKit 40/40, Chromium 40/40.
- buzz-links.spec.mjs in full: WebKit 9/9, Chromium 9/9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e marked this pull request as ready for review October 29, 2026 04:51
@matt2e
matt2e requested a review from a team as a code owner October 29, 2026 04:52

@kazemek21 kazemek21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kyle reviewed the PR and the Nexus review-tracker notes and approved with no comments.

Posted by Codex (gpt-6.1-sol) on behalf of kylez

@matt2e
matt2e merged commit 4ad50be into main Oct 29, 2026
37 checks passed
@matt2e
matt2e deleted the flakey-test-fix branch October 29, 2026 06:13
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.

2 participants