The active pane's other edges drawn with the curves, so moving between panes repaints only those lines
A frame over the whole pane repainted the whole pane at every move (the forks keypress-to-paint median rose by half a frame); its left, foot and right are now a hairline path in the curves' layer, under what peeks, cut where the next column or pane covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
1 parent
d943285f95
commit
9c0f4b8c02
5 files changed
+35
-9
No files matched your search
+1
-1
@@ -375,7 +375,7 @@ test("each fork has a colour, shared by its curve and the rule under its title;
|
|||||||
expect((await curve("Simple cells")).stroke).not.toBe((await curve("Complex cells")).stroke);
|
expect((await curve("Simple cells")).stroke).not.toBe((await curve("Complex cells")).stroke);
|
||||||
expect((await curve("Simple cells")).stroke).not.toBe((await curve("Eukaryote")).stroke);
|
expect((await curve("Simple cells")).stroke).not.toBe((await curve("Eukaryote")).stroke);
|
||||||
// The active pane's heavy ink rule is as it was.
|
// The active pane's heavy ink rule is as it was.
|
||||||
expect(await page.locator(".pane.active").evaluate((el) => getComputedStyle(el, "::after").borderTopWidth)).toBe("3px");
|
expect(await page.locator(".pane.active").evaluate((el) => getComputedStyle(el, "::after").height)).toBe("3px");
|
||||||
// Off: plain ink everywhere, as before colours.
|
// Off: plain ink everywhere, as before colours.
|
||||||
await page.keyboard.press(":");
|
await page.keyboard.press(":");
|
||||||
await page.keyboard.type("/colors off");
|
await page.keyboard.type("/colors off");
|
||||||
|
|||||||
+1
-1
@@ -179,7 +179,7 @@ export const curveFaults = (page: Page) =>
|
|||||||
const svg = document.querySelector<SVGSVGElement>(".curves")!.getBoundingClientRect();
|
const svg = document.querySelector<SVGSVGElement>(".curves")!.getBoundingClientRect();
|
||||||
const box = { left: Math.round(svg.left), top: Math.round(svg.top) };
|
const box = { left: Math.round(svg.left), top: Math.round(svg.top) };
|
||||||
const placed = new Map<number, any>(ie.panesPlaced.map((x: any) => [x.node.id, x]));
|
const placed = new Map<number, any>(ie.panesPlaced.map((x: any) => [x.node.id, x]));
|
||||||
for (const p of document.querySelectorAll<SVGPathElement>(".curves path:not(.foot)")) {
|
for (const p of document.querySelectorAll<SVGPathElement>(".curves path:not(.foot):not(.frame)")) {
|
||||||
const to = Number(p.dataset.to);
|
const to = Number(p.dataset.to);
|
||||||
const from = Number(p.dataset.from);
|
const from = Number(p.dataset.from);
|
||||||
const ce = document.querySelector<HTMLElement>(`.pane[data-tid="${to}"]`);
|
const ce = document.querySelector<HTMLElement>(`.pane[data-tid="${to}"]`);
|
||||||
|
|||||||
+8
-4
@@ -136,12 +136,16 @@ test("the selection bar is over the curves and under a pane peeking over it; cur
|
|||||||
await noFaults(page, "with the bar (its place clear of the curves)");
|
await noFaults(page, "with the bar (its place clear of the curves)");
|
||||||
const z = await page.evaluate(() => ({ curves: Number(getComputedStyle(document.querySelector(".curves")!).zIndex), peek: 6 }));
|
const z = await page.evaluate(() => ({ curves: Number(getComputedStyle(document.querySelector(".curves")!).zIndex), peek: 6 }));
|
||||||
expect(z.curves).toBeGreaterThan(z.peek);
|
expect(z.curves).toBeGreaterThan(z.peek);
|
||||||
// The active pane: its other edges in the strong ink too.
|
// The active pane: the heavy rule on top, its other edges in the strong ink (drawn with the curves, along its left, foot and right).
|
||||||
const frame = await page.locator(".pane.active").evaluate((el) => {
|
const frame = await page.locator(".pane.active").evaluate((el) => {
|
||||||
const a = getComputedStyle(el, "::after");
|
const r = el.getBoundingClientRect();
|
||||||
return { top: a.borderTopWidth, left: a.borderLeftWidth, right: a.borderRightWidth, bottom: a.borderBottomWidth, same: a.borderLeftColor === a.borderRightColor && a.borderRightColor === a.borderBottomColor, notRule: a.borderLeftColor !== getComputedStyle(el).borderRightColor };
|
const f = document.querySelector<SVGPathElement>(".curves path.frame");
|
||||||
|
if (!f) return null;
|
||||||
|
const a = f.getPointAtLength(0);
|
||||||
|
const b = f.getPointAtLength(f.getTotalLength());
|
||||||
|
return { rule: getComputedStyle(el, "::after").height, left: Math.abs(a.x - r.left) < 1.5, right: Math.abs(b.x - r.right) < 1.5, stroke: getComputedStyle(f).stroke !== getComputedStyle(el).borderRightColor };
|
||||||
});
|
});
|
||||||
expect(frame).toEqual({ top: "3px", left: "1px", right: "1px", bottom: "1px", same: true, notRule: true });
|
expect(frame).toEqual({ rule: "3px", left: true, right: true, stroke: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
test("a menu's button closes the menu it opened: the top bar's, and a pane's ⋯", async ({ page }) => {
|
test("a menu's button closes the menu it opened: the top bar's, and a pane's ⋯", async ({ page }) => {
|
||||||
|
|||||||
+22
-1
@@ -1003,7 +1003,8 @@ function curves(el: HTMLElement | null, svg: SVGSVGElement | null) {
|
|||||||
if (rr && rr.bottom <= Math.max(cbox.top, scroll.top) + TAB) {
|
if (rr && rr.bottom <= Math.max(cbox.top, scroll.top) + TAB) {
|
||||||
folded = true;
|
folded = true;
|
||||||
ey = cbox.top + TAB / 2;
|
ey = cbox.top + TAB / 2;
|
||||||
} else if (rr && ruleShows(ce, ccolBox, below) && rr.left < shownRight) {
|
} else if (rr && rr.bottom > Math.max(cbox.top, ccolBox.top, scroll.top) + TAB && rr.bottom <= Math.min(below, ccolBox.bottom, scroll.bottom) && rr.left < shownRight) {
|
||||||
|
// (ruleShows, from what is measured here already.)
|
||||||
ey = level(rr.bottom - 0.5);
|
ey = level(rr.bottom - 0.5);
|
||||||
ex = Math.max(left + ARRIVE, rr.left);
|
ex = Math.max(left + ARRIVE, rr.left);
|
||||||
rule = { x0: ex, x1: Math.min(rr.right, shownRight) };
|
rule = { x0: ex, x1: Math.min(rr.right, shownRight) };
|
||||||
@@ -1125,6 +1126,26 @@ function curves(el: HTMLElement | null, svg: SVGSVGElement | null) {
|
|||||||
for (const g of [...lanesUsed.keys()]) if (!gutters.has(g)) lanesUsed.delete(g);
|
for (const g of [...lanesUsed.keys()]) if (!gutters.has(g)) lanesUsed.delete(g);
|
||||||
const fx = (n: number) => Math.round(n * 1000) / 1000;
|
const fx = (n: number) => Math.round(n * 1000) / 1000;
|
||||||
const out: { key: string; from: number; to: number; lane: number; cls: string; d: string; hue: string }[] = [];
|
const out: { key: string; from: number; to: number; lane: number; cls: string; d: string; hue: string }[] = [];
|
||||||
|
// The active pane's edges (left, foot, right), where they show: in the stronger ink, a hairline each.
|
||||||
|
const act = el.querySelector<HTMLElement>(".pane.active");
|
||||||
|
if (act) {
|
||||||
|
const r = act.getBoundingClientRect();
|
||||||
|
const col = act.parentElement!;
|
||||||
|
const c = col.getBoundingClientRect();
|
||||||
|
const next = col.classList.contains("crowded") ? ((act.nextElementSibling as HTMLElement | null)?.getBoundingClientRect().top ?? Infinity) : Infinity;
|
||||||
|
const cover = (col.nextElementSibling as HTMLElement | null)?.getBoundingClientRect().left ?? Infinity;
|
||||||
|
const h = wd / dpr / 2;
|
||||||
|
const top = Math.max(r.top, c.top) + 3;
|
||||||
|
const bottom = Math.min(r.bottom, next, c.bottom);
|
||||||
|
const x0 = Math.round(r.left * dpr) / dpr + h;
|
||||||
|
const right = Math.min(r.right, cover);
|
||||||
|
const x1 = Math.round(right * dpr) / dpr - h;
|
||||||
|
const yb = Math.round(bottom * dpr) / dpr - h;
|
||||||
|
if (bottom > top) {
|
||||||
|
const d = right < r.right - 1 ? `M${fx(x0 - box.left)} ${fx(top - box.top)}V${fx(yb - box.top)}H${fx(right - box.left)}` : `M${fx(x0 - box.left)} ${fx(top - box.top)}V${fx(yb - box.top)}H${fx(x1 - box.left)}V${fx(top - box.top)}`;
|
||||||
|
out.push({ key: "frame", from: Number(act.dataset.tid), to: -1, lane: -1, cls: "frame", d, hue: "" });
|
||||||
|
}
|
||||||
|
}
|
||||||
for (const [id, f] of feet) if (!tabbed.has(id)) out.push({ key: `foot:${id}`, from: id, to: -1, lane: -1, cls: f.on ? "foot on" : "foot", d: `M${fx(f.x0)} ${fx(f.y)}H${fx(f.x1)}`, hue: f.hue === undefined ? "" : String(f.hue) });
|
for (const [id, f] of feet) if (!tabbed.has(id)) out.push({ key: `foot:${id}`, from: id, to: -1, lane: -1, cls: f.on ? "foot on" : "foot", d: `M${fx(f.x0)} ${fx(f.y)}H${fx(f.x1)}`, hue: f.hue === undefined ? "" : String(f.hue) });
|
||||||
edges.sort((a, b) => Number(a.on) - Number(b.on));
|
edges.sort((a, b) => Number(a.on) - Number(b.on));
|
||||||
for (const e of edges) {
|
for (const e of edges) {
|
||||||
|
|||||||
+3
-2
@@ -467,8 +467,9 @@ kbd, .help code { font-family: var(--mono); font-size: 0.86em; border: 1px solid
|
|||||||
* badge is set in the same ink.
|
* badge is set in the same ink.
|
||||||
*/
|
*/
|
||||||
.pane::after { content: ""; position: absolute; z-index: 3; top: 0; left: 0; right: 0; height: 0; background: var(--fg); pointer-events: none; }
|
.pane::after { content: ""; position: absolute; z-index: 3; top: 0; left: 0; right: 0; height: 0; background: var(--fg); pointer-events: none; }
|
||||||
/* The active pane: the heavy rule across its top, and its other three edges in the stronger ink (the same hairline width), over the hairlines it shares with its neighbours. */
|
/* 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 { bottom: 0; height: auto; z-index: 5; background: none; border: 1px solid var(--edge-strong); border-top: 3px solid var(--fg); }
|
.pane.active::after { height: 3px; }
|
||||||
|
.panes .curves path.frame.frame { stroke: var(--edge-strong); fill: none; stroke-dasharray: none; }
|
||||||
.pane.on-branch:not(.active)::after { height: 1px; background: var(--faint); }
|
.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. */
|
/* The curves: from what each pane was opened from to its title, behind nothing but in the gaps between lines. */
|
||||||
|
|||||||
Reference in new issue
Block a user