Skip to content

fix(ui): keep desktop menus clickable over drag regions - #64050

Open
MasterZRC wants to merge 2 commits into
anomalyco:devfrom
MasterZRC:menu-clicks
Open

MasterZRC wants to merge 2 commits into
anomalyco:devfrom
MasterZRC:menu-clicks

Conversation

@MasterZRC

@MasterZRC MasterZRC commented Nov 15, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #63776

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Mark portaled menu surfaces as app-region: no-drag. Electron otherwise lets the session header's draggable area intercept clicks on overlapping Rename and Export items. The shared rule also covers submenus.

This bug fix needs no feature flag.

How did you verify your code works?

  • The new regression fails before the fix on the menu's computed app-region and passes 10/10 runs with five workers and zero retries. It checks overlap with the header and the menu's computed app-region: no-drag.
  • bun run check passes all 35 typecheck tasks, with existing lint warnings.
  • Full session-header suite passes 28/29. The existing Shift+F10 test also fails with the original menu CSS.
  • Standalone E2E typecheck has 188 existing diagnostics. Its output is identical before and after this change.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" role="img" aria-label="Session menu actions accept clicks over the draggable header">
  <style>
    .selection{animation:select 3s infinite}
    .cursor{animation:point 3s infinite}
    @keyframes select{0%,40%,100%{transform:translateY(0)}50%,90%{transform:translateY(23px)}}
    @keyframes point{0%,40%,100%{transform:translateY(0)}50%,90%{transform:translateY(23px)}20%,70%{opacity:.5}30%,80%{opacity:1}}
    @media(prefers-reduced-motion:reduce){.selection,.cursor{animation:none}}
  </style>
  <rect x="8" y="11" width="224" height="22" rx="4" fill="currentColor" opacity=".06"/>
  <path d="M16 22h36m139 0h32" stroke="currentColor" opacity=".2" stroke-dasharray="3 3"/>
  <rect x="65" y="7" width="113" height="58" rx="6" fill="none" stroke="currentColor" opacity=".3"/>
  <rect class="selection" x="69" y="12" width="105" height="22" rx="3" fill="currentColor" opacity=".15"/>
  <g fill="currentColor" font-family="system-ui,sans-serif" font-size="11">
    <text x="79" y="27">Rename</text><text x="79" y="50">Export…</text>
  </g>
  <path class="cursor" d="M150 21v16l4-5 6-1z" fill="currentColor"/>
</svg>

Screenshots / recordings

Verified with native coordinate clicks on macOS in an isolated Electron 41.0.3 window using the built desktop fixture and mocked API. Restoring the original computed app-region reproduces the blocked click. With this fix, Export opens the system Save dialog and Rename focuses the title. The repository pins Electron 44.9.1, which was unavailable locally.

Before, click intercepted After, Rename focused
Before After

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencodejr opencodejr Bot 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.

The one-line CSS fix looks right. menu-v2-content is the shared surface for menus, submenus and select dropdowns, so marking it app-region: no-drag removes it from Electron's drag region wherever it overlaps the session header's drag area. I couldn't check native window hit-testing in the desktop app (that needs Electron on macOS or Windows). In Playwright, the new test fails on the base at the menu's computed app-region (none) after confirming that the menu overlaps the header drag area. With this PR it passes. The full session-header.spec.ts suite also passes (29/29).

The public API is unchanged.

One point on the test, inline.

.toBe(true)
// Chromium's synthetic clicks bypass native window hit-testing, so also assert the exclusion Electron consumes.
await expect(menu).toHaveCSS("app-region", "no-drag")
await menu.getByRole("menuitem", { name: "Rename", exact: true }).click()

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.

As the comment above says, Playwright's clicks skip native window hit-testing. So the Rename and Export steps after the app-region assertion pass whether or not the fix is there; on the base the test only fails at the CSS check. Could you cut the test down to the overlap check plus toHaveCSS("app-region", "no-drag")? That keeps the regression check small and drops the download and rename steps, which can't catch this bug.

Keep the menu overlap check and the no-drag CSS assertion that catches the native hit-testing regression.

Rename behavior remains covered by the session-header context-menu cases. Export and its filename remain covered by the Home session context-menu case and sessionExportFilename tests.

@opencodejr opencodejr Bot 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.

My earlier point about the test is addressed: it now checks only that the menu overlaps the header drag area and that the menu's computed app-region is no-drag. It passes with the fix. In my last review, the same checks failed on the base. I still haven't checked real clicks in the desktop app (that needs Electron on macOS or Windows).

The public API is unchanged.

Nothing else to raise.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: Rename and Export items in session tab context menu are not clickable

1 participant