Help and README for the mouse; review and research keys as buttons
The help has a Mouse and touch section and its lede says to click a sentence; the README says what each surface offers, how it acts (by pressing its key) and what is left to the keys. The review's status line and the research panel's Esc are buttons. The column keeps what the keys bring into view out from under the sticky top bar. 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
32efa17294
commit
fd8fbc4cd7
4 files changed
+39
-4
No files matched your search
@@ -75,6 +75,23 @@ Press `?` for every key. The short version:
|
||||
works too). From the command bar: `/new`, `/open`, `/rename`, `/duplicate`, `/export`,
|
||||
`/import`. All of these are ordinary edits of the library, made in the browser's replica.
|
||||
- Edits are saved as they are made; the top bar says `saved` once the server has them all.
|
||||
- **With a mouse or a finger.** Everything a reader needs is reachable without the keys, and each
|
||||
control names its key, so the mouse teaches the keyboard. A click on a sentence selects it and a
|
||||
small bar over it offers `expand e · define d · why y · example x · challenge c · ask :` and
|
||||
`link w`, with `⋯` for the rest (Copy, Related sections, select less or more); a drag selects
|
||||
words, a double click a word; it works the same in an article's text, without link. A right-click
|
||||
on words, a row, a link, a note or a pane opens what can be done with it, Copy first (Shift+right-
|
||||
click is the browser's own menu); so does the `⋯` beside a row, a pane's pin, a page's byline or a
|
||||
note, shown only when pointed at, and a stale flag. The top bar, which stays at the top, has
|
||||
`undo`, `redo` when there is something to redo, and `menu` (documents, jump, history, links,
|
||||
layout and settings). Keys named in the status line or a panel's head are buttons. On a phone the
|
||||
bar sits at the foot of the screen and menus rise from it. Every item acts by pressing its key
|
||||
(`src/ui/press.ts`), so a click and a key cannot do different things. The first visit says, once,
|
||||
in the status line, that a click on a sentence offers actions and `?` lists the keys. Left to the
|
||||
keys: stepping by grain (`j` `k` `i`; a click or a drag goes straight there), `Tab` from mark to
|
||||
mark, `[` `]` up and down a column (a click on a pane does it), and the commands typed at `:`
|
||||
that no menu lists (`/branch`, `/switch`, `/merge`, `/user`, `/link`, …), which the menu's
|
||||
Command line… opens for typing.
|
||||
- On a window 1600 px wide or more the page opens as panes side by side, after Andy Matuschak's
|
||||
notes: the library, the open document, its open sections. `v` switches between panes and the
|
||||
single column, `/view auto|column|panes` sets it.
|
||||
@@ -219,7 +236,9 @@ What is sent where:
|
||||
`wikiRoutes.ts`, `wikiMock.ts`), local embeddings (`embed.ts`), link discovery (`links/`), and
|
||||
migrates data from older layouts (`migrate.ts`).
|
||||
- **`src/ui/`** The browser's replica of the library (`session.ts`, kept in IndexedDB), the store
|
||||
and keymap, and the page. The panes view's panes are a forest of forks (`forks.ts`, pure functions;
|
||||
and keymap, and the page. The mouse acts through the keymap: `actions.ts` builds what the
|
||||
selection bar and the menus offer for each kind of target, every item pressing its key
|
||||
(`press.ts`); `Mouse.tsx` draws the one menu, the bar and the key hints. The panes view's panes are a forest of forks (`forks.ts`, pure functions;
|
||||
the store's `trail` is its focused branch); `stack.ts` is the stacking shared by the strip and its
|
||||
columns, `lanes.ts` orders the curves' lanes.
|
||||
|
||||
|
||||
+8
-3
@@ -167,7 +167,8 @@ function Help() {
|
||||
<h2>Keys</h2>
|
||||
<p class="lede">
|
||||
Focus is a node and a grain. Start on a section, press <kbd>i</kbd> to move by sentence, <kbd>i</kbd> again by word, and <kbd>e</kbd> on
|
||||
anything to go deeper. Text with a dotted underline already has an expansion; anything else is written on request.
|
||||
anything to go deeper. Text with a dotted underline already has an expansion; anything else is written on request. With a mouse, click a
|
||||
sentence; every menu names the key that does the same.
|
||||
</p>
|
||||
<div class="cols">
|
||||
{HELP.map(([head, rows]) => (
|
||||
@@ -336,7 +337,8 @@ function AgentPanel() {
|
||||
<div class="agent-panel" data-agent={run.running ? "running" : "done"}>
|
||||
<div class="agent-head">
|
||||
<span class="agent-label">editor</span>
|
||||
{run.running ? "researching on the web · Esc stops" : "done · Esc closes"}
|
||||
{run.running ? "researching on the web · " : "done · "}
|
||||
<Key k="Escape" what={run.running ? "stop" : "close"} />
|
||||
</div>
|
||||
<ol class="agent-steps">
|
||||
{all.length > steps.length && <li class="agent-more">{all.length - steps.length} earlier steps</li>}
|
||||
@@ -374,6 +376,9 @@ function StatusLine() {
|
||||
const sugg = selecting && store.focusedSuggestion();
|
||||
const commentary = selecting && store.commentaryAt(f.range);
|
||||
const noteHere = selecting && store.noteAt(f.range);
|
||||
// Reviewing suggestions: where the review is, and its keys as buttons.
|
||||
const reviewing: Hint | null =
|
||||
store.mode === "review" && store.status.startsWith("review ") ? [store.status.split(" · y link")[0], ["y", "link"], ["n", "decline"], ["s", "skip"], ["Y", "link all"], ["Escape", "stop"]] : null;
|
||||
const hint: Hint = store.aux
|
||||
? store.aux.kind === "wiki"
|
||||
? store.inArticleText
|
||||
@@ -404,7 +409,7 @@ function StatusLine() {
|
||||
<footer class="status">
|
||||
<span class={`grain ${store.aux ? "aux" : f.grain}`}>{store.preview ? "history" : store.mode === "review" ? "review" : store.aux ? (store.aux.kind === "wiki" ? "article" : store.aux.kind === "back" ? "linked" : "target") : f.grain}</span>
|
||||
<span class="path">{path}</span>
|
||||
<span class="message">{store.status || (hint.length ? <Hints hint={hint} /> : <FirstRun />)}</span>
|
||||
<span class="message">{reviewing ? <Hints hint={reviewing} /> : store.status || (hint.length ? <Hints hint={hint} /> : <FirstRun />)}</span>
|
||||
<span class="right">
|
||||
{store.links.job?.state === "running" && (
|
||||
<span class="job" title={store.jobText(store.links.job)}>
|
||||
|
||||
@@ -21,6 +21,15 @@ export const HELP: [string, [string, string][]][] = [
|
||||
["Shift+Enter", "in panes: open in place of the focused branch's pane in the next column (so does a Shift-click)"],
|
||||
["[ ]", "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"], ],
|
||||
],
|
||||
[
|
||||
"Mouse and touch",
|
||||
[
|
||||
["", "a click on a sentence selects it, and a bar over it offers expand · define · why · example · challenge · ask · link, each with its key (on a phone, at the foot of the screen, × puts it away); a drag selects words, a double click a word"],
|
||||
["", "right-click (a long press on a phone) on words, a row, a link, a note or a pane: what can be done with it, Copy first. Shift+right-click is the browser's own menu"],
|
||||
["", "⋯ by a row, a pane's pin, a page's byline or a note (shown when pointed at): the same menu. A stale flag, clicked, offers what to do about it"],
|
||||
["", "the top bar: undo, redo, and menu: documents, jump, history, links, layout and settings. A key named in the status line or a panel's head is a button that presses it"],
|
||||
],
|
||||
],
|
||||
[
|
||||
"Links",
|
||||
[
|
||||
|
||||
@@ -755,6 +755,8 @@ kbd, .help code { font-family: var(--mono); font-size: 0.86em; border: 1px solid
|
||||
background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax);
|
||||
}
|
||||
.view-panes .docbar { position: relative; box-shadow: none; clip-path: none; background: none; }
|
||||
/* What the keys bring into view is not left under it. */
|
||||
html { scroll-padding-top: 48px; }
|
||||
.docbar .tools { margin-left: auto; display: flex; align-items: baseline; gap: 1.1em; }
|
||||
.docbar .tool { font: inherit; color: var(--dim); background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: 0.02em; }
|
||||
.docbar .tool:hover, .docbar .tool[aria-expanded="true"] { color: var(--fg); text-decoration: underline 1px dotted; text-underline-offset: 0.2em; }
|
||||
|
||||
Reference in new issue
Block a user