Skip to content

desktop: clicking compressed session tabs doesn't switch when many tabs are open #61396

Open

Description

@yushui2022

Summary

On the desktop app's new UI layout with top horizontal session tabs, once enough tabs are open that the tab bar overflows, each tab is compressed down to a ~28px icon-only chip. The tabs become visually unusable and clicking a tab no longer switches to its session — I can click but nothing happens (no accidental closing, no switch). This makes the tab bar unusable the moment it overflows.

This is distinct from the "close button misclick / accidentally closes a tab" complaints (#50196, #52044): here the tab is not being closed, it's just not selecting when clicked.

Environment

  • opencode version: 2.2.2 (OpenCode.app / desktop client ai.opencode.desktop)
  • OS: macOS 27.2.0 (arm64, Apple Silicon)
  • Terminal: N/A (desktop client, not the TUI)
  • Shell: /bin/zsh
  • Install/channel: Desktop client, latest stable build
  • Active plugins: None found in config

Reproduction

  1. Launch OpenCode Desktop and enable the new UI layout (settings that puts session tabs in the top title-bar tab strip).
  2. Open / create enough sessions that the top tab bar overflows the window width (roughly 8–10+ tabs).
  3. The tab bar stops fitting and each remaining tab shrinks to an icon-only chip.
  4. Click one of the compressed (non-active) tabs to switch to it.

Expected Behavior

Clicking a tab selects/switches to that session. When tabs don't all fit, a browser-like behavior: tabs keep a usable minimum width and the strip scrolls horizontally so every tab stays clickable.

Actual Behavior

  • Tabs shrink to ~28px icon-only chips; their titles are hidden (only a 16px project avatar / status dot shows).
  • Clicking a compressed tab does not switch to it — the click registers but the active session does not change ("点不动").
  • There is no reliable way to reach or select the overflowed tabs: the strip has no horizontal scroll and no wheel-to-scroll-x, so on a standard (non-trackpoint/vertical-scroll) mouse the far tabs can't be reached.
  • The close button overlaps the tab's click region (it's centered on very narrow tabs and present-but-transparent on 45–64px tabs), which compounds the "click does nothing useful" feel. (This is a secondary effect, not accidental closing.)

Suspects in the current source (for maintainers)

Working from the dev branch checkout of packages/app:

  • Tabs are allowed to shrink to a tiny icon size. tab-strip.tsx (SessionTabSlot/DraftTabSlot, ~line 75 & 364): class="... w-56 min-w-7 max-w-56 flex-shrink" — min-w-7 is 28px, so with overflow each tab collapses to a 28px chip. tab-nav.css then hides the title and centers the close button in the @container (44px < width <= 64px) / @container (max-width: 44px) ranges.
  • No horizontal scrolling of the title-bar strip. The strip is overflow-x-auto with no-scrollbar (tab-strip.tsx, TitlebarTabStrip), but unlike the side-region strip there is no wheel→scrollLeft handler wired on the title-bar tab strip (cf. runtime/plugin/tab-strip-scroll.ts, which the side panel uses). So an overflowing strip can't be scrolled on a vertical-mouse.
  • Close button intercepts the click. tab-nav.css: for <=44px tabs the close container is display:none for inactive tabs but present/centered for the active tab, and for 45–64px it is opacity:0 (still hit-testable). tab-nav.tsx navigates on mousedown of the tab link; when a transparent/centered control overlaps that region, the click doesn't reach the link.

Additional Context

Reproduced on Desktop 2.2.2. Frequency: consistent whenever the top tab bar overflows. Workaround that works: switch to vertical / side tabs (Settings → Appearance → Tabs), or use the "Search sessions" / ⌃⇧⌘T commands, or shrink the tab count.

Related reports (the misclick / close-button framing, not the no-select framing of this one):

Activity

  1. yushui2022 commented on Nov 3, 2026

    @yushui2022
    Author

    I'll take this on and work on a fix.

    Planned approach:

    • Keep horizontal tabs at a usable minimum width instead of shrinking to ~28px icon chips, and let the strip scroll horizontally when they don't fit.
    • Add wheel -> horizontal scroll on the title-bar tab strip (same idea as runtime/plugin/tab-strip-scroll.ts used by the side panels).
    • Ensure the close control no longer overlaps the tab link's click-to-switch region.
    • Add/keep an e2e regression case for selecting a compressed/overflowing tab.

    Will target dev and open a PR that references this issue.

  2. yushui2022 commented on Nov 3, 2026

    @yushui2022
    Author

    Could a maintainer assign this to @yushui2022? I tried to self-assign, but my account does not have write access to this repository (GitHub requires admin/write to set assignees), so I could only claim it here in the comments. Thanks!

  3. opencodejr commented on Nov 3, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report, @yushui2022. I couldn't try this here: it happens in the desktop app's top tab strip, and the sandbox I reproduce issues in can't run the desktop app or a browser. A maintainer with the desktop app will need to check it.

    From the code, a left-click on a compressed tab is meant to switch sessions as soon as the button is pressed, and the close button is hidden on narrow inactive tabs. So a click that does nothing doesn't look like intended behaviour. Some details that would help whoever picks this up:

    • Does it happen on every compressed tab or only some, for example ones near the edge of the strip?
    • Does it still happen if you click very briefly without moving the mouse? This is to rule out the press being taken as a tab drag.
    • A short screen recording, if you can make one.

    The missing horizontal scrolling and the very narrow minimum tab width are already covered by #50196. Related, most likely first:

  4. ryan-noel-2258 commented on Nov 6, 2026

    @ryan-noel-2258

    Looking at this in tab-nav.tsx — the 45–64px case has the close button at opacity:0 but still hit-testable, which is why a click on what looks like the icon actually closes the tab. The narrower case (≤44px) hides the close on inactive tabs, so the "click doesn't switch" there is a separate problem (no horizontal scroll on the strip).

    Happy to send a narrow PR for just the close-overlap half, Chrome-style: on an inactive tab, clicking the X calls onNavigate instead of onClose. First click activates, second closes. Doesn't touch styling or layout, doesn't change the active-tab behavior, doesn't fix the scroll problem.

    Any objection to that approach before I write it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions