Panes: one controller for the listeners, shared helpers for repeated lookups
- The panes' effect registered 25 listeners and removed each by hand; they share an AbortController now. - One relayout() for the four places that laid out, measured and drew; one uncurve() for "curves off" and the start of the pages' marks (so schedule just calls curves(), which goes to pageMarks as pages); one handleAt() for the mouse and touch drags' handle lookup (the close/pin/⋯ checks before it could never match inside a grip or tab); ruleOf() for the rule a pane's head draws, written three times; setAttr from stack.ts instead of a copy; paneOfPage for the desktop column's pane to show, the same rule; the pin, close and W icons from Pages.tsx instead of copies in Chrome. - The curves' `box` offset was a constant zero subtracted everywhere. - Gone: glideTo's ms parameter (never passed), the "lifting" class (nothing reads it), Axis fields nothing reads, a dead branch in the map's rails, a linear search per pane in forks reorder, a stale and a superseded comment. Exports used only in their own file are not exported. 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
5d6b7a8215
commit
3aa8778427
5 files changed
+128
-170
No files matched your search
+1
-5
@@ -37,11 +37,7 @@ export function crossings(order: { sy: number; ey: number }[]): number {
|
||||
* scroll or an open elsewhere does not reshuffle the bundle.
|
||||
*/
|
||||
export function laneOrder<T extends { key: string; sy: number; ey: number }>(edges: T[], last: string[] = []): T[] {
|
||||
const rule = [...edges].sort((a, b) => {
|
||||
const da = a.ey >= a.sy ? a.ey - a.sy : a.sy - a.ey;
|
||||
const db = b.ey >= b.sy ? b.ey - b.sy : b.sy - b.ey;
|
||||
return da - db;
|
||||
});
|
||||
const rule = [...edges].sort((a, b) => Math.abs(a.ey - a.sy) - Math.abs(b.ey - b.sy));
|
||||
const byKey = new Map(edges.map((e) => [e.key, e]));
|
||||
const order = last.flatMap((k) => byKey.get(k) ?? []);
|
||||
for (const e of rule) {
|
||||
|
||||
Reference in new issue
Block a user