GeezerVison is showing github.com — desktop: submenu closes when the pointer moves to its last item · Issue #59613 · anomalyco/opencode
desktop: submenu closes when the pointer moves to its last item #59613DescriptionDescription
In the desktop app's titlebar menu, hovering a submenu and moving the pointer to its last item closes the submenu before the pointer reaches it.
This looks like a known submenu-hover/focus problem in similar menus in other apps as well. A fix could live in Kobalte, but doing it in OpenCode's menu wrapper avoids carrying a dependency patch.
Plugins
None
OpenCode version
2.1.4
Steps to reproduce
- Open OpenCode Desktop 2.1.4 on Windows.
- Open the titlebar menu and hover "File".
- Move the pointer down to "Close Window", the last item.
Expected: the "File" submenu stays open and "Close Window" highlights.
Actual: the submenu closes while the pointer crosses the other parent menu items.
Screenshot
submenu-close-grace-issue.mp4
Operating System
Windows 11
Terminal
No response Activityopencode-agent commented on Oct 27, 2026 Thanks for the clear report and the video. I was able to reproduce this.
I couldn't run the desktop app on Windows, so I used the app's Windows titlebar-menu test page in Chromium. It renders the same menu component.
- Open the titlebar menu and hover File until its submenu opens.
- Move the pointer in a straight line from File to the submenu's last item.
As the pointer passes over Edit and View, the File submenu closes and View's opens, so the last item is never reached. This happened with fast moves (~70 ms) as well as slow ones (~600 ms), so it isn't just the usual short hover delay running out. Moving toward an open submenu should keep it open.
It happens on 2.1.4 and still on the latest dev (8697644). The recording below shows it, and the Playwright script below reproduces it.
The closest related report is #56873, an open PR for a different menu hover/focus problem (hovering menu items takes focus away from search fields inside a menu). It doesn't cover this one.
recording.mp4

Reproduction script (submenu-hover.spec.ts)
import { expect, test } from "@playwright/test"
import { SERVER } from "../utils/app"
import { mockWorkspace } from "../utils/workspace"
test.use({ video: "on", viewport: { width: 1000, height: 700 } })
// #59613: moving diagonally from the "File" sub-trigger to the submenu's last item should keep File open.
test("File submenu stays open while the pointer moves to its last item", async ({ 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()
const file = page.getByRole("menuitem", { name: "File", exact: true })
const fb = (await file.boundingBox())!
await page.mouse.move(fb.x + fb.width / 2, fb.y + fb.height / 2, { steps: 5 })
const sub = page.locator(".desktop-app-menu-sub").first()
await expect(sub).toBeVisible()
const items = sub.getByRole("menuitem")
const names = await items.allInnerTexts()
console.log("File items:", JSON.stringify(names))
const last = items.last()
const lb = (await last.boundingBox())!
console.log("trigger", JSON.stringify(fb), "last", JSON.stringify(lb))
await page.waitForTimeout(300)
// Move like a person would: straight from the trigger to the target, ~16ms per step.
const from = { x: fb.x + fb.width / 2, y: fb.y + fb.height / 2 }
const to = { x: lb.x + 20, y: lb.y + lb.height / 2 }
const steps = Number(process.env.STEPS ?? 25)
const started = Date.now()
for (let i = 1; i <= steps; i++) {
const x = from.x + ((to.x - from.x) * i) / steps
const y = from.y + ((to.y - from.y) * i) / steps
await page.mouse.move(x, y)
if (process.env.QUIET) { await page.waitForTimeout(Number(process.env.STEP_MS ?? 16)); continue }
const hovered = await page.evaluate(([x, y]) => document.elementFromPoint(x, y)?.closest("[role=menuitem]")?.textContent, [x, y])
const subs = await page.locator("[data-component=menu-v2-content], [role=menu]").evaluateAll((els) => els.map((e) => (e.textContent ?? "").slice(0, 12)))
console.log(`step ${i} (${x.toFixed(0)},${y.toFixed(0)}) over=${hovered} menus=${JSON.stringify(subs)}`)
await page.waitForTimeout(16)
}
console.log("move took", Date.now() - started, "ms")
await page.waitForTimeout(500)
await page.screenshot({ path: "/workspace/repro/after-move.png" })
console.log("open submenus:", await page.locator(".desktop-app-menu-sub").evaluateAll((els) => els.map((e) => e.textContent?.slice(0, 40))))
await expect(last).toBeVisible()
await expect(last).toHaveAttribute("data-highlighted", "")
})
Run it: bun submenu-hover.spec.ts
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|