Skip to content

fix(web): clicking the thread tab again closes its menu - #29133

Open
flamboh wants to merge 1 commit into
pingdotgg:maria/redesign/1-primitives-shellfrom
flamboh:t3/redesign-fix-tab-menu-toggle
Open

flamboh wants to merge 1 commit into
pingdotgg:maria/redesign/1-primitives-shellfrom
flamboh:t3/redesign-fix-tab-menu-toggle

Conversation

@flamboh

@flamboh flamboh commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Note

🤖 Claude Opus 5.5 on behalf of Oliver

Fix for the redesign stack, targets layer 1 (#28839).

Problem

On web, clicking the thread tab opens its menu. Clicking the tab again while the menu is open doesn't close it. The menu closes and then opens again right away, so it flashes. If the second click comes fast enough to count as a double-click, it starts the title edit instead.

The web menu is the DOM fallback for native context menus. It closes on any pointerdown outside itself, but the click from that same press still reaches the element underneath. When that element is the tab, its click handler opens the menu again.

Fix

A press outside the fallback menu now only closes it. The click, auxclick and dblclick from that press are swallowed, which matches native desktop menus and our Base UI menus. The next pointerdown or keydown turns the swallowing off, so later clicks work normally.

Behavior on the tab, on web:

  • Click opens the menu. Click again closes it, with no flash.
  • A double-click opens the menu on the first click and closes it on the second. It no longer starts a rename. Rename thread in the menu still renames.
  • Enter, Space and Escape on the tab work as before.

Desktop uses native menus, so nothing changes there, and double-click rename still works on desktop. The same rule covers every fallback menu on web: a click outside a right-click menu now only closes it, just like on desktop.

This code isn't new in the stack. The tab's click-to-open and the fallback's dismissal behave the same way on main, so the fix targets the lowest layer.

Before / after

Captured in the web browser at 1280×800, light theme, one project and one thread. Before uses layer 6 (maria/redesign/6-workspace-panes); after uses the same layer with 781a3082a0 merged onto it.

Before (layer 6) After
Click the tab again: menu flashes and reopens Click the tab again: menu closes
Double-click, 150 ms apart: title editing starts Double-click, 150 ms apart: menu closes without editing

The 150 ms double-click clips use simulated DOM pointer/click/dblclick events through the preview tool. The tool's native double-click runs about 28 ms apart and still starts title editing after this fix; that faster case is not covered by the passing clips.

Validation

  • New case in contextMenuFallback.keyboard.browser.test.ts: open from a button's click, click the button again, menu stays closed and doesn't reopen, a third click opens it. Fails on layer 1, passes here.

  • vp run check:changed origin/maria/redesign/1-primitives-shell: format, lint, knip, typecheck, tests and React compiler all pass.

  • Headless Chromium against a dev server, same script on both refs:

    Step Layer 1 This PR
    Second click (menu open) menu reopens menu closed
    Double-click, 150 ms apart rename starts menu opens then closes, no rename
    Enter / Escape / Space on tab open / close, focus back on tab / open same

Made with Claude Opus 5.5 in Claude Code.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 2, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 781a308

Macroscope's review found this PR approvable — The web context menu now consumes the click associated with outside-pointer dismissal, preventing immediate reopening. The effect is limited to transient menu interaction; native desktop menus and persistent state are unchanged.

You can add or adjust custom eligibility rules. Learn more.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant