Bullet-journal tree lines for nested lists; mockup catches up with next (#133) #176

Closed
kayg wants to merge 0 commits from issue/133-tree-lines into dev
Owner

Closes #133.

Tree lines (editor, default mode)

  • packages/editor/src/lists/shape.ts: pure shape per list line (depth, guides passing through, ├/└, stem under a parent). No DOM; the mockup imports the same file (@calternal/editor/lists/shape).
  • packages/editor/src/lists/tree-lines.ts: the CodeMirror extension, in the default-mode compartment only (source mode shows the raw file). Per-line decorations with fixed geometry; an item's leading spaces are drawn as one atomic spacer of depth × 24px, so every level is one step and nothing reflows. Wrapped lines hang under the text. Only the list around the drawn lines is read (capped at 4,000 lines each way).
  • packages/ui/src/styles/tree.css: the look, shared by app and mockup. 1px soft ink, rounded elbows stopping 4px short of the marker.
  • Motion: a branch from a pointer action (treeGrow annotation, or drag and drop) grows in place; typing, Tab and undo never animate; reduced motion fades.
  • Numbers now sit in the same 26px marker box as dots and boxes (6px in), so all three line up.
  • frontmatterEnd returns at once when the note doesn't start with ---, instead of copying 64 KB on every call.

Mockup: catches up with next (bottom bar icon tabs and warm tooltips, Trash, Versions, passkeys and devices, safe areas, simple icons, shared code from @calternal/ui), shows the tree lines on a deep fixture note ("Packing for Spiti"), and numbers count per level. Rebased on #131's InfoSheet changes.

Tests: packages/editor/test/tree.test.ts (shapes, classification, code blocks, frontmatter, spacer, grow only on pointer), tree-cost.test.ts (coarse guard: <4 ms over a 1,000-item list), apps/web/e2e/tree.spec.ts (branches meet markers, one fixed step, the file stays as typed, typing moves nothing, none in source mode, and a @perf keystroke-to-paint test on a 1,000-item list with the same p95 < 50 ms budget as plain typing).

Evidence (screenshots, frame strip, perf) is on the issue.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Closes #133. **Tree lines (editor, default mode)** - `packages/editor/src/lists/shape.ts`: pure shape per list line (depth, guides passing through, `├`/`└`, stem under a parent). No DOM; the mockup imports the same file (`@calternal/editor/lists/shape`). - `packages/editor/src/lists/tree-lines.ts`: the CodeMirror extension, in the default-mode compartment only (source mode shows the raw file). Per-line decorations with fixed geometry; an item's leading spaces are drawn as one atomic spacer of `depth × 24px`, so every level is one step and nothing reflows. Wrapped lines hang under the text. Only the list around the drawn lines is read (capped at 4,000 lines each way). - `packages/ui/src/styles/tree.css`: the look, shared by app and mockup. 1px soft ink, rounded elbows stopping 4px short of the marker. - Motion: a branch from a pointer action (`treeGrow` annotation, or drag and drop) grows in place; typing, Tab and undo never animate; reduced motion fades. - Numbers now sit in the same 26px marker box as dots and boxes (6px in), so all three line up. - `frontmatterEnd` returns at once when the note doesn't start with `---`, instead of copying 64 KB on every call. **Mockup**: catches up with next (bottom bar icon tabs and warm tooltips, Trash, Versions, passkeys and devices, safe areas, simple icons, shared code from `@calternal/ui`), shows the tree lines on a deep fixture note ("Packing for Spiti"), and numbers count per level. Rebased on #131's InfoSheet changes. **Tests**: `packages/editor/test/tree.test.ts` (shapes, classification, code blocks, frontmatter, spacer, grow only on pointer), `tree-cost.test.ts` (coarse guard: <4 ms over a 1,000-item list), `apps/web/e2e/tree.spec.ts` (branches meet markers, one fixed step, the file stays as typed, typing moves nothing, none in source mode, and a `@perf` keystroke-to-paint test on a 1,000-item list with the same p95 < 50 ms budget as plain typing). Evidence (screenshots, frame strip, perf) is on the issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Every nested list item (bullets, tasks, numbers) branches off its parent's
guide with a soft ├ or └ elbow. Drawn only: the file stays as typed, no
text moves. The shape is worked out in packages/editor (shared with the
mockup), drawn by CSS in packages/ui/styles/tree.css. Each level is one
fixed step: an item's leading spaces are drawn as an atomic spacer, and
wrapped lines hang under the item's text. Default mode only.

A branch that appears from a pointer action grows in place; the keyboard
never animates. frontmatterEnd no longer copies 64 KB per call when a note
has no properties.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Mockup catches up with next, and shows the tree lines (#133)
Some checks failed
CI / rust (pull_request) Failing after 35s
CI / web (pull_request) Failing after 26s
488d55e318
One bottom bar with icon tabs and warm tooltips, Trash, Versions in the
info sheet, passkeys and devices in Settings, safe areas and the centred
card, simple icons. Shared pieces now come from @calternal/ui instead of
local copies. Nested lists draw the same tree lines as the editor, from
the same shape code; a deep fixture note ("Packing for Spiti") shows them.
Numbers now count per level, so a nested list doesn't restart them.

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

Replaced by #190 (the forge doesn't pick up pushes to an open PR).

Replaced by #190 (the forge doesn't pick up pushes to an open PR).
kayg closed this pull request 2026-10-14 08:04:13 +00:00
Some checks failed
CI / rust (pull_request) Failing after 35s
CI / web (pull_request) Failing after 26s

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!176
No description provided.