Skip to content

fix(app): compact inactive session tabs drop the close hit target (#2016) - #2185

Open
jacktrnr wants to merge 1 commit into
mainfrom
fix/2016-tab-close-target
Open

jacktrnr wants to merge 1 commit into
mainfrom
fix/2016-tab-close-target

Conversation

@jacktrnr

Copy link
Copy Markdown
Contributor

Closes #2016

Problem

With many session tabs open, clicking a narrow tab to select it often closed it.

Root cause

Each tab slot is w-56 min-w-7 flex-shrink, so with many tabs open the tabs shrink toward 28px. At or below 64px, the compact @container layout in titlebar-tab-nav.css hides the title and centers the 20px close button. hover-reveal only sets the button's opacity to 0, so the button is still a live hit target. A centered 20px target in a 16–52px content box covers most of the tab, or all of it.

Fix

This is a minimal change on main's current tab strip. It does not build on the parked #2161.

  • In the compact layout, inactive tabs hide the close button (display: none), so a click anywhere on the tab selects it. This follows the browser convention for crowded tab strips. The active tab keeps its close button. Middle-click still closes any tab, and so does the close-tab command.
  • I added aria-label="Close tab" to the session tab's icon-only close button. The draft tab already had one, and the design system requires it.

No new tokens, colors, spacing, or radius values. Wide tabs are unchanged.

Tests

  • New titlebar-tab-close-target.test.ts (source/CSS structure assertions, the repo's existing pattern for layout rules happy-dom can't evaluate):

    • the compact container block hides [data-slot="tab-close"] on non-active tabs;
    • wide tabs keep the 20px corner slot;
    • middle-click still closes a tab;
    • both close buttons carry an aria-label.

    Two of these cases failed before the fix, and all pass after.

  • bun test --conditions=solid --preload ./happydom.ts src/components/titlebar (materialized tree): 73 pass, 0 fail.

  • Hit-testing in headless Chrome (elementFromPoint at the tab center) with the real CSS:

    28px inactive 28px active 60px inactive 200px center 200px right corner
    before close close close link close
    after link close link link close
  • refresh_manifest.mjs was run, and drift_gate.mjs PASSES.

Manual check

Open about 15 session tabs so they compact. Clicking any inactive tab should select it and never close it. The active tab still shows its close button. Middle-click closes any tab. Check this in both light and dark themes; no colors changed.

🤖 Generated with Claude Code

)

With many tabs open each tab shrinks toward its 28px floor. At <= 64px
the compact layout centers the 20px close button, and hover-reveal only
makes it transparent, so it stays a live hit target covering nearly the
whole tab: clicking to select a tab closed it.

Inactive compact tabs now hide the close button (the browser convention),
so a click anywhere selects the tab. The active tab keeps it, and
middle-click still closes any tab. Also label the session tab close
button (the draft tab's already was).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e6c321b-62a4-465f-8690-43f16ec42a9f
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@jacktrnr
jacktrnr marked this pull request as ready for review November 23, 2026 22:23
@jacktrnr

Copy link
Copy Markdown
Contributor Author

Verified hands-on in the combined 0.4.1-beta test build (test/0.4.1-beta, Developer Tools → Rebuild Locally, macOS arm64) on 2026-11-23: all checks in this PR's manual checklist pass.

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.

BUG: Tab close button hit target too large when many session tabs are open

1 participant