mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-10 01:09:43 +02:00
fix(tabs): one lineage row gap for every tab arrangement, no double gap at state breaks
#544 reserves a 12px row gap for the lineage routes on `.session-tabs.lineage-tree.tabs-auto-wrap`, and #538's arrangements set their own row spacing at an equal or higher specificity later in the file: - The ledger grid's `gap: 4px 6px` and the case strip's `gap: 6px` won, so the lanes packed onto the cell borders (y 39/40/41 in a 4px gap). - In the state rows every `.tab-triage-break` is a zero-height flex line of its own, so each group boundary cost two row gaps: rows 54px apart instead of 42, and the header 12px taller per group (including a trailing one after the last group). A negative margin on the break cannot cancel it, because a flex line's cross size is clamped at zero (measured in Chromium). The lineage row gap is now one custom property, `--lineage-row-gap`, set only by the lineage rule. The ledger and both cluster gaps read it with their own fallback, and the wrapped state strip spaces its rows with a bottom margin on every item except the breaks (row-gap 0), its last row's margin replacing the bottom padding. Rows are now one gap apart in every case, with lineage and without (4px then, where a group boundary used to be 8px). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -384,6 +384,28 @@ describe('lineage wiring', () => {
|
||||
expect(wrapped).toContain('padding-left');
|
||||
});
|
||||
|
||||
it('keeps the routing row gap in every tab arrangement through one variable', () => {
|
||||
// The ledger grid and the case clusters set their own `gap` at a specificity
|
||||
// that beat the lineage rule, packing the lanes onto the cell borders. Every
|
||||
// arrangement now reads the one variable, which only the lineage rule sets.
|
||||
expect(stylesCss.match(/--lineage-row-gap:/g)).toHaveLength(1);
|
||||
const wrapped = stylesCss.slice(stylesCss.indexOf('.session-tabs.lineage-tree.tabs-auto-wrap {'));
|
||||
expect(wrapped.slice(0, wrapped.indexOf('}'))).toMatch(
|
||||
/--lineage-row-gap: 12px;\s[^}]*row-gap: var\(--lineage-row-gap\);/
|
||||
);
|
||||
expect(stylesCss).toMatch(
|
||||
/\.session-tabs-host > \.session-tabs\.tabs-ledger \{[^}]*gap: var\(--lineage-row-gap, 4px\) 6px;/
|
||||
);
|
||||
expect(stylesCss).toMatch(
|
||||
/\.session-tabs-host > \.session-tabs\.tabs-clusters \{\s*gap: var\(--lineage-row-gap, 6px\) 6px;/
|
||||
);
|
||||
expect(stylesCss).toMatch(
|
||||
/\.session-tabs-host > \.session-tabs\.tabs-clusters > \.tab-cluster \{[^}]*gap: var\(--lineage-row-gap, 2px\) 2px;/
|
||||
);
|
||||
// No arrangement may hard-code a gap the lineage rows depend on.
|
||||
expect(stylesCss).not.toMatch(/\.session-tabs\.tabs-(ledger|clusters) \{[^}]*\bgap: \d+px( \d+px)?;/);
|
||||
});
|
||||
|
||||
it('syncs the routing room before the wrap is measured, and redraws on selection', () => {
|
||||
const overflow = appJs.slice(appJs.indexOf(' updateTabOverflowMode() {'));
|
||||
expect(overflow.indexOf('_syncLineageGutter')).toBeGreaterThan(-1);
|
||||
|
||||
Reference in New Issue
Block a user