fix(tabs): route the lineage spine between the state labels and the tabs

With tabArrangement 'state' (the default) and lineage lines on (the desktop
default), the spine ran straight through the WORKING / WAITING / NEEDS YOU
label of every row it passed. #538's
`.session-tabs.tabs-triage:is(.tabs-auto-wrap, .tabs-two-rows)` pads the
strip by the label gutter and pulls each label to the strip's edge with a
negative margin; it outranks #544's `.lineage-tree.tabs-auto-wrap`
`padding-left: 20px`, so the spine channel disappeared, and the spine,
anchored at the strip's left edge (computeLineageTree), sat in the label
column.

The channel now opens BETWEEN the label column and the tabs: with lineage,
the state strip pads by gutter + --lineage-spine-channel, every label keeps
its column at the edge (still under the brand) and hands the channel back
after itself, and the lead label still starts right after the brand.
computeLineageTree takes the channel's left edge as `spineLeft`, which
session-lineage.js reads back from the padding the CSS laid out (content edge
minus the channel), so the two cannot drift; without it, or where the channel
is the padding itself (classic, ledger, case), the spine stays at the strip's
edge exactly as before. The spine's clamp now only considers tabs in rows the
spine can run beside (every row after the first), so a first row that starts
left of the channel (a quiet idle group right after the brand) no longer
drags the spine back over the labels.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-10-08 21:36:04 +02:00
parent f5acf19a11
commit 382d7dd406
5 changed files with 221 additions and 13 deletions
+13
View File
@@ -260,7 +260,19 @@ Object.assign(CodemanApp.prototype, {
// The header strip's rows come from EVERY tab in it (computeTree hangs a row's
// gap under its tallest tab), web tabs included. The rail needs none.
const tabRects = [];
let spineLeft;
if (orientation === 'horizontal') {
// Where the spine channel is: the reserved --lineage-spine-channel just left
// of the strip's content edge. Usually that is the strip's own left edge,
// but grouped by state the label column comes first (styles.css), and a
// spine at the edge ran through every label. Read back from the padding
// the CSS laid out, so geometry and stylesheet cannot disagree.
const style = typeof getComputedStyle === 'function' ? getComputedStyle(strip) : null;
const channel = style ? parseFloat(style.getPropertyValue('--lineage-spine-channel')) : NaN;
if (Number.isFinite(channel)) {
const inset = (parseFloat(style.borderLeftWidth) || 0) + (parseFloat(style.paddingLeft) || 0);
spineLeft = stripRect.left + inset - channel;
}
for (const tab of strip.querySelectorAll('.session-tab')) {
const id = tab.getAttribute('data-id');
const key = id ? 'tab:' + id : null;
@@ -292,6 +304,7 @@ Object.assign(CodemanApp.prototype, {
children: children.map((c) => ({ id: c.edge.childId, rect: c.rect })),
strip: stripRect,
tabs: tabRects,
spineLeft,
orientation,
lane,
laneCount,