Pages, from a real phone: the pane gone to has the page's height; dots for a page's panes in the trail; a 140 ms glide; the map as a tree; a held pane moves; a one-row selection bar; a tap on a link only opens it
- A shared page stacks whenever a share would cut the pane looked at short (stack.ts crowds; desktop unchanged). - Each trail step shows a dot per pane on its page, its own filled in its colour; past four, the number. - The strip glides to a page in 140 ms easing out (rAF, snapping off on the way), at once with reduced motion; a finger takes it from a glide. - The map draws tree lines from each parent into each child in the child's colour (pages.ts rails), crisp borders, deep forests indented less. - A press held on a pane's tab or the band above its title picks it up (touch), drop line and ghost, edge scroll, a second finger cancels; Move this pane up/down in the pane menu (Alt+Shift+k j). - The docked selection bar is one row: actions scroll sideways under a fade, the ⋯ and × fixed at its end. - The hover preview is the mouse's only (pointerType), dropped on any press, click or pane change; the keyboard preview is not shown on touch. 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
d3c2ea452a
commit
99aae86dff
14 files changed
+1163
-120
No files matched your search
@@ -43,6 +43,35 @@ export function offsets(sizes: number[], pinned: boolean[], strip: number, view:
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Heights for the panes of one column of height h, from what each needs to show all it holds:
|
||||
* each gets that, or an equal share of what is left, whichever is less; what no pane needs goes to
|
||||
* the one that needs most. So short panes are no taller than their text, and long ones share the rest.
|
||||
*/
|
||||
export function fill(h: number, needs: number[]): number[] {
|
||||
const out = needs.map(() => 0);
|
||||
const order = needs.map((_, i) => i).sort((a, b) => needs[a] - needs[b]);
|
||||
let rest = h;
|
||||
order.forEach((i, k) => {
|
||||
const share = rest / (order.length - k);
|
||||
out[i] = Math.floor(k === order.length - 1 ? rest : Math.min(needs[i], share));
|
||||
rest -= out[i];
|
||||
});
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a column of height h stacks its panes (each folding to a tab but the one looked at)
|
||||
* rather than sharing its height among them: when they do not all fit at their least (`least`
|
||||
* each, or less where a pane needs less); and, given `here`, the pane looked at (as pages, on a
|
||||
* phone), also whenever sharing would leave that pane shorter than what it needs, so it gets the
|
||||
* column's height and the others fold.
|
||||
*/
|
||||
export function crowds(h: number, needs: number[], least: number, here?: number): boolean {
|
||||
if (needs.reduce((s, x) => s + Math.min(x, least), 0) > h) return true;
|
||||
return here !== undefined && needs.length > 1 && fill(h, needs)[here] < needs[here] - 1;
|
||||
}
|
||||
|
||||
/** Where each item begins when nothing is stuck: one after another. */
|
||||
export const starts = (sizes: number[]) => sizes.map((_, i) => sizes.slice(0, i).reduce((a, b) => a + b, 0));
|
||||
|
||||
|
||||
Reference in new issue
Block a user