Visitar URL original
site: reopening the download menus shows a clipped sliver instead of the full menu · Issue #63179 · anomalyco/opencode · GitHub
Skip to content

site: reopening the download menus shows a clipped sliver instead of the full menu #63179

Closed

Description

@YousefSaad47

Description

On https://opencode.ai/, reopening a menu after closing it shows a clipped sliver instead of the full menu — the "Download for Linux" chevron and "More mobile apps".

Steps to reproduce

  1. Open https://opencode.ai/
  2. Click the chevron to open the menu — it opens fully
  3. Click again to close it (or Escape / click outside)
  4. Click the chevron again — the menu comes back as a thin clipped sliver; only a page refresh fixes it

Reproduces on the production build, not on bun dev. Likely exposed by #63060 (home/product pages now static HTML). Reaching this state, the hidden menu is still :popover-open; when placeMenu() re-measures it, UA popover rules apply (inset 0, margin auto) and the popover never re-enters the top layer (:popover-open=false), so the carousel clips it.

OpenCode version

Not applicable (website bug).

Plugins

Not applicable (website bug).

Screenshot

Before/after screenshots are in opencodejr's reproducer comment above (live opencode.ai clipped sliver; local fixed build with full menu).

Operating System

Linux.

Terminal

Not applicable (website bug).

Activity

  1. opencodejr commented on Nov 10, 2026

    @opencodejr

    Thanks for the detailed report and the analysis. I could reproduce this.

    Using headless Chromium on https://opencode.ai/, I opened the chevron next to Download for Linux in the home page product carousel, closed it by clicking again, then opened it again. The first open shows the full menu. The second shows only a thin clipped strip beside the trigger, and the menu is no longer :popover-open. The screenshots below show the first open, the reopen on the live site, and the same reopen on a production build of the latest dev (95aa28e), so it still happens there. The script below reproduces it (node menu.mjs [url]).

    One detail in case it helps: while the menu is closed (hidden), it is still :popover-open. On reopen its offsetParent was a div, not null, so the cause may be the leftover popover state and inline styles rather than the offsetParent guard returning early.

    Your PR #63180 targets this issue; maintainers will review it.

    Screenshot

    Screenshot

    Screenshot

    Reproduction script (menu.mjs)
    // Reproduces #63179: a site dropdown reopened after closing is not placed again.
    // Usage: node menu.mjs [url]   (needs `playwright` with Chromium installed)
    import { chromium } from "playwright"
    
    const url = process.argv[2] ?? "https://opencode.ai/"
    const browser = await chromium.launch()
    const page = await browser.newPage({ viewport: { width: 1280, height: 900 } })
    await page.goto(url, { waitUntil: "networkidle" })
    
    const root = page.locator('[data-component="site-menu"]').filter({ has: page.locator('[data-slot="menu"]') }).first()
    const button = root.locator(":scope > button")
    const menu = root.locator('[data-slot="menu"]')
    await root.scrollIntoViewIfNeeded()
    console.log("trigger:", (await button.getAttribute("aria-label")) ?? (await button.innerText()))
    
    const state = () =>
      menu.evaluate((m) => {
        const r = m.getBoundingClientRect()
        return {
          hidden: m.hidden,
          popoverOpen: m.matches(":popover-open"),
          position: getComputedStyle(m).position,
          offsetParent: m.offsetParent ? m.offsetParent.tagName : null,
          height: Math.round(r.height),
          width: Math.round(r.width),
        }
      })
    
    await button.click()
    await page.waitForTimeout(500)
    console.log("1st open :", await state())
    await page.screenshot({ path: "/workspace/repro/first-open.png" })
    await button.click()
    await page.waitForTimeout(300)
    console.log("closed   :", await state())
    await button.click()
    await page.waitForTimeout(500)
    console.log("2nd open :", await state())
    await page.screenshot({ path: "/workspace/repro/second-open.png" })
    await browser.close()

    Run it: bun menu.mjs

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