Panes: clicks, selection, tabs, peek and curves that keep to their content; Alt+h j k l between panes
- A click anywhere in a pane that is not text, a row or a link makes it the active pane; a click anywhere else, or Esc, clears a selection. - The page measures where each pane was opened from, so its column stands in that order. - A crowded column stacks the panes after the one looked at at its foot, a tab each, so every pane shows at least its tab; the curve into a tab becomes the tab's line where it meets it (no stub). - A pane cut off for any reason (covered, too small a share, past the foot) peeks out as tall as its text needs, without moving the panes around it; curves are redrawn on peek, on a pane's text changing size (ResizeObserver) and every frame while anything animates. - The curve joins the active pane's title rule too (the heavy rule alone marks it); a source out of sight in a pane that still shows is pointed at: dotted, turned at its end toward it; a curve leaves from a tab's foot only when its pane is folded to the tab. - The selection bar sits under a pane's tab, takes the room above or below the words, never covers them; a sticky tab's title is centred under the heavy rule; focus is kept clear of the tab. - Alt+h / Alt+l: the pane opened from (left) / one opened from this one (right); Alt+k / Alt+j (Alt+↑ ↓, [ ]): above / below in the column; from a node, a selection or an article; in the pane menu. - Browser tests (e2e/panes3.spec.ts) with a curve invariant (curveFaults) checked after peeks, scrolls, resizes, folds, a drag and an article arriving. 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
24a048a9f8
commit
0df51493cd
13 files changed
+727
-61
No files matched your search
+23
-1
@@ -19,6 +19,8 @@ export const HELP: [string, [string, string][]][] = [
|
||||
["P", "in panes: pin or unpin the active pane (or its pin, top right). A pinned pane stays where it is when a pane it came from closes, is never replaced by a Shift open, and is never covered, in its column or along the strip"],
|
||||
["Enter l", "in panes: open into the next column, beside what is open there (so does a click, and a Ctrl-, Cmd- or middle click); on something open already, focus it"],
|
||||
["Shift+Enter", "in panes: open in place of the focused branch's pane in the next column (so does a Shift-click)"],
|
||||
["Alt+h Alt+l", "in panes: the pane this one was opened from (left) / one opened from it (right): the one opened from the focused row or link if it is open, else the one last visited; from a node, a selection or an article alike. Left then right comes back"],
|
||||
["Alt+k Alt+j", "in panes: the pane above / below in the same column, across forks (Alt+↑ ↓ and [ ] too)"],
|
||||
["[ ]", "in panes: the pane above / below in the same column (back where you were in it, or at its head); at the top or bottom nothing moves. A crowded column stacks its panes as the strip stacks columns, covered to a tab; resting the mouse on a covered pane peeks it out; its grip or tab drags it up or down. A faint curve runs from where each pane was opened to its title"], ],
|
||||
],
|
||||
[
|
||||
@@ -154,8 +156,28 @@ interface KeyHooks {
|
||||
verify(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Between panes, whatever the focus (a node, a sentence, an article): Alt with h j k l, or with ↑ ↓.
|
||||
* By the key's place on the keyboard (e.code), so a layout or Option producing another letter still works.
|
||||
*/
|
||||
const PANE_KEYS: Record<string, () => void> = {
|
||||
KeyH: () => store.paneSide(-1),
|
||||
KeyL: () => store.paneSide(1),
|
||||
KeyK: () => store.focusFork(-1),
|
||||
KeyJ: () => store.focusFork(1),
|
||||
ArrowUp: () => store.focusFork(-1),
|
||||
ArrowDown: () => store.focusFork(1),
|
||||
};
|
||||
|
||||
export function handleKey(e: KeyboardEvent, hooks: KeyHooks) {
|
||||
if (!store.ready || isTyping(e) || e.metaKey || e.ctrlKey || e.altKey) return;
|
||||
if (!store.ready || isTyping(e) || e.metaKey || e.ctrlKey) return;
|
||||
if (e.altKey) {
|
||||
const go = !e.shiftKey && store.mode === "normal" ? PANE_KEYS[e.code] : undefined;
|
||||
if (!go) return;
|
||||
e.preventDefault();
|
||||
store.t0 = { what: `A-${e.code}`, at: e.timeStamp };
|
||||
return go();
|
||||
}
|
||||
const k = e.key;
|
||||
const done = () => {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in new issue
Block a user