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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
1 parent
5ba7dc6cad
commit
d943285f95
1 file changed
+10
-4
+10
-4
@@ -576,7 +576,8 @@ export function Panes() {
|
|||||||
const wrap = el.parentElement!;
|
const wrap = el.parentElement!;
|
||||||
const onScroll = (e: Event) => {
|
const onScroll = (e: Event) => {
|
||||||
const t = e.target as HTMLElement;
|
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.
|
// 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();
|
if (peeked.length && !peeked.some((p) => p !== t && p.contains(t)) && !(t === peeked[0] && peeked.length === 1 && !t.classList.contains("pane"))) hide();
|
||||||
schedule();
|
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. */
|
/** Where a curve arrives, from its column's left edge: just short of the title. */
|
||||||
const ARRIVE = 36;
|
const ARRIVE = 36;
|
||||||
|
|
||||||
|
/** The links whose underline the curves drew last time. */
|
||||||
|
let underlined = new Set<HTMLElement>();
|
||||||
|
|
||||||
/** The lane order last used in each gutter, by the curves' keys. */
|
/** The lane order last used in each gutter, by the curves' keys. */
|
||||||
const lanesUsed = new Map<number, string[]>();
|
const lanesUsed = new Map<number, string[]>();
|
||||||
|
|
||||||
@@ -933,7 +937,8 @@ function curves(el: HTMLElement | null, svg: SVGSVGElement | null) {
|
|||||||
if (!el || !svg) return;
|
if (!el || !svg) return;
|
||||||
if (!store.settings.curves) {
|
if (!store.settings.curves) {
|
||||||
for (const p of svg.querySelectorAll("path")) p.remove();
|
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());
|
markRuled(paneEls(el), new Map());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1158,7 +1163,7 @@ function curves(el: HTMLElement | null, svg: SVGSVGElement | null) {
|
|||||||
const peeked = [...el.querySelectorAll<HTMLElement>("[data-peek]")];
|
const peeked = [...el.querySelectorAll<HTMLElement>("[data-peek]")];
|
||||||
const local = (r: DOMRect) => ({ x: r.left - box.left, y: r.top - box.top, w: r.width, h: r.height });
|
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 holes = peeked.map((p) => local(p.getBoundingClientRect()));
|
||||||
const bar = document.querySelector<HTMLElement>(".pane > .selbar");
|
const bar = el.querySelector<HTMLElement>(".pane > .selbar");
|
||||||
const barHole = bar && bar.style.visibility !== "hidden" ? [local(bar.getBoundingClientRect())] : [];
|
const barHole = bar && bar.style.visibility !== "hidden" ? [local(bar.getBoundingClientRect())] : [];
|
||||||
const owned = (id: number) => {
|
const owned = (id: number) => {
|
||||||
const p = els.get(id);
|
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);
|
if (g.children[k] !== p) g.insertBefore(p, g.children[k] ?? null);
|
||||||
});
|
});
|
||||||
for (const p of had.values()) p.remove();
|
for (const p of had.values()) p.remove();
|
||||||
for (const s of document.querySelectorAll<HTMLElement>("[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", "");
|
for (const s of curved) if (!s.hasAttribute("data-curved")) s.setAttribute("data-curved", "");
|
||||||
|
underlined = curved;
|
||||||
markRuled(els, rules);
|
markRuled(els, rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user