Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(tabbar): show the project name whole, and give the bar its 40px back

enes8a3c140dc4fe
diff --git a/CLAUDE.md b/CLAUDE.md
index 51624537f..277b92f9e 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -4030,22 +4030,32 @@ the Settings section and ShortcutsPanel start disagreeing about what a chord mea
top corners and two concave flares (`.tab.active::after`, radial gradients) so it merges into the
surface below — which is also the kanban overlay's colour, so it merges under both views. In
LIGHT the strip steps back to `--surface-deep` (`--tabbar-bg`), because `--panel` and
- `--canvas-bg` are one value apart there and a canvas-coloured tab would vanish. Tabs share one
- flex basis (`--tab-w`, the active one wider by its board toggle so its name shrinks in step) and
- shrink together; the name is `flex: 1 1 0; width: 0; min-width: var(--tab-name-min)` under a mask
- fade (never an ellipsis), and `width: 0` is what keeps a tab's automatic minimum at its fixed
- parts instead of the whole label. **The name has priority as tabs shrink** (the #789 regression:
- at 8 tabs / 1340px the ACTIVE name was 24px — 0 characters — because it carried the most
- furniture and hit its floor first; at 12 every name was). `renderer/lib/tabDensity.ts` derives a
- per-strip level from the measured strip width ÷ tab count (TabBar stamps it as `data-density`):
- `compact` hides the SSH chip, `tight` makes the inactive caret hover-only (kept while its menu is
- open, `tab--menu-open`); the active tab keeps both buttons at every level, and the 60px name floor
- is the one place the strip decides to scroll instead of squeezing. Thresholds are derived from
- the measured furniture, not chosen — change a padding and update the constants. **The bar's height is ONE number in two places that cannot read each
+ `--canvas-bg` are one value apart there and a canvas-coloured tab would vanish.
+ **A tab is as wide as its own NAME and never shrinks** (`max-width: var(--tab-max)` 260px,
+ `flex: 0 0 auto`; the name is `flex: 0 1 auto; min-width: 0` with `text-overflow: ellipsis`): the
+ strip SCROLLS when the tabs stop fitting, and nothing shortens a name except that cap. This is
+ the deliberate departure from Chrome, which shrinks because it must keep every tab reachable
+ without scrolling — here the sessions sidebar and ⌘1..9 both reach a project without touching
+ the strip, so a readable name is worth more than a visible tab edge.
+ **Two earlier rounds tried to ration the name between tabs and both spent the one thing the strip
+ is for**, which is why the third does not: #789 gave every tab one flex basis (at 8 tabs / 1340px
+ the ACTIVE name measured 24px — zero characters — because it carried the most furniture and hit
+ its floor first), and #790 added a 60px floor plus a `tabDensity` level that shed furniture to
+ pay for it — whose middle level hid the SSH chip, and 8 tabs in a 1340px window land on exactly
+ that level, so every remote tab lost its `SSH` label at the width people work at.
+ **`renderer/lib/tabDensity.ts` is deleted**: with full names there is no name budget to protect,
+ so there is nothing for a density level to buy. Do not reintroduce one without first saying what
+ it is buying. Measured on the third shape (headless Chrome, the real CSS, 86px traffic-light
+ reservation): 8 tabs in 1340px — every name whole, every SSH chip present, the strip 14px past
+ its width; 12 tabs — every name still whole, the strip scrolling 559px; a 60-character project
+ name stops at the 260px cap and is the only thing that ellipsises.
+ The fade mask went with the shrinking: a mask gradient is unconditional and would fade the tail
+ of a name that fits perfectly, while `text-overflow` is self-conditioning. **The bar's height is ONE number in two places that cannot read each
other**: `--tabbar-h` in styles.css (every top-anchored panel, the kanban overlay and the usage
popover position against it) and `TABBAR_HEIGHT_PX` in `@shared/window-chrome-metrics`, from
which main derives the traffic-light `y` (`trafficLightY`) — a literal 15 for a 44px bar was
- what made shrinking the bar hazardous. `styles.tabbar.test.ts` pins the token to the constant and
+ what made shrinking the bar hazardous. It is **40px** (36 for one release, which read as cramped
+ once the tabs carried whole names). `styles.tabbar.test.ts` pins the token to the constant and
every dependant to the token. The New-project `+` is a **sibling** of `.tabbar__tabs`, not its last child — inside
the scroller it vanished once the strip overflowed (no visible scrollbar to hint it was
still there). The wrapping `.tabbar__projects` is `flex: 1` and stays a drag region (not
diff --git a/src/renderer/components/TabBar.test.tsx b/src/renderer/components/TabBar.test.tsx
index 2d8650b55..ebfb83b34 100644
--- a/src/renderer/components/TabBar.test.tsx
+++ b/src/renderer/components/TabBar.test.tsx
@@ -337,61 +337,3 @@ describe('TabBar options button', () => {
})
})
-describe('TabBar density', () => {
- let root: Root
- let host: HTMLElement
-
- // jsdom lays nothing out (`clientWidth` is 0), so the observer's measurement cannot be driven
- // here; what CAN be pinned is the contract the stylesheet reads: the strip carries a density
- // attribute, it starts at `roomy` (the pre-density rendering), and the tab whose menu is open
- // is marked so a tight strip keeps its caret on screen.
- beforeEach(async () => {
- const { TabBar, useProjects } = await load()
- host = document.createElement('div')
- document.body.appendChild(host)
- useProjects.setState({
- projects: [project(), project({ id: 'p2', name: 'Beta' })],
- activeProjectId: 'p1'
- })
- root = createRoot(host)
- await act(async () => {
- root.render(
- <TabBar
- onSwitch={vi.fn()}
- onReconnect={vi.fn()}
- onReorder={vi.fn()}
- onOpenWelcome={vi.fn()}
- onRename={vi.fn()}
- onSetFolder={vi.fn()}
- onCloseProject={vi.fn()}
- onRemoteAccess={vi.fn()}
- onSetDefaultAccount={vi.fn()}
- onSetDefaultPermissionMode={vi.fn()}
- onOpenProjectSettings={vi.fn()}
- />
- )
- })
- })
-
- afterEach(() => {
- act(() => root.unmount())
- host.remove()
- })
-
- it('stamps the strip with a density the stylesheet can read, roomy until measured', () => {
- // jsdom reports a 0px strip, which the rule reads as "tight"; either way the attribute is one
- // of the three levels and present from the first render.
- const strip = host.querySelector('.tabbar__tabs')!
- expect(['roomy', 'compact', 'tight']).toContain(strip.getAttribute('data-density'))
- })
-
- it('marks the tab whose menu is open, so a tight strip does not hide the caret under its own menu', async () => {
- const carets = host.querySelectorAll<HTMLButtonElement>('.tab__caret')
- await click(carets[1])
- const tabs = host.querySelectorAll('.tab')
- expect(tabs[1].classList.contains('tab--menu-open')).toBe(true)
- expect(tabs[0].classList.contains('tab--menu-open')).toBe(false)
- await click(carets[1])
- expect(tabs[1].classList.contains('tab--menu-open')).toBe(false)
- })
-})
diff --git a/src/renderer/components/TabBar.tsx b/src/renderer/components/TabBar.tsx
index f44a1c364..e11f38e6e 100644
--- a/src/renderer/components/TabBar.tsx
+++ b/src/renderer/components/TabBar.tsx
@@ -12,7 +12,6 @@ import { sessionCount, sessionForProject, useProjectSession } from '../session/s
import { tabClickAction } from '../session/relay-tab'
import { useMenuFlip } from '../ui/useMenuFlip'
import { commandTooltip } from '../lib/keybindingOverrides'
-import { tabDensity, type TabDensity } from '../lib/tabDensity'
import { IconCanvasView, IconKanban, IconMoreVertical, IconPlus } from './icons'
import { ProjectGlyph } from './ProjectGlyph'
import {
@@ -213,26 +212,6 @@ export function TabBar({
?.scrollIntoView({ behavior: 'smooth', inline: 'nearest', block: 'nearest' })
}, [activeId, projects.length])
- // How much furniture a tab may carry at the width the strip can give it (see lib/tabDensity):
- // measured on the strip itself and stamped on it as `data-density`, so the stylesheet sheds the
- // SSH chip, then the inactive caret, BEFORE the name is squeezed. The strip is content-sized, so
- // its clientWidth is the tabs' full width while they fit and the available width once they
- // shrink — either way the per-tab share the rule wants. Its padding is the flares' room.
- const [density, setDensity] = useState<TabDensity>('roomy')
- const tabCount = projects.length
- useEffect(() => {
- const el = tabsRef.current
- if (!el || typeof ResizeObserver === 'undefined') return
- const measure = (): void => {
- const cs = getComputedStyle(el)
- const inner = el.clientWidth - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight)
- setDensity(tabDensity(Number.isFinite(inner) ? inner : null, tabCount))
- }
- measure()
- const ro = new ResizeObserver(measure)
- ro.observe(el)
- return () => ro.disconnect()
- }, [tabCount])
// The backdrop deliberately sits BELOW the bar, so a click on another tab switches to it in one
// go instead of being swallowed as a dismiss — which leaves the bar itself (its empty stretch,
@@ -298,7 +277,6 @@ export function TabBar({
>
<div
className="tabbar__tabs"
- data-density={density}
ref={tabsRef}
onWheel={(e) => {
// Translate a vertical mouse wheel into horizontal strip scrolling (trackpads
diff --git a/src/renderer/lib/tabDensity.test.ts b/src/renderer/lib/tabDensity.test.ts
deleted file mode 100644
index b1b88f07c..000000000
--- a/src/renderer/lib/tabDensity.test.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { readFileSync } from 'node:fs'
-import { join } from 'node:path'
-import {
- COMPACT_MIN_TAB_PX,
- ROOMY_MIN_TAB_PX,
- TAB_BASE_FURNITURE_PX,
- TAB_CARET_PX,
- TAB_NAME_MIN_PX,
- TAB_SSH_CHIP_PX,
- tabDensity
-} from './tabDensity'
-
-describe('tabDensity', () => {
- // The strip inner width a 1340px macOS window leaves 8 tabs, measured before the fix: 1114 minus
- // 16px of flare padding. Every number below is from that run or derived from its furniture.
- const STRIP_1340_MAC = 1114 - 16
-
- it('answers roomy until measured', () => {
- expect(tabDensity(null, 8)).toBe('roomy')
- expect(tabDensity(Number.NaN, 8)).toBe('roomy')
- expect(tabDensity(1000, 0)).toBe('roomy')
- })
-
- it('keeps everything while a tab can hold chip + caret + a readable name', () => {
- expect(ROOMY_MIN_TAB_PX).toBe(TAB_BASE_FURNITURE_PX + TAB_SSH_CHIP_PX + TAB_CARET_PX + TAB_NAME_MIN_PX)
- expect(tabDensity(ROOMY_MIN_TAB_PX * 4, 4)).toBe('roomy')
- // 4 projects at their 168px basis: what a typical window shows.
- expect(tabDensity(168 * 4, 4)).toBe('roomy')
- })
-
- it('defers the CARET first, so the field report at 8 tabs in 1340px KEEPS its SSH chips', () => {
- // 1098 / 8 = 137px per tab — enough for the chip + 60px of name, not for the caret as well.
- // Reported from the running app after the first version shed the chip here instead: the `SSH`
- // label went missing from every remote tab at the width people actually work at.
- expect(tabDensity(STRIP_1340_MAC, 8)).toBe('compact')
- expect(COMPACT_MIN_TAB_PX).toBe(TAB_BASE_FURNITURE_PX + TAB_SSH_CHIP_PX + TAB_NAME_MIN_PX)
- expect(STRIP_1340_MAC / 8).toBeGreaterThanOrEqual(COMPACT_MIN_TAB_PX)
- })
-
- it('hides the SSH chip only when the chip itself would squeeze the name', () => {
- // 1098 / 12 = 91.5px per tab: below the chip floor, above the bare floor.
- expect(tabDensity(STRIP_1340_MAC, 12)).toBe('tight')
- expect(tabDensity(COMPACT_MIN_TAB_PX * 12 - 12, 12)).toBe('tight')
- expect(tabDensity(COMPACT_MIN_TAB_PX * 12, 12)).toBe('compact')
- })
-
- it('the caret is deferred, never removed — it returns on hover at every level', () => {
- // A pin on the CSS, because the whole trade rests on it: the caret is one hover away, the
- // chip (at `tight`) is not on the tab at all. Both selectors must keep the hover escape.
- const css = readFileSync(join(__dirname, '../styles.css'), 'utf8').replace(/\r\n/g, '\n')
- for (const level of ['compact', 'tight']) {
- expect(css).toContain(
- `.tabbar__tabs[data-density='${level}'] .tab:not(.active):not(:hover):not(.tab--menu-open) .tab__actions`
- )
- }
- })
-
- it('never lets the name floor fall below the width of a short word', () => {
- // Below this the fade zone (18px) eats most of what is left; 24px was the reported bug.
- expect(TAB_NAME_MIN_PX).toBeGreaterThanOrEqual(56)
- })
-})
diff --git a/src/renderer/lib/tabDensity.ts b/src/renderer/lib/tabDensity.ts
deleted file mode 100644
index 24a825f9f..000000000
--- a/src/renderer/lib/tabDensity.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * How much furniture a project tab may carry at the width the strip can give it.
- *
- * MEASURED, 8 projects in a 1340px macOS window (86px traffic-light reservation), on the first
- * Chrome-style strip: every tab got ~137px, and the pieces of an INACTIVE tab were
- *
- * padding 10+4 · colour dot 9 · gap 6 · [SSH chip 30 · gap 6] · [badge 17 · gap 6] · caret 22+2
- *
- * so a plain tab kept 77px of name (9 readable characters), an SSH tab 41px (2–5), and the ACTIVE
- * tab — the one the user most needs to read — 24px (0 characters): it carries the board toggle as
- * well, hit its floor first, and the name absorbed the loss. At 12 tabs everything sat on the 83px
- * floor and every name was 24px. The name has to be the thing that survives, so this decides, per
- * strip, which furniture to shed BEFORE the name is squeezed — and the strip only starts scrolling
- * once a tab cannot hold `TAB_NAME_MIN_PX` of name with the furniture that is left.
- *
- * Three levels, each dropping one thing, cheapest first:
- * roomy — everything shown.
- * compact — the options caret on INACTIVE tabs shows only on hover (and while its menu is open);
- * the active tab keeps both its buttons at every width.
- * tight — the SSH chip is hidden too (the tab's tooltip still carries user@host).
- *
- * The CARET goes before the CHIP, which is the opposite of the first version of this file and was
- * a field correction: at 8 tabs / 1340px the strip lands on the middle level, so shedding the chip
- * there took the `SSH` label off every remote tab in the common case. The chip is IDENTITY — which
- * of two same-named projects is the one on the server — while the caret is an ACTION that is one
- * hover away at every level (and a hover is how Chrome treats its own close button at this width).
- * Losing a label you read costs more than deferring a control you click.
- *
- * One rule for the whole strip rather than per tab, so neighbours never disagree about which
- * furniture is on show. The thresholds are derived from the measured furniture, not chosen.
- */
-
-/** Left/right padding + colour dot + the gap after it: what every tab carries. */
-export const TAB_BASE_FURNITURE_PX = 10 + 4 + 9 + 6
-/** The options caret (22px box) and the actions cluster's step from the name. */
-export const TAB_CARET_PX = 22 + 2
-/** The SSH chip plus its gap. */
-export const TAB_SSH_CHIP_PX = 30 + 6
-/** The least name a tab may show before the strip scrolls instead: ~6–7 characters at 12.5px. */
-export const TAB_NAME_MIN_PX = 60
-
-export type TabDensity = 'roomy' | 'compact' | 'tight'
-
-/** A tab can show everything (chip and caret) and still keep a readable name at this width. */
-export const ROOMY_MIN_TAB_PX = TAB_BASE_FURNITURE_PX + TAB_SSH_CHIP_PX + TAB_CARET_PX + TAB_NAME_MIN_PX
-/** A tab can show the CHIP (caret on hover) and keep a readable name at this width. */
-export const COMPACT_MIN_TAB_PX = TAB_BASE_FURNITURE_PX + TAB_SSH_CHIP_PX + TAB_NAME_MIN_PX
-
-/**
- * @param stripInnerWidth the strip's width minus its own padding, in CSS px; `null`/non-finite
- * means "not measured yet", which answers `roomy` — the pre-density rendering.
- * @param tabCount how many tabs share it.
- */
-export function tabDensity(stripInnerWidth: number | null, tabCount: number): TabDensity {
- if (stripInnerWidth == null || !Number.isFinite(stripInnerWidth) || tabCount <= 0) return 'roomy'
- const perTab = stripInnerWidth / tabCount
- if (perTab >= ROOMY_MIN_TAB_PX) return 'roomy'
- if (perTab >= COMPACT_MIN_TAB_PX) return 'compact'
- return 'tight'
-}
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 59cc828b3..f0609cdde 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -72,24 +72,18 @@
panels' offsets, the usage popover's cap) and main derives the macOS traffic-light `y` from the
SAME number via `@shared/window-chrome-metrics` (`TABBAR_HEIGHT_PX`), so the bar and the lights
cannot drift apart — `styles.tabbar.test.ts` pins this literal to that constant. */
- --tabbar-h: 36px;
+ --tabbar-h: 40px;
/* Chrome-style tab geometry (see the tab bar block). `--tab-inset` is the gap between the bar's
top edge and a tab; the hover pill also keeps it at the bottom, the active tab does not.
`--tab-flare` is the radius of the active tab's concave bottom corners AND the strip's side
- padding that keeps them from being clipped. `--tab-w` is the width every tab takes while there
- is room; past that they all shrink together. */
+ padding that keeps them from being clipped. */
--tab-inset: 4px;
--tab-radius: 8px;
--tab-flare: 8px;
- --tab-w: 168px;
- /* The active tab's basis is wider by its board toggle. Flex shrink is weighted by basis, so with
- ONE basis the tab carrying the most furniture hit its floor first and its NAME took the loss —
- measured at 8 tabs / 1340px: inactive names 77px, the active name 24px (0 characters). */
- --tab-active-extra: 23px;
- /* The least name a tab may show; below it the strip scrolls rather than squeezing. Mirrors
- TAB_NAME_MIN_PX in renderer/lib/tabDensity.ts (pinned by styles.tabbar.test.ts). */
- --tab-name-min: 60px;
- --tab-fade: 18px;
+ /* The only limit on a tab's width. A tab is otherwise as wide as its own name, so the strip
+ scrolls instead of shortening anything; this stops a project named after a whole sentence
+ from taking the strip on its own, and is the ONLY case in which a name ellipsises. */
+ --tab-max: 260px;
--tab-divider-h: 16px;
/* The strip behind the tabs. In dark it is the panel colour (#282828 over a #000 canvas, the
active tab reads as a hole). In LIGHT the panel and the canvas are one value apart (#f3efe7 vs
@@ -269,8 +263,8 @@ body,
- ACTIVE takes the colour of the surface UNDER the bar (`--canvas-bg`, which the kanban overlay
shares) and merges into it: rounded top corners, square bottom, and a concave flare at each
bottom corner that curves out into the page. No line between the tab and the canvas.
- Tabs share ONE width (`--tab-w`) and shrink together as more open; the name fades out under a
- mask instead of ending in an ellipsis, and the actions stay pinned to the tab's right edge. */
+ Every tab is as wide as its own NAME (capped at `--tab-max`), so the strip scrolls rather than
+ shortening anything, and the actions stay pinned to the tab's right edge. */
.tabbar {
position: relative;
display: flex;
@@ -393,17 +387,16 @@ body,
display: flex;
align-items: center;
gap: 6px;
- /* One width for every tab, so they are all the same size and shrink by the same amount. It is
- a `width`, not a `flex-basis`, because the STRIP is content-sized (so the + can sit right
- after the last tab) and Chromium sizes a flex container from its items' max-content
- contributions — which a flex-basis does not enter and a definite width does. Measured: with
- `flex: 0 1 var(--tab-w)` four tabs in a 1280px window sat at their 83px floor with the strip
- hugging them. `min-width` stays `auto` on purpose: it resolves to the tab's fixed parts
- (glyph, chips, the actions, 24px of name — see .tab__name), which is the floor a tab shrinks
- to before the strip starts scrolling. The active tab's floor is wider by exactly its board
- toggle. */
- width: var(--tab-w);
- flex: 0 1 auto;
+ /* A tab is as wide as its own NAME, capped, and never shrinks: the project name is the thing
+ the strip exists to show, so the strip SCROLLS when the tabs stop fitting rather than
+ squeezing every name towards its floor. That is the deliberate departure from Chrome, which
+ shrinks because it must keep every tab reachable without scrolling; here the sessions sidebar
+ and Cmd+1..9 both reach a project without touching the strip, so a readable name is worth
+ more than a visible tab edge.
+ `max-width` is the one limit: a project whose folder is named after a whole sentence would
+ otherwise take the strip on its own — past it, and only past it, the name ellipsises. */
+ max-width: var(--tab-max);
+ flex: 0 0 auto;
/* Inset from the bar's top and bottom: the hover pill floats, it does not touch the edges. */
margin: var(--tab-inset) 0;
/* Asymmetric on purpose: the right edge ends in the options button, whose three dots are a far
@@ -446,9 +439,6 @@ body,
/* Square bottom, sitting ON the bar's bottom edge, so the fill runs straight into the canvas. */
margin-bottom: 0;
border-radius: var(--tab-radius) var(--tab-radius) 0 0;
- /* Wider by its board toggle, so its name shrinks in step with the inactive names instead of
- absorbing the toggle's width (see --tab-active-extra). */
- width: calc(var(--tab-w) + var(--tab-active-extra));
/* Above `.tabbar::after` and the neighbouring tabs, so the tab's own bottom pixels and its
flares replace the separator line, and the flares paint over the neighbours' edges. */
z-index: 1;
@@ -554,51 +544,19 @@ body,
line-height: 1;
}
-/* The name takes whatever width the tab's fixed parts leave, and gives it back first when the
- tab shrinks. `width: 0` is what keeps the TAB's automatic minimum from being the whole label:
- a flex item's min-content contribution is its definite width when it has one, so the tab's
- floor counts `--tab-name-min` of name, not the full text. That floor is the ONE place the strip
- decides to scroll: a tab that cannot hold it with the furniture the density level left (see
- `[data-density]` below) stops shrinking, and the strip overflows. It was 24px, which at 12 tabs
- read as three letters and a fade on every tab (the #789 regression). The text runs under a
- mask that fades the last `--tab-fade` px — a fade, not an ellipsis, because the fade shows the
- letters that DO fit at every width while "…" spends three characters saying it cut something. A
- name that fits ends before the fade zone, so it is untouched. */
+/* The project name is shown WHOLE. Two earlier rounds tried to keep every tab on screen and ration
+ the name between them — a shared basis (#789: three letters per tab at 8 tabs), then a floor
+ plus shed furniture (#790) — and both spent the one thing the strip is for. The strip scrolls
+ now, which it could always do, and nothing here shortens a name except `--tab-max`. */
.tab__name {
- flex: 1 1 0;
- width: 0;
- min-width: var(--tab-name-min);
+ /* Its own width, so the tab is sized by the name rather than the name by the tab. It only ever
+ shortens because the TAB hit `--tab-max`, and that case ellipsises rather than fading: a mask
+ gradient is unconditional — it would fade the last characters of a name that fits perfectly —
+ while `text-overflow` is self-conditioning by construction. */
+ flex: 0 1 auto;
+ min-width: 0;
overflow: hidden;
- -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - var(--tab-fade)), transparent);
- mask-image: linear-gradient(90deg, #000 calc(100% - var(--tab-fade)), transparent);
-}
-
-/* Density: which furniture a tab sheds so the NAME survives, decided per strip by TabBar
- (`lib/tabDensity.ts`, from the strip's measured width and the tab count) and stamped as
- `data-density`. Cheapest first — the inactive caret, then the chip — and the active tab keeps
- both its buttons at every level: the board toggle belongs to the tab you are looking at.
-
- An inactive tab's caret is there on hover (Chrome's close button does the same at this width)
- and stays while its menu is open — the pointer is on the menu then, not the tab, and a caret
- that vanished under an open menu would read as the menu having come from nowhere. It is
- `display: none`, not `visibility`, so the freed width goes to the name — and it is the whole
- actions CLUSTER that goes, not the caret inside it: on an inactive tab the cluster holds only
- the caret, and an emptied cluster still costs its margin and the tab's gap (8px measured). */
-.tabbar__tabs[data-density='compact'] .tab:not(.active):not(:hover):not(.tab--menu-open) .tab__actions,
-.tabbar__tabs[data-density='tight'] .tab:not(.active):not(:hover):not(.tab--menu-open) .tab__actions {
- display: none;
-}
-
-/* Tight only: the SSH chip goes as well. It is shed LAST because it is identity rather than an
- action — which of two same-named projects is the one on the server — and the tab's tooltip is
- the only other place that says so. */
-.tabbar__tabs[data-density='tight'] .tab__ssh {
- display: none;
-}
-
-/* A shorter fade on a tight strip: 18px of a 60px name is a third of it under the gradient. */
-.tabbar__tabs[data-density='tight'] .tab__name {
- --tab-fade: 12px;
+ text-overflow: ellipsis;
}
.tab__edit {
@@ -11295,7 +11253,9 @@ button.group-node__setup:disabled {
.onb-skip {
position: absolute;
- top: 40px; /* clears the traffic lights / tab bar drag region */
+ /* Clears the traffic lights and the tab bar's drag region: the onboarding overlay covers the
+ window, so this is the bar's own height (it was a literal 40 that happened to match it). */
+ top: var(--tabbar-h);
right: 24px;
background: transparent;
border: none;
diff --git a/src/renderer/styles.tabbar.test.ts b/src/renderer/styles.tabbar.test.ts
index 57d9ac4b8..6457c99a7 100644
--- a/src/renderer/styles.tabbar.test.ts
+++ b/src/renderer/styles.tabbar.test.ts
@@ -2,7 +2,6 @@ import { describe, expect, it } from 'vitest'
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
import { TABBAR_HEIGHT_PX } from '@shared/window-chrome-metrics'
-import { TAB_NAME_MIN_PX } from './lib/tabDensity'
/**
* The tab bar's height used to be a literal in four places — the bar's own rule, the kanban
@@ -74,38 +73,27 @@ describe('tab strip geometry', () => {
expect(rule('.tabbar__tabs')).toMatch(/padding:\s*0\s+var\(--tab-flare\)/)
})
- it('shrinks every tab from one basis and fades the name instead of truncating it', () => {
- // A definite width, not a flex-basis: only a width enters the content-sized strip's intrinsic
- // size, so with a basis the tabs never widened past their floor however much room there was.
- expect(rule('.tab')).toMatch(/width:\s*var\(--tab-w\)/)
- expect(rule('.tab')).toMatch(/flex:\s*0 1 auto/)
+ it('sizes every tab by its own NAME, and scrolls instead of shortening one', () => {
+ const tab = rule('.tab')
+ // Content width, never a shared basis: the two earlier rounds (#789, #790) both rationed the
+ // name between tabs, which is the one thing the strip exists to show.
+ expect(tab).toMatch(/max-width:\s*var\(--tab-max\)/)
+ expect(tab).toMatch(/flex:\s*0 0 auto/)
+ expect(tab).not.toMatch(/width:\s*var\(--tab-w\)/)
const name = rule('.tab__name')
- expect(name).toMatch(/mask-image:\s*linear-gradient/)
- expect(name).not.toMatch(/text-overflow/)
- // `width: 0` is what keeps the tab's automatic minimum from being the whole label.
- expect(name).toMatch(/width:\s*0;/)
+ // Ellipsis, not the old fade: a mask gradient is unconditional and would fade the tail of a
+ // name that fits perfectly, which is most names now.
+ expect(name).toMatch(/text-overflow:\s*ellipsis/)
+ expect(name).not.toMatch(/mask-image/)
+ expect(name).not.toMatch(/min-width:\s*var\(--tab-name-min\)/)
+ // The strip is the thing that gives way.
+ expect(rule('.tabbar__tabs')).toMatch(/overflow-x:\s*auto/)
})
- it('keeps a readable name floor, the same number the density rule reasons from', () => {
- expect(token('--tab-name-min')).toBe(`${TAB_NAME_MIN_PX}px`)
- expect(rule('.tab__name')).toMatch(/min-width:\s*var\(--tab-name-min\)/)
- // The active tab's basis is wider by its board toggle, so its name shrinks in step with the
- // inactive names instead of absorbing the toggle (the 24px active name at 8 tabs).
- expect(rule('.tab.active')).toMatch(/width:\s*calc\(var\(--tab-w\) \+ var\(--tab-active-extra\)\)/)
- })
-
- it('sheds furniture by density before the name is squeezed, and never the active tab\'s buttons', () => {
- // ORDER: the caret is deferred to hover at `compact`, and only `tight` takes the SSH chip off
- // the tab. Reported from the running app — the first version shed the chip at `compact`, which
- // is the level 8 tabs in a 1340px window land on, so every remote tab lost its `SSH` label at
- // the width people work at. A deferred control is cheaper than a label that is simply gone.
- const compactCaret = CSS.match(/\.tabbar__tabs\[data-density='compact'\] \.tab:not\(\.active\):not\(:hover\):not\(\.tab--menu-open\) \.tab__actions,\s*\.tabbar__tabs\[data-density='tight'\] \.tab:not\(\.active\):not\(:hover\):not\(\.tab--menu-open\) \.tab__actions \{[^}]*display:\s*none/)
- expect(compactCaret).not.toBeNull()
- const tightChip = CSS.match(/\.tabbar__tabs\[data-density='tight'\] \.tab__ssh \{[^}]*display:\s*none/)
- expect(tightChip).not.toBeNull()
- // The chip is never hidden at `compact` — the regression this replaced.
- expect(CSS).not.toMatch(/\.tabbar__tabs\[data-density='compact'\] \.tab__ssh[^{]*\{[^}]*display:\s*none/)
- // Nothing hides the board toggle at any density.
- expect(CSS).not.toMatch(/\[data-density[^\]]*\][^{]*\.tab__board-toggle[^{]*\{[^}]*display:\s*none/)
+ it('carries no density machinery any more — nothing sheds furniture to buy name width', () => {
+ // `lib/tabDensity.ts` is deleted with this change: with full names there is no name budget to
+ // protect, and shedding the SSH chip took a LABEL off every remote tab at the width people
+ // work at (the report that ended the previous approach).
+ expect(CSS).not.toMatch(/data-density/)
})
})
diff --git a/src/shared/window-chrome-metrics.ts b/src/shared/window-chrome-metrics.ts
index 242ffd53e..8112c3468 100644
--- a/src/shared/window-chrome-metrics.ts
+++ b/src/shared/window-chrome-metrics.ts
@@ -10,8 +10,9 @@
* stylesheet's token to it.
*/
-/** Height of `.tabbar`, in CSS px. Chrome's strip is ~40; this is one text line plus padding. */
-export const TABBAR_HEIGHT_PX = 36
+/** Height of `.tabbar`, in CSS px. Chrome's own strip is ~40, and so is this: 36 was a touch
+ * tighter than the reference and read as cramped once the tabs carried full names. */
+export const TABBAR_HEIGHT_PX = 40
/** The macOS traffic lights are 12px discs (measured on a 2x capture: 24 device px). */
export const TRAFFIC_LIGHT_DIAMETER_PX = 12