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

Closed
opened 2026-10-14 05:17:16 +00:00 by kayg · 5 comments
Owner

kayg (2026-10-14): "can we add indentation lines and branched lines for bullets/sub-bullet points to automatically make any sort of bullet points / their sub bullet points look like a bullet journal? would love to see the mockup updated to the latest/next state and have this indentation / branched lines"

1. Bullet-journal tree lines (editor, default mode)

  • Every list (-, *, +, numbered, and tasks) draws thin indent guides. Each child bullet gets a branch: a curved or square elbow from its parent's guide to its own marker. The last child gets a └, others a ├. This happens automatically, with no syntax and nothing written to the file. The markdown stays exactly as typed.
  • It is drawn purely as decoration and never moves text: no layout shift, and no change to caret or selection behaviour. Undo, IME and hidden syntax work as before.
  • It looks hand-drawn but calm, in an ink tone that follows the theme. Lines grow in place when you indent (springy, physical), and keyboard indent and outdent don't animate (TASTE.md).
  • It is fast on long notes: 1,000-item nested lists, typing at speed with no frame drops. Measure it and add a budget.
  • Source mode: off by default, since source shows the file as it is.
  • Lives in packages/editor as one CodeMirror extension, so the real app and the mockup share it.

2. Mockup catches up with next
Bring apps/mockup up to everything now on next:

  • one bottom bar with icon tabs and warm tooltips (#122)
  • Trash
  • Info sheet changes, Versions
  • passkeys and devices in Settings
  • safe areas and the card centred
  • simple icons

Then show the tree lines in it on fixture notes with deep nesting. Deploy it to preview.calternal.cloud.

kayg (2026-10-14): "can we add indentation lines and branched lines for bullets/sub-bullet points to automatically make any sort of bullet points / their sub bullet points look like a bullet journal? would love to see the mockup updated to the latest/next state and have this indentation / branched lines" **1. Bullet-journal tree lines (editor, default mode)** - Every list (`-`, `*`, `+`, numbered, and tasks) draws thin indent guides. Each child bullet gets a branch: a curved or square elbow from its parent's guide to its own marker. The last child gets a `└`, others a `├`. This happens automatically, with no syntax and nothing written to the file. The markdown stays exactly as typed. - It is drawn purely as decoration and never moves text: no layout shift, and no change to caret or selection behaviour. Undo, IME and hidden syntax work as before. - It looks hand-drawn but calm, in an ink tone that follows the theme. Lines grow in place when you indent (springy, physical), and keyboard indent and outdent don't animate (TASTE.md). - It is fast on long notes: 1,000-item nested lists, typing at speed with no frame drops. Measure it and add a budget. - **Source mode:** off by default, since source shows the file as it is. - Lives in `packages/editor` as one CodeMirror extension, so the real app and the mockup share it. **2. Mockup catches up with next** Bring apps/mockup up to everything now on next: - one bottom bar with icon tabs and warm tooltips (#122) - Trash - Info sheet changes, Versions - passkeys and devices in Settings - safe areas and the card centred - simple icons Then show the tree lines in it on fixture notes with deep nesting. Deploy it to preview.calternal.cloud.
Author
Owner

How others draw nested lists, and what I picked

App What it draws Notes
Logseq One straight vertical line per open block, from under the parent bullet down the left of its children; highlights on hover. No elbows. Calm, but you can't tell the last child from the others.
Workflowy Thin grey vertical lines from each parent bullet down past its children. No elbows. The calmest of the lot; reads as an outline, not a tree.
Tana Same idea as Workflowy, slightly stronger line; bullets carry the weight.
Obsidian Indent guides: a vertical line in each indentation column (live preview draws them on the indentation spaces, reading view as a border on nested lists). No elbows; they follow the raw indent, so 4-space and 2-space lists look different. Needs the indentation to be real text width.
File trees / bullet journals ├ and └ connectors into each child. What kayg asked for.

Picked: the Workflowy-calm hairline, plus the journal's branches. Guides are 1px in a soft ink (--ink-4, about 60–70% so it holds on light and dark), they start a few px under the parent's marker, and each child branches off with a gently rounded elbow (radius 7) that stops 4px short of its dot, box or number. ├ keeps the guide going, └ ends it. Unlike Obsidian, every level is one fixed 24px step whatever the indentation in the file (2 spaces, 4, a tab, or 3 under a number), so guides always meet markers and the file is never touched.

How it's drawn (no reflow, no layout shift):

  • packages/editor/src/lists/shape.ts works out the shape per line (depth, which guides pass through, ├/└, a stem under a parent). Pure, no DOM; the mockup uses the same file.
  • packages/editor/src/lists/tree-lines.ts is the CodeMirror extension (default mode only). Per-line decorations with fixed geometry: a class plus inline CSS custom properties. An item's leading spaces are drawn as one atomic spacer of depth × 24px (known before the line is drawn, so nothing reflows); wrapped lines hang under the item's text.
  • packages/ui/src/styles/tree.css draws it: the guides are background gradients on a ::before, the elbow is a bordered ::after. Shared by the app and the mockup.
  • Motion: a branch that appears from a pointer action (drag to nest, ⋯ → Nest) draws itself in place — down the guide, round the corner, out to the marker with a small overshoot (420ms). Tab, typing and undo never animate (:root[data-input="keyboard"] and the treeGrow annotation). Reduced motion: a 120ms fade.
  • Source mode: no tree lines (the raw spaces are shown there).
**How others draw nested lists, and what I picked** | App | What it draws | Notes | |---|---|---| | Logseq | One straight vertical line per open block, from under the parent bullet down the left of its children; highlights on hover. No elbows. | Calm, but you can't tell the last child from the others. | | Workflowy | Thin grey vertical lines from each parent bullet down past its children. No elbows. | The calmest of the lot; reads as an outline, not a tree. | | Tana | Same idea as Workflowy, slightly stronger line; bullets carry the weight. | | | Obsidian | Indent guides: a vertical line in each indentation column (live preview draws them on the indentation spaces, reading view as a border on nested lists). No elbows; they follow the raw indent, so 4-space and 2-space lists look different. | Needs the indentation to be real text width. | | File trees / bullet journals | `├` and `└` connectors into each child. | What kayg asked for. | Picked: the Workflowy-calm hairline, plus the journal's branches. Guides are 1px in a soft ink (`--ink-4`, about 60–70% so it holds on light and dark), they start a few px under the parent's marker, and each child branches off with a gently rounded elbow (radius 7) that stops 4px short of its dot, box or number. `├` keeps the guide going, `└` ends it. Unlike Obsidian, every level is one fixed 24px step whatever the indentation in the file (2 spaces, 4, a tab, or 3 under a number), so guides always meet markers and the file is never touched. How it's drawn (no reflow, no layout shift): - `packages/editor/src/lists/shape.ts` works out the shape per line (depth, which guides pass through, `├`/`└`, a stem under a parent). Pure, no DOM; the mockup uses the same file. - `packages/editor/src/lists/tree-lines.ts` is the CodeMirror extension (default mode only). Per-line decorations with fixed geometry: a class plus inline CSS custom properties. An item's leading spaces are drawn as one atomic spacer of `depth × 24px` (known before the line is drawn, so nothing reflows); wrapped lines hang under the item's text. - `packages/ui/src/styles/tree.css` draws it: the guides are background gradients on a `::before`, the elbow is a bordered `::after`. Shared by the app and the mockup. - Motion: a branch that appears from a pointer action (drag to nest, ⋯ → Nest) draws itself in place — down the guide, round the corner, out to the marker with a small overshoot (420ms). Tab, typing and undo never animate (`:root[data-input="keyboard"]` and the `treeGrow` annotation). Reduced motion: a 120ms fade. - Source mode: no tree lines (the raw spaces are shown there).
Author
Owner

Real editor (apps/web, real server): nested lists 4–5 levels deep, bullets, tasks and numbers mixed, a wrapped item. Chromium and WebKit, 1440 and 390.

light: chromium 1440 · webkit 1440 · chromium 390 · webkit 390

chromium-1440-light.png webkit-1440-light.png chromium-390-light.png webkit-390-light.png

dark: chromium 1440 · webkit 1440 · chromium 390 · webkit 390

chromium-1440-dark.png webkit-1440-dark.png chromium-390-dark.png webkit-390-dark.png

**Real editor (apps/web, real server)**: nested lists 4–5 levels deep, bullets, tasks and numbers mixed, a wrapped item. Chromium and WebKit, 1440 and 390. **light:** chromium 1440 · webkit 1440 · chromium 390 · webkit 390 ![chromium-1440-light.png](https://git.kayg.org/attachments/90c186d9-2d1f-4e0a-bb02-71a0ca5ae655) ![webkit-1440-light.png](https://git.kayg.org/attachments/33eb2f94-730a-47e4-980f-e0a52e80aa90) ![chromium-390-light.png](https://git.kayg.org/attachments/e59b7682-aa38-4ba1-9a34-1d426612330c) ![webkit-390-light.png](https://git.kayg.org/attachments/c52b17f5-3602-4214-8cbf-df75628ebc87) **dark:** chromium 1440 · webkit 1440 · chromium 390 · webkit 390 ![chromium-1440-dark.png](https://git.kayg.org/attachments/c9f5eaf3-1d75-439b-9dc6-55f29670c8bb) ![webkit-1440-dark.png](https://git.kayg.org/attachments/8ffe207f-86f7-49dd-a429-bad85b161090) ![chromium-390-dark.png](https://git.kayg.org/attachments/8b223d17-cdd3-425e-a27d-543e75bf5d30) ![webkit-390-dark.png](https://git.kayg.org/attachments/05e7b7ef-edd4-4d9a-9ecb-cb77a5f9b157)
Author
Owner

Mockup (deployed to https://preview.calternal.cloud/#/note/spiti-packing?list=all), same tree from the same shape code. Numbers now count per level.

light: chromium 1440 · webkit 1440 · chromium 390 · webkit 390

chromium-1440-light.png webkit-1440-light.png chromium-390-light.png webkit-390-light.png

dark: chromium 1440 · webkit 1440 · chromium 390 · webkit 390

chromium-1440-dark.png webkit-1440-dark.png chromium-390-dark.png webkit-390-dark.png

**Mockup** (deployed to https://preview.calternal.cloud/#/note/spiti-packing?list=all), same tree from the same shape code. Numbers now count per level. **light:** chromium 1440 · webkit 1440 · chromium 390 · webkit 390 ![chromium-1440-light.png](https://git.kayg.org/attachments/2cb3398f-2f4d-4c40-93fd-af171ff380cb) ![webkit-1440-light.png](https://git.kayg.org/attachments/4bdb8993-6e50-4c5a-a0e6-5d0fc18c2f01) ![chromium-390-light.png](https://git.kayg.org/attachments/975c74a6-a935-47bd-9d2a-88c9ee004668) ![webkit-390-light.png](https://git.kayg.org/attachments/90861d67-ac4b-43e5-8d34-eb9214a05dcc) **dark:** chromium 1440 · webkit 1440 · chromium 390 · webkit 390 ![chromium-1440-dark.png](https://git.kayg.org/attachments/37a1d6dc-9de3-4c1d-926b-5918277ec882) ![webkit-1440-dark.png](https://git.kayg.org/attachments/acfcbf36-a963-410f-a324-d9483e1cc788) ![chromium-390-dark.png](https://git.kayg.org/attachments/f21cfd0e-6e1a-4f54-a72b-db7a980df523) ![webkit-390-dark.png](https://git.kayg.org/attachments/6aedff0c-26c8-4740-87a6-7fa449e05045)
Author
Owner

Indent animation (⋯ → Nest with the pointer on "Rain shell"; frames at 0, 50, 100 … 350, 420 ms): the branch runs down the guide, rounds the corner and reaches out to the number with a small overshoot, then settles. Tab makes the same change with no animation (a test checks this).

tree-grow-light

tree-grow-dark

**Indent animation** (⋯ → Nest with the pointer on "Rain shell"; frames at 0, 50, 100 … 350, 420 ms): the branch runs down the guide, rounds the corner and reaches out to the number with a small overshoot, then settles. Tab makes the same change with no animation (a test checks this). ![tree-grow-light](https://git.kayg.org/attachments/bc744317-de47-47a0-8597-e9768b5f4584) ![tree-grow-dark](https://git.kayg.org/attachments/4e1ea4e1-6a97-4485-b337-073296dda3c6)
Author
Owner

Performance (PR #190)

The dev box was heavily loaded the whole time (load average 60–107 on 12 cores, software GL), so absolute numbers are inflated; the before/after pairs ran back to back under the same conditions.

What Before (no tree lines) After Notes
Shape + region scan, 1,000-item nested list, one keystroke (vitest, warmed) — 0.3–0.8 ms (0.8 + 0.35 worst warmed) ~⅓ of buildHidden for a drawn range in the same run; coarse guard <4 ms in tree-cost.test.ts
One typed character in the middle of a 1,000-item list, whole dispatch incl. DOM (Chromium, real app) 101 ms 114 ms Tree code isn't in the top 25 profile entries; the cost is CodeMirror DOM/selection work that was already there (collapse, visitNode)
Keystroke to paint p50 / p95, 1,000-item list, typing at 20 ms (@perf, Chromium) 1216 / 3848 ms 3032 / 7243 ms Input queues up on this box, so these blow up; not a usable number here

Findings:

  • Tree lines add little per keystroke. A 1,000-item list was already slow here before this change (about 100 ms per dispatch on this box), and that cost comes from the editor's existing DOM work, not from the tree.
  • I added the @perf test typing in a 1,000-item nested list stays fast (apps/web/e2e/tree.spec.ts) with the same budget as plain typing (Chromium p95 < 50 ms). It needs a run on the quiet perf machine. On this box both before and after are far over the budget.
  • Small win on the side: frontmatterEnd no longer copies the first 64 KB of the note on every call when the note has no properties (it runs several times per keystroke).

Deploy: the mockup is live at https://preview.calternal.cloud (static build copied to /srv/calternal-preview/site on staging, calternal-preview quadlet restarted so its bind mount sees the new dir). The old site is kept at /srv/calternal-preview/site.bak-133-202610140918.

**Performance** (PR #190) The dev box was heavily loaded the whole time (load average 60–107 on 12 cores, software GL), so absolute numbers are inflated; the before/after pairs ran back to back under the same conditions. | What | Before (no tree lines) | After | Notes | |---|---|---|---| | Shape + region scan, 1,000-item nested list, one keystroke (vitest, warmed) | — | 0.3–0.8 ms (0.8 + 0.35 worst warmed) | ~⅓ of `buildHidden` for a drawn range in the same run; coarse guard `<4 ms` in `tree-cost.test.ts` | | One typed character in the middle of a 1,000-item list, whole dispatch incl. DOM (Chromium, real app) | 101 ms | 114 ms | Tree code isn't in the top 25 profile entries; the cost is CodeMirror DOM/selection work that was already there (`collapse`, `visitNode`) | | Keystroke to paint p50 / p95, 1,000-item list, typing at 20 ms (`@perf`, Chromium) | 1216 / 3848 ms | 3032 / 7243 ms | Input queues up on this box, so these blow up; not a usable number here | Findings: - Tree lines add little per keystroke. A 1,000-item list was already slow here before this change (about 100 ms per dispatch on this box), and that cost comes from the editor's existing DOM work, not from the tree. - I added the `@perf` test `typing in a 1,000-item nested list stays fast` (apps/web/e2e/tree.spec.ts) with the same budget as plain typing (Chromium p95 < 50 ms). It needs a run on the quiet perf machine. On this box both before and after are far over the budget. - Small win on the side: `frontmatterEnd` no longer copies the first 64 KB of the note on every call when the note has no properties (it runs several times per keystroke). **Deploy**: the mockup is live at https://preview.calternal.cloud (static build copied to `/srv/calternal-preview/site` on staging, `calternal-preview` quadlet restarted so its bind mount sees the new dir). The old site is kept at `/srv/calternal-preview/site.bak-133-202610140918`.
kayg closed this issue 2026-10-14 09:05:04 +00:00
Sign in to join this conversation.
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#133
No description provided.