Commit graph

2 commits

Author SHA1 Message Date
Johannes Millan
73487e5c17 feat(document-mode): Notion-style UX (gutter, bubble menu, block menu)
Layer Notion-like interaction on top of the TipTap editor:
- Block hover gutter on the left margin with `+` (insert below + open
  slash menu) and `⋮⋮` (select node and open block menu) buttons.
- Bubble menu on text selection with Bold / Italic / Strike / Code
  (via @tiptap/extension-bubble-menu).
- Slash menu shows icons next to labels, supports keyboard nav, and
  now includes bullet list, numbered list, quote, code block, and
  divider in addition to paragraph / headings / new task.
- Block menu (from ⋮⋮) offers turn-into for paragraph + H1-H3,
  duplicate, and delete.
- Tighter CSS — Material Icons via Google Fonts, cleaner spacing
  matching Notion-style density, selectednode highlight on taskRef.
2026-05-21 17:34:13 +02:00
Johannes Millan
d429900665 feat(document-mode): add TipTap-based document-mode plugin (POC)
A bundled plugin that replaces the work-view task list with a TipTap
editor for projects and the TODAY tag. Task references are read-only
chips with a checkbox; everything else is normal ProseMirror content
(paragraphs, headings, dividers) plus a simple slash menu for inserts.

- Iframe plugin scaffolded under packages/plugin-dev/document-mode with
  esbuild bundling. The editor.js bundle is inlined into index.html
  because the blob-URL iframe can't resolve relative scripts.
- background.ts registers a work-context header button with
  showFor: ['PROJECT', 'TODAY']; click calls showInWorkContext().
- editor.ts: TipTap (core + StarterKit + Placeholder) with a custom
  taskRef atom node-view (checkbox + title from getTasks() cache).
  Subscribes to WORK_CONTEXT_CHANGE for nav and ANY_TASK_UPDATE for
  title/done-state refresh. Persists per-ctx ProseMirror JSON inside
  the existing single plugin blob ({ docs: { [ctxId]: doc } }) with
  5 s debounced save and a pagehide flush.
- Plugin auto-bundled by packages/plugin-dev/scripts/build-all.js and
  registered in BUNDLED_PLUGIN_PATHS.

Out of scope for the POC (documented in the plan): inline-editable
task titles, keyed persistDataSynced API, removal of in-tree
document-mode, data migration, Electron beforeUnload hook.
2026-05-21 17:22:31 +02:00