Skip to content

fix(app): let touch users close a secondary panel tab (BM-67) - #2

Open
jonolee-kr wants to merge 3 commits into
mainfrom
bm-67-tab-close-touch
Open

fix(app): let touch users close a secondary panel tab (BM-67)#2
jonolee-kr wants to merge 3 commits into
mainfrom
bm-67-tab-close-touch

Conversation

@jonolee-kr

Copy link
Copy Markdown
Owner

Problem

The tab close button in the secondary panel reveals on hover. A touch user cannot hover, so a touch user could not close a tab.

A coarse-pointer fallback already existed, but every rule was gated behind the max-md: width variant, which only applies under 768px. A tablet, or a phone in landscape, is 768px or wider, so touch users there got nothing.

On an iPad at 810px the close button was not merely invisible — it was pointer-events: none, so it was unreachable even by a lucky tap.

Change

Remove the max-md: width gate from every coarse-pointer rule in tab-pill.tsx. The close button now reveals and sizes correctly on any coarse pointer at any viewport width.

max-md:pointer-coarse:opacity-100   ->  pointer-coarse:opacity-100
max-md:pointer-coarse:size-5        ->  pointer-coarse:size-5
max-md:pointer-coarse:h-9           ->  pointer-coarse:h-9

Zero max-md tokens remain in the file. This brings tablets to parity with the behaviour phones already ship. No pixel values changed.

Verification

Playwright with emulated touch, measuring computed style on the real component:

Device before after
Tablet 810px touch opacity 0, pointer-events: none, 16x16, pill 28px opacity 1, auto, 20x20, pill 36px
Phone 390px touch opacity 1, 20x20, pill 36px identical - no regression
Desktop 1280px mouse opacity 0, 16x16, pill 28px identical - no change

No console errors at any size. Tapping the X on the Diff tab at 810px removed Diff and left Browser active - it did not switch tabs.

Also verified:

  • 7/7 tab-pill tests, including a mutation proof that they fail when the gates are restored.
  • 355 tests across all three TabPill call sites.
  • Typecheck clean, lint 0 errors.
  • Desktop rendering proven unchanged two ways: a token-set diff whose non-coarse difference is empty, and a Tailwind 4.3.0 compile showing every changed utility emits only inside @media (pointer: coarse).

Only SecondaryPanelTabStrip passes a close action, and only for unpinned tabs. Pinned tabs keep their leading icon.

Known, pre-existing, not addressed here

  • The touch target is 20px; WCAG 2.2 SC 2.5.8 wants 24px. Phones already ship 20px, so this is not a new gap. Raising it would change phone behaviour.
  • COARSE_POINTER_TEXT_SM_CLASS keeps its own max-md gate, so a tablet shows 12px label text in a 36px pill vs 15px on a phone. That constant has 45 consumers, so it was left alone.

🤖 Generated with Claude Code

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.

1 participant