Skip to content

fix(app): prevent desktop titlebar submenus from stacking - #63289

Closed
Railgun-wiki wants to merge 4 commits into
anomalyco:devfrom
Railgun-wiki:titlebar-submenu-fix
Closed

Railgun-wiki wants to merge 4 commits into
anomalyco:devfrom
Railgun-wiki:titlebar-submenu-fix

Conversation

@Railgun-wiki

@Railgun-wiki Railgun-wiki commented Nov 11, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #63095

Type of change

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

What does this PR do?

Hovering across the desktop titlebar menu can leave several submenus open at once.

This change controls the open submenu within the titlebar menu. It delays switching while the pointer is moving across sibling items, so moving diagonally into a submenu remains possible. Keyboard and click selections cancel pending hover changes.

How did you verify your code works?

  • Ran the Windows menu Playwright regression tests, including sibling hover, diagonal movement, keyboard navigation, and pending hover interactions.
  • Ran bun run typecheck in packages/app.
  • Ran the titlebar unit tests.
  • Ran bun run check from the repository root: lint passed; the full check did not complete because drizzle-kit was missing and Turbo exited with SIGSEGV.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none">
  <style>
    @keyframes first { 0%,45% { opacity:1 } 50%,95% { opacity:0 } 100% { opacity:1 } }
    @keyframes second { 0%,45% { opacity:0 } 50%,95% { opacity:1 } 100% { opacity:0 } }
    .first { animation:first 3s step-end infinite }
    .second { opacity:0; animation:second 3s step-end infinite }
    @media (prefers-reduced-motion:reduce) {
      .first,.second { animation:none }
      .first { opacity:1 }
      .second { opacity:0 }
    }
  </style>
  <rect x="24" y="10" width="68" height="52" rx="5" stroke="currentColor" opacity=".25"/>
  <rect class="first" x="29" y="16" width="58" height="16" rx="3" fill="currentColor" opacity=".15"/>
  <rect class="second" x="29" y="38" width="58" height="16" rx="3" fill="currentColor" opacity=".15"/>
  <path d="M35 24h25M35 46h21" stroke="currentColor" stroke-width="3" stroke-linecap="round" opacity=".65"/>
  <g class="first">
    <rect x="98" y="13" width="100" height="38" rx="5" stroke="currentColor" opacity=".25"/>
    <path d="M106 23h49M106 32h62M106 41h38" stroke="currentColor" stroke-width="3" stroke-linecap="round" opacity=".55"/>
  </g>
  <g class="second">
    <rect x="98" y="25" width="100" height="38" rx="5" stroke="currentColor" opacity=".25"/>
    <path d="M106 35h45M106 44h57M106 53h33" stroke="currentColor" stroke-width="3" stroke-linecap="round" opacity=".55"/>
  </g>
</svg>

Screenshots / recordings

Before: Before

After: After

Checklist

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

Added by the opencode bot (AI-generated).

Related: #59613

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

This fixes the stacking: I ran the issue's reproduction in headless Chromium with the windows-menu.html fixture. On the base, hovering slowly or diagonally down File→Help left 5 submenus open. With this PR, at most one was open at every step. Moving from File's trigger down to its last item kept the submenu open, so #59613 doesn't come back. The other Windows menu tests in tabs.spec.ts and tsc -b pass.

Public API: unchanged.

Two things need work before this is ready:

  1. The new test "discards a pending hover after explicit selection" is flaky. It failed in 2 of 3 runs for me: the View submenu opened with the keyboard was closed again by the next check (line 1816). In one of three runs of the slow hover check, hovering Help also left no submenu open at all. Both suggest that Kobalte's own hover/close handling and the new pending-timer state can still get out of sync (see the inline comment).
  2. The new tests are large and timing-heavy (about 155 lines). They use page.clock fast-forwards tied to the 150 ms delay, hand-computed pointer paths and Kobalte internals ("ignores a Kobalte hover request"). The e2e guide asks for deterministic tests of user-visible behaviour. A sibling-hover test (one submenu open at a time) and one diagonal-move test would cover the fix. Please drop or simplify the rest.

Related: #59613

Before

After

@Railgun-wiki
Railgun-wiki marked this pull request as draft November 11, 2026 09:53
@Railgun-wiki
Railgun-wiki marked this pull request as ready for review November 11, 2026 10:25

@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 new commits address both earlier points: the open state is down to one signal plus the settle timer, and the flaky timer-heavy tests are gone. I re-ran the issue's reproduction in headless Chromium with the windows-menu.html fixture. Hovering slowly or diagonally down File→Help never leaves more than one submenu open, and the base still stacks five. Moving from File to its last item keeps the submenu open, so #59613 doesn't come back. Hovering a parent after a keyboard selection still opens its submenu. The Windows menu tests in tabs.spec.ts passed 3 times each, and tsc -b passes.

Public API: unchanged.

No further concerns.

Before

After

@Railgun-wiki Railgun-wiki mentioned this pull request Nov 11, 2026
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@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 new commit only merges dev; this PR's changes to windows-menu.tsx and tabs.spec.ts are unchanged, and nothing merged from dev touches the menu components or the Kobalte version. I re-ran the issue's reproduction on the new head in headless Chromium: never more than one submenu open, the submenu stays open while moving to its last item, and the Windows titlebar menu tests and tsc -b pass.

Public API: unchanged.

No further concerns.

@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 new commit only merges dev; this PR's changes are unchanged, and nothing merged touches the titlebar menu, the shared menu components or the Kobalte version. I re-ran the issue's reproduction on the new head in headless Chromium: never more than one submenu open, the submenu stays open while moving to its last item, and the Windows titlebar menu tests and tsc -b pass.

Public API: unchanged.

No further concerns.

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: Menu bug

1 participant