fix(mobile): make the phone header tab strip read as live tabs - #504
Merged
Merged
Conversation
On a phone every inactive tab rendered transparent: grey 11px text floating in unmarked gaps, a boxed Alt+N digit in each tab (a phone has no Alt key), names capped at 50px so a shared `w1-` prefix was most of what showed, and the tab that did not fit was chopped mid-word against the connection dot. The strip looked like a row of disabled labels. Phone block of mobile.css only: - Every header tab is a chip, filled and bordered from the skin's --control-* tokens, name in --text at weight 500. Written `:where(.header) .session-tab` so it stays at (0,1,0): the per-colour left border still wins, and sidebar layout (where the list leaves the header) is untouched. - The Alt+N digit is hidden in the header; inactive tabs drop their empty .tab-actions container, which padded the chip's right side. - Name cap 50px -> 80px, status dot 4px -> 6px, strip gap 2px -> 6px. - Scroll-driven edge fade: a mask on the strip whose widths follow its own inline scroll timeline (registered @Property lengths), so the clipped tab dissolves into the edge. No JS; a strip that does not overflow gets no mask, and browsers without scroll timelines keep the old hard edge. The tap-zone arithmetic comment is updated for the numberless phone tabs and the bigger dot (the required reserve drops from 38px to 36px; the 44px min-width stays). test/mobile-tab-strip-chips.test.ts pins the (0,1,0) selector, the top-level @Property registration and the timeline-after-shorthand order, each of which fails silently otherwise. test/mobile/tabs.test.ts follows the new name cap. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
On a phone, the session tab strip in the header looked switched off. Every inactive tab was transparent, so each one was grey 11px text floating in an unmarked gap, with nothing that reads as tappable. Each tab also carried a boxed Alt+N digit, a keyboard shortcut hint a phone can't use. Names were capped at 50px, so tabs sharing a
w1-prefix mostly showed the prefix (w1-inge…, or justw1-on the tab at the edge). And the tab that didn't fit was cut off mid-word, right against the connection dot.Captured at a 402px iPhone viewport with invented session names. The off-screen drawer shadow described under "Not in this PR" is hidden in these captures so it doesn't muddy the comparison.
What changed
Everything is in the phone block (
max-width: 599px) ofsrc/web/public/mobile.css. Tablets and desktop are unchanged.--control-bg-hover/--control-border-hovertokens, and the name is--textat weight 500. The light skins already repaint the header with--glass-bgand define their own control tokens, so they get matching chips without an override block. The active tab keeps its accent fill and border (those are!importantinstyles.css).:where(.header) .session-tab. As.header .session-tabit would tie with.session-tab[data-color="red"]instyles.cssand win on load order, which would wipe the colour stripe off colour-tagged tabs. Scoping to.headeralso leaves sidebar layout alone, because there the list moves out of the header..tab-actionscontainer, which was adding 4px to the right side of every chip.animation-timeline: scroll(self inline), with the widths registered via@property). At the start only the right edge fades, at the end only the left, and in between both. A strip that fits has an inactive timeline, so it gets no mask. Browsers without scroll timelines (Firefox today) skip the@supportsblock and keep the old hard edge.Tap targets
The active tab keeps its
min-width: 44pxlabel reserve, which is what stops a thumb aimed at the middle of the tab from landing on the gear icon. With every phone tab now numberless and the dot 2px wider, the reserve it actually needs drops from 38px to 36px, and the arithmetic in the comment is updated to match. Checked in Chromium at 360, 393, 402 and 430px: tapping the centre of an active tab namedw9hits the tab, not the gear or the close button.Testing
test/mobile-tab-strip-chips.test.ts(postcss, runs in the CI gate). It pins three ways this breaks with no visible error: the chip selector gaining specificity;@propertymoving inside the@mediablock, where it's invalid, so the fade stops interpolating; andanimation-timelinebeing declared before theanimationshorthand, which resets it. I broke each one on purpose and the test failed each time.test/mobile/tabs.test.tsnow expects the 80px cap. That suite isn't in the CI gate.npm run test:mobile -- test/mobile/tabs.test.tsgives 30/31 on this branch and the same 30/31 on master. The one failure ("switching tabs with the keyboard closed does not leave the terminal textarea focused") fails the same way on master.npm testpasses: 433 files, 8307 tests.--safe-area-topforced to 62px): the dark, og and four light skins; the home screen, an active session, and the strip scrolled to the middle and to the end. The per-colour left border still renders red, and the computed styles of sidebar-layout rows and of the 700px tablet strip are unchanged.Not in this PR
On the light skins a dark shadow runs down the right edge of the screen. It comes from the closed notification drawer (
#notifDrawer) and approvals drawer: both are parked just past the right edge of the viewport, and their leftwardbox-shadowbleeds into view. It has nothing to do with the tab strip and shows up on master too, so it's left for a separate fix.