From d943285f952e2a00cdf0329d0de679652a6e09af Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Tue, 17 Nov 2026 00:16:13 -0500 Subject: [PATCH] Curves: the links they underline kept in hand, not looked for in the page; columns measured on scrolls that can change their tabs only Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab --- src/ui/Panes.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ui/Panes.tsx b/src/ui/Panes.tsx index 62ad8ed..47b5a0a 100644 --- a/src/ui/Panes.tsx +++ b/src/ui/Panes.tsx @@ -576,7 +576,8 @@ export function Panes() { const wrap = el.parentElement!; const onScroll = (e: Event) => { const t = e.target as HTMLElement; - measure(); + // The strip, a crowded column, or a pane in one (whose title's rule may come or go under its tab). + if (t === el || t.classList?.contains("col") || t.parentElement?.parentElement?.classList.contains("crowded")) measure(); // A scroll inside what peeks (the wheel over it) keeps it out; any other moves things from under it. if (peeked.length && !peeked.some((p) => p !== t && p.contains(t)) && !(t === peeked[0] && peeked.length === 1 && !t.classList.contains("pane"))) hide(); schedule(); @@ -915,6 +916,9 @@ function underline(s: HTMLElement, r: DOMRect): number { /** Where a curve arrives, from its column's left edge: just short of the title. */ const ARRIVE = 36; +/** The links whose underline the curves drew last time. */ +let underlined = new Set(); + /** The lane order last used in each gutter, by the curves' keys. */ const lanesUsed = new Map(); @@ -933,7 +937,8 @@ function curves(el: HTMLElement | null, svg: SVGSVGElement | null) { if (!el || !svg) return; if (!store.settings.curves) { for (const p of svg.querySelectorAll("path")) p.remove(); - for (const s of document.querySelectorAll("[data-curved]")) s.removeAttribute("data-curved"); + for (const s of underlined) s.removeAttribute("data-curved"); + underlined = new Set(); markRuled(paneEls(el), new Map()); return; } @@ -1158,7 +1163,7 @@ function curves(el: HTMLElement | null, svg: SVGSVGElement | null) { const peeked = [...el.querySelectorAll("[data-peek]")]; const local = (r: DOMRect) => ({ x: r.left - box.left, y: r.top - box.top, w: r.width, h: r.height }); const holes = peeked.map((p) => local(p.getBoundingClientRect())); - const bar = document.querySelector(".pane > .selbar"); + const bar = el.querySelector(".pane > .selbar"); const barHole = bar && bar.style.visibility !== "hidden" ? [local(bar.getBoundingClientRect())] : []; const owned = (id: number) => { const p = els.get(id); @@ -1192,8 +1197,9 @@ function curves(el: HTMLElement | null, svg: SVGSVGElement | null) { if (g.children[k] !== p) g.insertBefore(p, g.children[k] ?? null); }); for (const p of had.values()) p.remove(); - for (const s of document.querySelectorAll("[data-curved]")) if (!curved.has(s)) s.removeAttribute("data-curved"); + for (const s of underlined) if (!curved.has(s)) s.removeAttribute("data-curved"); for (const s of curved) if (!s.hasAttribute("data-curved")) s.setAttribute("data-curved", ""); + underlined = curved; markRuled(els, rules); }