Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
f953b17
chore(spike): scaffold lunora outline Phase 0
cameronapak Jul 23, 2026
6a171dd
feat(spike): nodes schema, wholeOutline shape, auth shard gate
cameronapak Jul 23, 2026
c840ad1
feat(spike): pure outline planners + chain invariant tests
cameronapak Jul 23, 2026
d5d7118
feat(spike): structural mutators + minimal multi-tab outline UI
cameronapak Jul 23, 2026
73d46b2
docs(spike): record Phase 0 commit hashes in HANDOFF
cameronapak Jul 23, 2026
78cca68
docs(spike): record Phase 0 code-review outcomes in HANDOFF
cameronapak Jul 23, 2026
a4bf137
docs(spike): record Phase 0 manual exit-criteria PASS
cameronapak Jul 23, 2026
f942321
docs(spike): mark Phase 0 manual exit criteria PASS
cameronapak Jul 23, 2026
1b99bce
feat(spike): shared mapping, TreeIndex bridge, empty-outline seed
cameronapak Jul 23, 2026
fc7654a
docs(spike): record Phase 1 bridge commit hash in HANDOFF
cameronapak Jul 23, 2026
0b8b3a7
docs(spike): include Phase 1 docs commit in HANDOFF list
cameronapak Jul 23, 2026
e16cd6e
fix(spike): server-authoritative seedIfEmpty for multi-tab idempotency
cameronapak Jul 23, 2026
1604c8f
docs(spike): record seedIfEmpty fix commit in HANDOFF
cameronapak Jul 23, 2026
40a5004
docs(spike): record seedIfEmpty fresh-user smoke PASS
cameronapak Jul 23, 2026
d3558fc
docs(adr): adopt Lunora for outline sync (0055)
cameronapak Jul 23, 2026
02e69c9
docs(adr): lock identity, e2e, and kv cutover choices in 0055
cameronapak Jul 23, 2026
d8d617d
refactor(outline): lift shared Lunora planners into src/data/outline-…
cameronapak Jul 23, 2026
6124e26
feat(worker): compose Lunora SHARD DO beside UserOutlineDO
cameronapak Jul 23, 2026
483eaea
docs: record Phase-2 planner lift and Lunora Worker compose
cameronapak Jul 23, 2026
54143f4
feat(lunora): flag-gated outline sync via shapes and mutators
cameronapak Jul 23, 2026
8fb0b97
docs: handoff phase-2-flag-swap for lunora sync
cameronapak Jul 23, 2026
27eb09d
feat(lunora): widen mutator parity for editor dogfood path
cameronapak Jul 23, 2026
4609a05
feat(lunora): restoreNodes + mirrorNode mutators for flag-ON history/…
cameronapak Jul 23, 2026
bbeecb2
feat(lunora): multi-select, daily, and resolveMirror flag-ON mutators
cameronapak Jul 23, 2026
b4974de
docs: handoff close multi-select/daily/resolveMirror gaps
cameronapak Jul 23, 2026
0983113
feat(lunora): appendChild, importNodes, and phase-2b kv tables
cameronapak Jul 23, 2026
52cba4a
docs: handoff close quick-add/OPML/KV phase-2b gaps
cameronapak Jul 23, 2026
1648bdb
feat(lunora): dailyIndex + claimDailyMapping for flag-ON claims
cameronapak Jul 23, 2026
39e226e
feat(lunora): one-shot classic DO → Lunora migrate path
cameronapak Jul 23, 2026
2a3051f
test(e2e): seedOutlineLunora fixture + lunora-sync smoke
cameronapak Jul 23, 2026
6d64bc5
docs: handoff migrate runbook and cutover gaps
cameronapak Jul 23, 2026
70f80a0
feat(mcp): remount outline tools onto Lunora when LUNORA_OUTLINE=1
cameronapak Jul 23, 2026
9f3a050
test(e2e): expand Lunora fixture with structural and undo specs
cameronapak Jul 23, 2026
380c83c
docs(e2e): note lunora-*.spec.ts run command on smoke file
cameronapak Jul 23, 2026
446cd35
fix(lunora): live-nodes reads for flag-ON selection, daily, paste
cameronapak Jul 23, 2026
5d90aa1
test(e2e): dual-path seedOutline Lunora via E2E_LUNORA=1
cameronapak Jul 23, 2026
dc6b042
docs: handoff Lunora e2e matrix and default-ON blockers
cameronapak Jul 23, 2026
4d7de4f
fix(dev): proxy Lunora and API WebSocket upgrades
cameronapak Jul 23, 2026
fe1c4a3
fix(lunora): trust Vite origin for CSRF/CORS on /_lunora
cameronapak Jul 23, 2026
d676f8f
docs: record Lunora dogfood results
cameronapak Jul 23, 2026
2d1f231
test(e2e): skip classic-wire asserts under E2E_LUNORA
cameronapak Jul 23, 2026
5906485
fix(lunora): persist confirmed subtree deletes
cameronapak Jul 23, 2026
24b41be
docs: handoff Lunora dogfood green + e2e matrix
cameronapak Jul 23, 2026
0db73ab
docs: mark dual-path e2e done on Lunora handoff
cameronapak Jul 23, 2026
f9e738b
test(e2e): await Lunora remove before reload
cameronapak Jul 23, 2026
342323c
feat(scripts): add local MCP OAuth mint and dev plan comp
cameronapak Jul 23, 2026
0a62090
fix(e2e): wait for Lunora poke after seeded navigation
cameronapak Jul 23, 2026
b94d865
feat(lunora): default outline sync ON for client and Worker
cameronapak Jul 23, 2026
51599b4
chore: remove branch HANDOFF before Lunora cutover PR
cameronapak Jul 23, 2026
b956ae5
fix(lunora): wipe shard on delete, gate shell until migrate
cameronapak Jul 23, 2026
c0d7b86
feat(lunora): opt-in beta via synced account-prefs
cameronapak Jul 23, 2026
854282f
fix(lunora): hold typed text across missed shape pokes
cameronapak Jul 24, 2026
6b16039
chore: add changeset for Lunora typing-hold fix
cameronapak Jul 24, 2026
0d03db0
chore: remove superseded Lunora outline spike
cameronapak Jul 24, 2026
cafcc61
chore: collapse Lunora branch changesets into one
cameronapak Jul 24, 2026
e033f01
fix(lunora): address CodeRabbit review on PR #310
cameronapak Jul 24, 2026
22ba774
fix(lunora): harden beta toggle, undo gate, and shard RPC decode
cameronapak Jul 24, 2026
510520c
chore(mobile-bar): add temporary keyboard geometry readout
cameronapak Jul 24, 2026
19aeace
fix(mobile-bar): measure the keyboard anchor instead of computing it
cameronapak Jul 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lunora-opt-in-beta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"dotflowy": minor
---

Opt-in experimental outline sync in Settings (classic sync stays the default; preference syncs across devices). Fixes typed text vanishing after a Settings round-trip, and big-delete / mirror-instance delete on the beta path. More menu lists actions first and restores Copy as Markdown; Settings no longer names the sync engine.
5 changes: 5 additions & 0 deletions .changeset/mobile-bar-keyboard-anchor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"dotflowy": patch
---

The mobile editing toolbar and quick-add panel now stay put above the keyboard. They could previously sit behind it when you edited a bullet near the bottom of a long page, or drift up the screen mid-session, because iOS Safari moves the reference point they were positioned against as its own chrome resizes.
6 changes: 6 additions & 0 deletions .dev.vars.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ INVITE_CODES=dev-invite
# STRIPE_SECRET_KEY=sk_test_replace-me
# STRIPE_WEBHOOK_SECRET=whsec_replace-me

# Lunora MCP outline store (ADR 0055). Optional **force** for local MCP/browser
# dogfood — not the production default (users opt in via Settings).
# LUNORA_OUTLINE=1 forces MCP onto the Lunora shard; 0|false|off forces classic
# UserOutlineDO. Unset → per-user `account-prefs` / lunora-beta on classic DO.
# LUNORA_OUTLINE=1

# Optional: pin the OAuth issuer the MCP discovery metadata advertises (ADR
# 0026). Needed to test the MCP OAuth flow against `wrangler dev` — without it
# the dev proxy's custom-domain simulation makes the inferred origin the prod
Expand Down
3 changes: 2 additions & 1 deletion .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
".wrangler/**",
"dist/**",
"src/routeTree.gen.ts",
"landing/src/routeTree.gen.ts"
"landing/src/routeTree.gen.ts",
"lunora/_generated/**"
],
"sortTailwindcss": {
"stylesheet": "./src/styles.css",
Expand Down
6 changes: 5 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@
"env": {
"builtin": true
},
"ignorePatterns": ["src/routeTree.gen.ts", "landing/src/routeTree.gen.ts"]
"ignorePatterns": [
"src/routeTree.gen.ts",
"landing/src/routeTree.gen.ts",
"lunora/_generated/**"
]
}
11 changes: 9 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Inline Tailwind classes, not a separate CSS file (separate CSS only for the view

A mobile-only, keyboard-anchored action strip ([ADR 0030](./docs/adr/0030-mobile-actions-bar.md)) — `MobileActionsBar` (`MobileActionsBar.tsx`), mounted once inside `OutlineEditor`, self-gating on pointer type. Six buttons: `[outdent][indent] | [undo][redo] | [complete][/]`. Styled as a floating frosted-glass capsule that blends with (can't remove) iOS's keyboard accessory bar — the ADR argues the shape grammar and the no-dismiss-button / boxed-check de-dups.

- **Three orthogonal signals, kept separate:** presence = `matchMedia("(pointer: coarse)")` (never mounts on desktop), visibility = an outline contentEditable being focused (`findFocusedId()` non-null, which also guarantees every button a target), position = `window.visualViewport` (`useKeyboardViewport`, rAF-throttled; falls back to `bottom:0` + `env(safe-area-inset-bottom)`, **not** `env(keyboard-inset-*)`).
- **Three orthogonal signals, kept separate:** presence = `matchMedia("(pointer: coarse)")` (never mounts on desktop), visibility = an outline contentEditable being focused (`findFocusedId()` non-null, which also guarantees every button a target), position = the **`--kb-inset`** CSS custom property, written on `<html>` by `src/data/keyboard-inset.ts` (`styles.css` holds the `0px` default). **Do NOT compute this lift from a viewport property — measure the anchor.** That module appends a zero-size `position:fixed;bottom:0` probe and reads its `getBoundingClientRect().bottom` against `visualViewport.height`, because iOS Safari moves the box `bottom:0` resolves against: on one iPhone, one keyboard session, `innerHeight` read 526 then 482 while `clientHeight` said 498 and the pre-keyboard band said 590. `innerHeight`, `clientHeight`, and the VirtualKeyboard API's per-focus baseline were each tried and each is right only while the chrome sits where that formula assumed (ADR 0030 rejected alternatives). The hook that used to do this (`useKeyboardViewport`) is deleted; the safe-area pad SUBTRACTS the inset instead of branching on it.
- **Dumb chrome over a facade.** `useMobileBarActions` re-exposes `commands`/`undo`/`redo` as zero-arg methods resolving `findFocusedId()` internally, so the bar inherits `runStructural` atomicity + protected-node guards and adds **no new mutation path**. Buttons are always-enabled; invalid actions no-op with feedback at the row.
- **Every button `preventDefault`s on `onPointerDown`** (keeps the caret/keyboard alive), but the **action fires on `pointerup`, gated by a ~10px movement threshold** so a scroll of the `overflow-x-auto` pill doesn't trigger the button under your finger.
- **The `/` button inserts a literal `/` via `document.execCommand("insertText", false, "/")`** so the row's own `detectSlash`/`useSlashMenu` opens the palette — don't hand-splice the DOM.
Expand Down Expand Up @@ -406,7 +406,7 @@ A distraction-free capture overlay that files a real node in one gesture **witho
- **Third render path.** The surface is a full mini single-node editor (`MiniNodeEditor`) so `#tags`, `[[`links, `/paragraph`, emphasis/highlight/spoiler, folding, and the caret menus all work live. It does NOT fork `ZoomedTitle` — it calls the same shared primitives (`decorate`, `readSource`, `getCaretOffset`, `watchCaretReveal`, `useSlashMenu`, `useMenus`, source-offset copy/cut/paste) the same way, **and renders the same `title:before-text` Seam-F node slots** (the todos checkbox etc.) — but only the PLUGIN slots, and only once the draft is BORN (before born the node is the `PLACEHOLDER_NODE`, so no slot fires against a fake id). **The keymap is curated text-authoring-ONLY:** **Enter = commit & close** (toast if off-page), **Cmd+Enter = commit & next**, Escape=close, plus all Seam-D formatting keymaps EXCEPT `Mod+Enter` — which quick-add claims for commit&next, so the mini-editor DROPS both title-path `Mod+Enter` behaviors (inline-link-open + todos toggle-task); todo toggle stays on `/todo`+`Mod+D`, and the drop is scoped to `MiniNodeEditor` (OutlineRow/ZoomedTitle keep their bindings). **Structural nav is suppressed by construction** (no indent/outdent/move/zoom/cross-bullet-arrow/expand-collapse wiring), and the `/` palette filters out `move`/`mirror`/`delete`/`send-to-today`/`mirror-to-today`. This is the bullet→title→**mini-editor** three-path trap: a new bullet key/caret/**slot** interaction no-ops here until added. `ctx.mutations` is a minimal `NodeCommands` acting on the single draft (structural methods are unreachable no-ops).
- **Born on first keystroke, discard-if-empty.** No node exists until you type; each capture is a self-contained `DraftState` whose node is created (one `runStructural`, one undo point) at the destination's **bottom** on the first non-empty input. An untouched or fully-cleared capture leaves NOTHING (born-then-emptied → dropped). **Enter = commit & CLOSE** (files the single node, dismisses the overlay; if the destination isn't the current zoom root, a sonner `toast` "Added to {label}" with a **"Go there"** action zooms there — copies daily's "Send to Today" / move-dialog "Go"). **Cmd+Enter = commit & next** (snapshots the draft into the session list, starts a fresh draft, resets the destination to Today — the burst path; the session list is only meaningful here now). **Esc closes** (keeps a non-empty draft — commit-immediately). Each capture is a sibling in the chronological Today log.
- **Destination = Seam L, lazy + seed-free.** The default is resolved through the new **capture-destination seam** (below), daily-filled with today's note. Resolution is **lazy** — Today is get-or-created only at born, so opening + abandoning mints nothing. The inline `Today ▾` chip retargets the current draft via `MoveDialogInner`'s Fuse search reused inline (`CaptureTargetPicker`, no modal-over-modal); unborn drafts swap resolver, born drafts live-move (one `runStructural`). Per-row relocate in the session list is one `runStructural` each.
- **Reach.** Desktop: the bare **`q`** hotkey (Todoist parity, a global capture-phase keydown registered like Cmd+K, NOT the title keymap) + a Cmd+K "Quick add" action (`command-actions.tsx`). `q` fires only when you're NOT typing — guarded on no modifier, `activeElement` not a contentEditable/input/textarea/select, and no `[role="dialog"]` open — so typing "q" in a bullet is untouched. It **replaced `Opt+Cmd+N`**, which browsers and macOS (incl. the in-app browser) swallow. **No new header button.** Mobile: `QuickAddFab` (coarse-pointer only via `useCoarsePointer()` — the shared `src/hooks/use-coarse-pointer.ts` seam the mobile bar also uses; shown when NOT editing and the overlay is closed), the overlay keyboard-anchored via `useKeyboardViewport()` — the ADR 0030 presence/visibility/position discipline.
- **Reach.** Desktop: the bare **`q`** hotkey (Todoist parity, a global capture-phase keydown registered like Cmd+K, NOT the title keymap) + a Cmd+K "Quick add" action (`command-actions.tsx`). `q` fires only when you're NOT typing — guarded on no modifier, `activeElement` not a contentEditable/input/textarea/select, and no `[role="dialog"]` open — so typing "q" in a bullet is untouched. It **replaced `Opt+Cmd+N`**, which browsers and macOS (incl. the in-app browser) swallow. **No new header button.** Mobile: `QuickAddFab` (coarse-pointer only via `useCoarsePointer()` — the shared `src/hooks/use-coarse-pointer.ts` seam the mobile bar also uses; shown when NOT editing and the overlay is closed), the overlay keyboard-anchored via the `--kb-inset` custom property — the ADR 0030 presence/visibility/position discipline.
- **Destination picker = an anchored popover, not an inline swap.** The `Today ▾` chip (and each session row's destination button) opens the `CaptureTargetPicker` in a Base UI `Popover` (`src/components/ui/popover.tsx`) anchored to the trigger and origin-aware (`--transform-origin`), so picking never reflows the capture text. Base UI knows the popover is a child popup of the Quick-add Dialog, so the dialog's focus trap still lets the picker input take focus. The **keyboard-shortcut legend is fine-pointer only** (`!useCoarsePointer()`) — meaningless on a software keyboard.

## Plugins (`src/plugins`)
Expand Down Expand Up @@ -546,7 +546,14 @@ Screenshots **cannot capture view-transition overlays** (they show the settled D
- Landing accents should match the app palette — do not introduce colors (e.g. blue accent) that aren't used in the Dotflowy app.
- On the landing page, keep feature/list bullets vertical even on desktop — no horizontal bullet rows.
- Landing import copy should mention Workflowy import alongside OPML (most visitors don't know what OPML is).
- When grilling or design options are presented, pick the best reasonable option without waiting — favor robustness and best practices, balanced against not over-optimizing low-value work.
- Prefer deepening Effect TS and XState usage where they fit.
- In Cursor, prefer Cursor Auto or Cursor Grok 4.5 for implementation subagents.
- Lunora sync must stay opt-in (user-facing beta/settings flag); do not force a production cutover while Lunora is alpha.
- User-facing Settings/beta copy must not name Lunora — frame it as an upgraded/experimental sync option users can try (helps improve Dotflowy; they still own their data).

## Learned Workspace Facts

- Marketing site lives in the separate `landing/` package (`dotflowy-landing`) at dotflowy.com; the app SPA is at app.dotflowy.com.
- Lunora (`anolilab/lunora`) is the experimental outline-sync path behind synced `account-prefs`/`lunora-beta` (mirrors localStorage `dotflowy:flag:lunora-sync`) and Worker `LUNORA_OUTLINE`; classic per-user DO remains the default.
- Vite proxies for `/api` and `/_lunora` need explicit `ws: true` — string shorthand does not upgrade WebSockets and blocks Lunora dogfood on "Loading outline".
Loading
Loading