Notes show in full the moment they're picked; arrowing joins no rooms (#150) #243

Closed
kayg wants to merge 0 commits from issue/150-instant-arrow into dev
Owner

Closes #150. Profile and numbers are on the issue.

What changes

  • One editor stays on the page. A picked note is drawn at once from its remembered text, read-only (NoteEditor.preview; preview to preview swaps the text in place). Its live document is attached (NoteEditor.attach) after the selection rests 150 ms (keyboard) or at once (mouse), and only once the room has caught up. A preview refuses every change; clicking or typing into it attaches the live note first. Only the room's document is ever edited (ADR 0020).
  • lib/peek.ts: remembered text in memory (400) and IndexedDB (2,000), marked stale by the journal, forgotten on sign-out. The list asks for 60 notes ahead in the direction of travel, 10 behind, and the rows on screen.
  • notes.peek (server): up to 50 notes' text in one request, from the open room or the file. Never opens a room. Contract and web types are regenerated.
  • An arrow walk writes the address once the steps stop, as one history entry.
  • Per-switch savings: the notes-meta IndexedDB is opened once per page; a file index for link lookups; the clouds repaint only when the light changes.
  • Opening with the mouse or a tap now uses the same 140 ms ease-out opacity fade as swapTabs (#173), on the text only. The keyboard never animates. The phone's rise-in on note open is gone as well.

Tests

  • Editor unit tests: a preview refuses typing and dispatches, a preview swaps in place, attach rebuilds from the document, the caret is kept, no block controls on a preview.
  • Server: peek reads files without opening rooms, returns an open room's live text, and is capped at 50.
  • e2e switching.spec.ts: every frame of an arrow walk shows the picked note in full; typing after the walk lands exactly once; a note changed elsewhere shows its new text; the mouse fade is opacity only (≤150 ms) and the keyboard never fades. An @perf test holds ↓ for 3 s, including a 2,000-line note.

Not done: images aren't drawn by the editor yet, so there's nothing to pre-decode.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Closes #150. Profile and numbers are on the issue. **What changes** - One editor stays on the page. A picked note is drawn at once from its remembered text, read-only (`NoteEditor.preview`; preview to preview swaps the text in place). Its live document is attached (`NoteEditor.attach`) after the selection rests 150 ms (keyboard) or at once (mouse), and only once the room has caught up. A preview refuses every change; clicking or typing into it attaches the live note first. Only the room's document is ever edited (ADR 0020). - `lib/peek.ts`: remembered text in memory (400) and IndexedDB (2,000), marked stale by the journal, forgotten on sign-out. The list asks for 60 notes ahead in the direction of travel, 10 behind, and the rows on screen. - `notes.peek` (server): up to 50 notes' text in one request, from the open room or the file. Never opens a room. Contract and web types are regenerated. - An arrow walk writes the address once the steps stop, as one history entry. - Per-switch savings: the notes-meta IndexedDB is opened once per page; a file index for link lookups; the clouds repaint only when the light changes. - Opening with the mouse or a tap now uses the same 140 ms ease-out opacity fade as `swapTabs` (#173), on the text only. The keyboard never animates. The phone's rise-in on note open is gone as well. **Tests** - Editor unit tests: a preview refuses typing and dispatches, a preview swaps in place, attach rebuilds from the document, the caret is kept, no block controls on a preview. - Server: peek reads files without opening rooms, returns an open room's live text, and is capped at 50. - e2e `switching.spec.ts`: every frame of an arrow walk shows the picked note in full; typing after the walk lands exactly once; a note changed elsewhere shows its new text; the mouse fade is opacity only (≤150 ms) and the keyboard never fades. An `@perf` test holds ↓ for 3 s, including a 2,000-line note. Not done: images aren't drawn by the editor yet, so there's nothing to pre-decode. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Notes show in full the moment they're picked; arrowing joins no rooms (#150)
Some checks failed
CI / web (pull_request) Failing after 29s
CI / rust (pull_request) Successful in 1m55s
757b7bbe94
Holding ↓ in the list used to mount a new editor per note, open two
IndexedDB databases, join and leave a room, and only then draw the text:
title-only or blank frames all the way down. Now:

- One editor stays on the page. A picked note is drawn at once from its
  remembered text, read-only (preview to preview swaps the text in place,
  no new editor state). Its live document is attached once the selection
  rests (150 ms from the keyboard, straight away with the mouse), after
  the room has caught up, so the text never steps back. Only the live
  document is ever edited: a preview refuses every change, and clicking
  or typing into it attaches the live note first.
- Remembered text (lib/peek.ts): memory plus this device, bounded, kept
  fresh by the journal. The list asks for the notes ahead of the
  selection (60 in the direction of travel, 10 behind) and on screen;
  missing ones go out in one `notes.peek` request.
- `notes.peek` (server): up to 50 notes' text at once, from the open
  room or the file. Never opens a room.
- An arrow walk is one history entry, written once the steps stop.
- Smaller costs on every switch: the notes metadata database is opened
  once per page; links resolve through a file index instead of scanning
  every note; the sky's clouds repaint only when the light changes, not
  every minute.
- Opening a note with the mouse or a tap is a quick 140 ms opacity fade
  on the text, no movement (kayg). The keyboard never animates.

Tests: editor unit tests for preview/attach; server tests for peek;
e2e: every frame of an arrow walk shows the picked note in full, typing
after the walk lands once, a note changed elsewhere shows its new text,
the mouse fade is opacity only; an @perf test holds ↓ for 3 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Landed in merge train #265.

Landed in merge train #265.
kayg closed this pull request 2026-10-14 12:13:45 +00:00
Some checks failed
CI / web (pull_request) Failing after 29s
CI / rust (pull_request) Successful in 1m55s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!243
No description provided.