Skip to content

desktop: Menu bug #63095

Closed
Closed

Description

@modern-diz

Description

Image

Environment

  • Version 2.2.7
  • Ubuntu 26.10

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot

No response

Operating System

No response

Terminal

No response

Activity

  1. opencodejr commented on Nov 10, 2026

    @opencodejr
    Contributor

    Thanks for the report and the screenshot. I could reproduce this.

    I opened the titlebar menu and hovered File → Edit → View → Go → Window → Help from top to bottom, pausing briefly on each item. The earlier submenus never close, so five of them end up stacked on top of each other, as in your screenshot. Moving the pointer slowly or diagonally toward each submenu triggers it. Jumping quickly between items doesn't.

    This happens on 2.2.7 and still happens on the latest dev (98e4b53). I ran the app's own menu code in a headless browser rather than the Electron desktop app; the screenshot below shows the result and the script below reproduces it.

    Related: #59613 is about the opposite problem, a submenu closing too early, and its open fix #59625 changes the same menu code.

    Screenshot

    Reproduction script (menu-stack.spec.ts)
    // Run from a checkout of anomalyco/opencode: copy to packages/app/e2e/regression/menu-stack.spec.ts, then
    //   cd packages/app && bunx playwright install chromium && bunx playwright test e2e/regression/menu-stack.spec.ts --project chromium --workers 1
    import { expect, test, type Page } from "@playwright/test"
    import { SERVER } from "../utils/app"
    import { mockWorkspace } from "../utils/workspace"
    
    // #63095: hovering through the titlebar menu's parent items should leave at most one submenu open.
    const PARENTS = ["File", "Edit", "View", "Go", "Window", "Help"]
    
    async function openMenu(page: Page) {
      await mockWorkspace(page, { name: "WindowsMenu", sessions: [] })
      await page.goto(`/e2e/utils/windows-menu.html?${new URLSearchParams({ server: SERVER })}`)
      await page.getByRole("button", { name: "OpenCode menu", exact: true }).click()
    }
    
    async function openSubmenus(page: Page) {
      return page.locator('[role="menu"].desktop-app-menu-sub').count()
    }
    
    for (const mode of ["slow", "fast", "diagonal"] as const) {
      test(`hover down the parent items (${mode}) leaves one submenu open`, async ({ page }) => {
        await openMenu(page)
        const counts: number[] = []
        for (const name of PARENTS) {
          const box = (await page.getByRole("menuitem", { name, exact: true }).boundingBox())!
          const x = box.x + box.width / 2
          const y = box.y + box.height / 2
          await page.mouse.move(x, y, { steps: mode === "fast" ? 1 : 8 })
          if (mode === "diagonal") {
            // Head toward the open submenu, then come back to the next parent.
            await page.mouse.move(box.x + box.width + 20, y + 15, { steps: 5 })
          }
          if (mode !== "fast") await page.waitForTimeout(400)
          counts.push(await openSubmenus(page))
        }
        await page.waitForTimeout(600)
        const final = await openSubmenus(page)
        await page.screenshot({ path: `test-results/menu-${mode}.png` })
        console.log(mode, "submenus open after each hover:", counts, "final:", final)
        expect(final).toBeLessThanOrEqual(1)
      })
    }

    Run it: bun menu-stack.spec.ts

  2. Railgun-wiki commented on Nov 11, 2026

    @Railgun-wiki

    Hi! I've been looking into this and opened #63289 with a fix. Sorry I didn't comment here before starting.

    The issue seems to happen when moving slowly between the titlebar menu items: a previously opened submenu stays open while the next one opens. The PR keeps track of the active submenu in the titlebar menu itself, so only one stays open at a time.

    I also checked the diagonal movement case from #59613, where a submenu can close too early while moving toward its last item. That path still works with the fix.

    If nobody else is working on this, could you assign the issue to me? I'm happy to adjust the PR based on feedback.

  3. DerDjamel commented on Nov 12, 2026

    @DerDjamel

    Also reproducible on Linux, so this is not Windows-specific.

    Verified on the real OpenCode Desktop 2.2.7 app (AppImage) on Omarchy / Linux 7.2.15-1-omarchy, Hyprland on Wayland. I drove the running renderer with DevTools pointer input rather than a mock page.

    Steps:

    1. Click the hamburger button in the titlebar.
    2. Hover File until its submenu opens.
    3. Move the pointer to Edit and wait about 2 seconds.
    4. Move the pointer away from the menu entirely (for example to the middle of the editor).

    Expected: moving to another top-level item switches the open submenu, and moving away closes it.

    Actual: the File submenu stays visible and its trigger stays expanded the whole time. Hovering Edit does not close File or open Edit. Only Escape or a click outside the menu dismisses the stuck submenu.

    This matches the stacked-submenu screenshot above, so the fix in #63289 should cover it.

  4. marked Faulty Menu Modals #63624 as a duplicate of this issue on Nov 12, 2026
  5. linkwith-yasin commented on Nov 13, 2026

    @linkwith-yasin

    Has been occurring in my app too - v2.3.0 (win11 pro).

    20261113-0927-38.0599169.mp4
  6. 10 remaining items

  7. beatnbite commented on Nov 16, 2026

    @beatnbite

    Which OpenCode Desktop version does include the fix? The submenu stacking bug still occurs in my OpenCode Desktop 2.3.0 on Windows 11.

    Environment:

    Steps to reproduce:

    1. Open the hamburger menu.
    2. Hover over “File”.
    3. Slowly hover over “Edit”, “View”, and “Go”.
    4. Previously opened submenus remain visible and overlap.
  8. neriousy commented on Nov 16, 2026

    @neriousy
    Member

    2.3.1 will have the fix, not released yet @beatnbite

  9. marked Overlay of menu options #64421 as a duplicate of this issue on Nov 17, 2026
  10. marked Menu Overlap #64531 as a duplicate of this issue on Nov 17, 2026
  11. marked List Menu #65363 as a duplicate of this issue on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions