Skip to content
Component installs need the registry setup
VegaStack Design

page-editor-01

A Notion-style document page with comments beside the text — outline rail, comment highlights, a comment margin or popover, and version history.

Last updated

Saved
BL

Kitchen circuit

The kitchen runs on its own circuit. Use a 25 A breaker for the cooker and keep the panel labelled.

Isolate the supply before opening the panel.

Wiring

Brown to L, blue to N, green-yellow to earth.

Cable sizes
  • Cooker: 6 mm²
  • Sockets: 2.5 mm²

Sign-off

Ask Bo to check the RCD before the inspection.

What it is

A document page. The header holds the breadcrumb, the save state ("Saved" / "Saving…"), who else is editing (AvatarGroup of PersonAvatars), the open-comment count, the version history button and a ⋯ menu. An outline rail (from TextEdit's onOutlineChange, hidden on narrow screens) jumps to headings with scrollToHeading. The page is a TextEdit variant="document" with comment highlights (annotations); selecting text offers Comment. On wide screens the threads sit beside the text in a CommentMargin; below that the active thread opens in a CommentPopover. The history button opens a Sheet with a VersionList, a DiffView against the page as it is now, and "Restore this version". It is a block: you pull it once with shadcn add, and then you own it. Sample state only.

Install

npx shadcn@latest add @vegastack/page-editor-01
Registry setup required
Run this command only after configuring the Base UI shadcn project, the @vegastack registry namespace, and the Cloudflare Access service-token headers in Install from the VegaStack registry.

This installs the block's own files plus the components it composes: app-shell, avatar, breadcrumb, button, comment-margin, comments, diff-view, dropdown-menu, person-avatar, sheet, text-edit, use-media-query, version-list.

Preview

Saved
BL

Kitchen circuit

The kitchen runs on its own circuit. Use a 25 A breaker for the cooker and keep the panel labelled.

Isolate the supply before opening the panel.

Wiring

Brown to L, blue to N, green-yellow to earth.

Cable sizes
  • Cooker: 6 mm²
  • Sockets: 2.5 mm²

Sign-off

Ask Bo to check the RCD before the inspection.

Anatomy

  • Header: Breadcrumb, the save state (role="status"), AvatarGroup, the comment count button, the history button, a DropdownMenu.
  • Outline rail: headings from onOutlineChange, each a ghost Button calling handleRef.scrollToHeading.
  • Page: TextEdit with annotations, activeAnnotationId, onAnnotationClick, onCreateAnnotation, onAnnotationsLayout, autosave.
  • Comments: CommentMargin of CommentThreads at min-width: 80rem, else CommentPopover.
  • History: Sheet › VersionList + DiffView, "Restore this version" in the footer.

Files

FileRegistry typeTarget
page-editor-01/components/page-editor.tsxregistry:componentapp/page-editor-01/components/page-editor.tsx
page-editor-01/page.tsxregistry:pageapp/page-editor-01/page.tsx

Do / Don't

Do
Persist moved anchors from onAnnotationsLayout with the next save, and flush() before creating a comment.
Don't
Write comments into the Markdown, or re-resolve anchors on every keystroke.

On this page