Skip to content

feat(editor): Notion-grade chrome on official MIT Tiptap parts (0297) - #468

Merged
crs48 merged 11 commits into
mainfrom
claude/0297-off-the-shelf-notion-like-editor
Jul 11, 2026
Merged

feat(editor): Notion-grade chrome on official MIT Tiptap parts (0297)#468
crs48 merged 11 commits into
mainfrom
claude/0297-off-the-shelf-notion-like-editor

Conversation

@crs48

@crs48 crs48 commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Implements exploration 0297 (doc): rather than replacing the editor with an off-the-shelf package (none fits our Yjs/ProseMirror document model), this replaces the janky homegrown chrome with Tiptap's official MIT pieces.

What changed

  • One drag handle instead of two. Both homegrown stacks (extensions/drag-handle/ PM-plugin and components/DragHandle/ React-hook, ~1.7k LOC) are deleted in favor of @tiptap/extension-drag-handle(-react) 3.16.0 (MIT since June 2025). Block moves now use ProseMirror-native NodeRangeSelection drags, which map positions through collab transactions instead of the old content-fingerprint heuristic; the drop indicator is the standard dropcursor (.xnet-drop-cursor).
  • tippy.js is gone. The shared suggestion popup (slash, @, [[, #) is rewritten on @floating-ui/dom (fixed strategy + offset/flip/shift + autoUpdate). Verified live: the slash menu flips above the caret at the bottom viewport edge and shifts fully inside the viewport.
  • Vendored MIT UI primitives. Button/Toolbar/Separator primitives + menu-navigation hooks from ueberdosis/tiptap-ui-components (MIT © 2025 Tiptap) live in packages/editor/src/components/ui/ — copied and adapted to our Tailwind tokens, never CLI-managed. FloatingToolbar's local components are now thin adapters over them; both toolbar modes gain roving arrow-key/Home/End navigation. editor-ux-state.ts (mode policy) untouched.
  • Emoji + Mathematics adopted (both MIT since June 2025): : shortcode picker through the shared popup, KaTeX inline/block math. Schema nodes are statically bundled per the extension-tier rule; document-compat gains emoji/inlineMath/blockMath and EDITOR_DOCUMENT_SCHEMA_VERSION bumps to 3. TableOfContents/UniqueID deferred (no consuming surface), ToggleExtension kept over extension-details (nodes don't round-trip) — decisions recorded in the doc.
  • Bug found & fixed during live verification: the DragHandle react wrapper keys plugin registration on computePositionConfig identity — an inline literal caused an infinite React update loop; it must be a module-level constant.

Numbers

  • Net −1,070 LOC in packages/editor/src (907+ / 1,977−).
  • 772 editor tests pass (6 new: emoji filter, doc-compat v3, two-client Yjs round-trip over the new nodes).
  • No tippy.js in the tree; no @tiptap/cli anywhere; every new dependency is MIT.

Removed exports (private pkg, no changeset needed)

DragHandleExtension, DragHandle, DragHandlePluginKey, createDragDropPlugin, DragDropPluginKey, createDropIndicatorPlugin, DropIndicatorPluginKey, DragHandleComponent, DropIndicator, useDragHandle, useDragDrop, useDropIndicator — no consumers outside the package (verified repo-wide). @xnetjs/editor is private: true and changeset-ignored.

Watching brief for BlockNote filed as #466.

🤖 Generated with Claude Code

xNet Test added 9 commits July 10, 2026 15:15
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
…ag stacks

Replaces the two parallel homegrown drag-handle implementations
(extensions/drag-handle PM-plugin stack and components/DragHandle
React-hook stack, ~1.7k LOC) with @tiptap/extension-drag-handle(-react)
3.16.0 (MIT since June 2025), rendered by RichTextEditor itself.

Block moves now go through ProseMirror's native drag machinery
(NodeRangeSelection), which maps positions through collab transactions
instead of the old content-fingerprint heuristic. The drop indicator is
the standard dropcursor, styled via .xnet-drop-cursor.

Removed exports: DragHandleExtension, DragHandle, DragHandlePluginKey,
createDragDropPlugin, DragDropPluginKey, createDropIndicatorPlugin,
DropIndicatorPluginKey (extensions.ts); DragHandleComponent,
DropIndicator, useDragHandle, useDragDrop, useDropIndicator (react.ts).
No consumers outside the package (verified repo-wide).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
Rewrites the shared suggestion-popup renderer (slash commands,
@-mentions, [[wikilinks, #hashtags) on @floating-ui/dom — the stack
Tiptap v3 itself uses — and drops the tippy.js dependency. The popup is
a bare body-level container positioned with fixed strategy +
offset/flip/shift middleware and tracked via autoUpdate, replacing the
tippy 'slash-menu' theme.

Also fixes an infinite React update loop found while verifying: the
DragHandle react wrapper keys its plugin registration on the
computePositionConfig object identity, so it must be a module-level
constant, not an inline literal.

Verified live: slash menu opens at the caret, flips above it at the
bottom viewport edge, and shifts fully inside the viewport.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
…tingToolbar

Vendors the Button/ButtonGroup and Toolbar/ToolbarGroup/ToolbarSeparator
primitives plus their use-menu-navigation/use-composed-ref hooks from
ueberdosis/tiptap-ui-components (MIT (c) 2025 Tiptap) into
packages/editor/src/components/ui/ — copied and adapted (SCSS design
system replaced with our Tailwind tokens, tooltips rendered with
@xnetjs/ui primitives), never CLI-managed.

FloatingToolbar's local ToolbarButton/ToolbarDivider become thin domain
adapters over the vendored primitives, and both toolbar modes now render
through the Toolbar primitive, which adds the roving arrow-key/Home/End
keyboard navigation the homegrown containers lacked. editor-ux-state.ts
(mode policy) is untouched; verified live that the fixed mobile bar
renders 22 buttons through the new primitive.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
Bundles @tiptap/extension-emoji (':' shortcode picker via the shared
Floating UI suggestion popup + new EmojiMenu on the listbox contract)
and @tiptap/extension-mathematics (KaTeX inline/block math) — both MIT
since June 2025. Schema nodes are statically bundled per the
extension-tiers rule; document-compat gains emoji/inlineMath/blockMath
in CURRENT_NODE_TYPES and EDITOR_DOCUMENT_SCHEMA_VERSION bumps to 3.

TableOfContents + UniqueID are deferred (no consuming surface; id-attr
churn risk) and ToggleExtension is kept over extension-details (node
names don't round-trip) — decisions recorded in the exploration doc.

Verified live: ':smi' opens the picker and inserts an emoji node;
insertInlineMath renders through KaTeX.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
… decisions

Adds a two-client Yjs round-trip test spanning emoji/inlineMath/blockMath
plus callout/toggle/wikilink/codeBlock, records the chrome-vs-content
jank inventory and adoption decisions in the exploration, and files the
BlockNote watching brief (#466).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
…helf-notion-like-editor

# Conflicts:
#	.claude/launch.json
@crs48
crs48 temporarily deployed to pr-468 July 11, 2026 19:31 — with GitHub Actions Inactive
no-extra-semi errors from the upstream formatting style.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 temporarily deployed to pr-468 July 11, 2026 19:35 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🖼️ UI changes in this PR

Interactions

🎬 Create a page and use the editor

Create a page and use the editor

▶ Watch MP4

Auto-captured by CI · run. Informational — not a blocking check.

github-actions Bot added a commit that referenced this pull request Jul 11, 2026
The 0297 editor additions pushed the main bundle past workbox's 6 MB
precache cap, failing the PWA build. Manual chunks keep each file under
the cap and cache the heavy leaf libraries independently.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 temporarily deployed to pr-468 July 11, 2026 19:56 — with GitHub Actions Inactive
github-actions Bot added a commit that referenced this pull request Jul 11, 2026
@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Preview removed for PR #468.

github-actions Bot added a commit that referenced this pull request Jul 11, 2026
@crs48
crs48 merged commit fdbce9b into main Jul 11, 2026
16 checks passed
@crs48
crs48 deleted the claude/0297-off-the-shelf-notion-like-editor branch July 11, 2026 20:04
github-actions Bot added a commit that referenced this pull request Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant