From e6e4ad8d262ab3cd2b8b05e3e70ac69a0d34bfba Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Tue, 17 Nov 2026 00:48:37 -0500 Subject: [PATCH] The active pane's edges: kept to the pane they are for; drawn by the pane with the curves off; tests count curves, not edges Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab --- e2e/colours.spec.ts | 2 +- e2e/forks.spec.ts | 4 ++-- e2e/panes3.spec.ts | 4 ++-- src/ui/Panes.tsx | 6 +++--- src/ui/style.css | 2 ++ 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/e2e/colours.spec.ts b/e2e/colours.spec.ts index 293791d..df06fce 100644 --- a/e2e/colours.spec.ts +++ b/e2e/colours.spec.ts @@ -52,7 +52,7 @@ const lines = (page: Page) => }; const svg = document.querySelector(".curves")!.getBoundingClientRect(); const box = { left: Math.round(svg.left), top: Math.round(svg.top) }; - return [...document.querySelectorAll(".curves path:not(.foot)")].map((p) => { + return [...document.querySelectorAll(".curves path:not(.foot):not(.frame)")].map((p) => { const pe = document.querySelector(`.pane[data-tid="${p.dataset.to}"]`)!; const a = p.getPointAtLength(0); const b = p.getPointAtLength(p.getTotalLength()); diff --git a/e2e/forks.spec.ts b/e2e/forks.spec.ts index 854c218..bce046e 100644 --- a/e2e/forks.spec.ts +++ b/e2e/forks.spec.ts @@ -315,7 +315,7 @@ test("a curve per open edge, from where each pane was opened to its title; it fo // The focused branch (Two kinds of cell → Complex cells) in its own ink; the others not. expect(edge("Two kinds of cell", "Complex cells")[0].cls).toContain("on"); expect(edge("Two kinds of cell", "Simple cells")[0].cls).not.toContain("on"); - expect(await page.locator(".curves path.on").first().evaluate((el) => getComputedStyle(el).stroke)).not.toBe(await page.locator(".curves path:not(.on)").first().evaluate((el) => getComputedStyle(el).stroke)); + expect(await page.locator(".curves path.on").first().evaluate((el) => getComputedStyle(el).stroke)).not.toBe(await page.locator(".curves path:not(.on):not(.frame)").first().evaluate((el) => getComputedStyle(el).stroke)); // Scroll Eukaryote's text: the curve out of it moves with its link. const before = edge("Eukaryote", "Bacteria")[0].a; await pane(page, "Eukaryote").locator(".pane-scroll").evaluate((el) => (el.scrollTop = 40)); @@ -402,7 +402,7 @@ test("curves down one gutter take lanes of their own, side by side, up to as man for (let i = 0; i < 10; i++) await keys(page, "j Enter"); await still(page); const runs = await page.evaluate(() => - [...document.querySelectorAll(".curves path")].map((p) => { + [...document.querySelectorAll(".curves path:not(.frame)")].map((p) => { const v = /C[^C]*?([\d.]+) [\d.]+V/.exec(p.getAttribute("d")!); return { lane: Number(p.dataset.lane), x: v ? Number(v[1]) : NaN }; }), diff --git a/e2e/panes3.spec.ts b/e2e/panes3.spec.ts index 04e7413..75254f1 100644 --- a/e2e/panes3.spec.ts +++ b/e2e/panes3.spec.ts @@ -161,7 +161,7 @@ test("every pane of a crowded column shows at least its tab, above or below the for (const c of centred) expect(c.off).toBeLessThanOrEqual(1.5); // The curve becomes a tab's line where it meets it: no stub of it before the meeting. const stubs = await page.evaluate(() => - [...document.querySelectorAll(".curves path:not(.foot)")].filter((p) => { + [...document.querySelectorAll(".curves path:not(.foot):not(.frame)")].filter((p) => { const pe = document.querySelector(`.pane[data-tid="${p.dataset.to}"]`); return pe?.dataset.ruled?.includes("tab") && (p.getAttribute("d")!.match(/M/g) ?? []).length > 1; }).length, @@ -310,7 +310,7 @@ test("a dotted curve to a source out of sight in its pane turns, at its end, tow const lib = pane(page, "Library").locator(".pane-scroll"); const lead = async () => page.evaluate(() => { - const p = [...document.querySelectorAll(".curves path:not(.foot)")].find((x) => x.classList.contains("lost")); + const p = [...document.querySelectorAll(".curves path:not(.foot):not(.frame)")].find((x) => x.classList.contains("lost")); if (!p) return null; const a = p.getPointAtLength(0); const b = p.getPointAtLength(8); diff --git a/src/ui/Panes.tsx b/src/ui/Panes.tsx index 5cea100..9ac96b4 100644 --- a/src/ui/Panes.tsx +++ b/src/ui/Panes.tsx @@ -832,7 +832,7 @@ export function Panes() { }, []); return ( -
+
{order.map((c) => { const items = cols.get(c)!; @@ -1204,9 +1204,9 @@ function curves(el: HTMLElement | null, svg: SVGSVGElement | null) { if (!p) { p = document.createElementNS("http://www.w3.org/2000/svg", "path"); p.dataset.key = c.key; - p.dataset.from = String(c.from); - p.dataset.to = String(c.to); } + if (p.dataset.from !== String(c.from)) p.dataset.from = String(c.from); + if (p.dataset.to !== String(c.to)) p.dataset.to = String(c.to); if (p.getAttribute("d") !== c.d) p.setAttribute("d", c.d); if (p.getAttribute("class") !== c.cls) p.setAttribute("class", c.cls); if (p.dataset.lane !== String(c.lane)) p.dataset.lane = String(c.lane); diff --git a/src/ui/style.css b/src/ui/style.css index ea6502a..62b9c38 100644 --- a/src/ui/style.css +++ b/src/ui/style.css @@ -470,6 +470,8 @@ kbd, .help code { font-family: var(--mono); font-size: 0.86em; border: 1px solid /* The active pane: the heavy rule across its top; its other three edges in the stronger ink are drawn with the curves (Panes.tsx), over the hairlines it shares with its neighbours, so a move from pane to pane repaints only those lines. */ .pane.active::after { height: 3px; } .panes .curves path.frame.frame { stroke: var(--edge-strong); fill: none; stroke-dasharray: none; } +/* With the curves off, the pane draws them itself. */ +.panes[data-curves="off"] .pane.active::after { bottom: 0; height: auto; background: none; border: 1px solid var(--edge-strong); border-top: 3px solid var(--fg); } .pane.on-branch:not(.active)::after { height: 1px; background: var(--faint); } /* The curves: from what each pane was opened from to its title, behind nothing but in the gaps between lines. */