Viewport

The canvas — where the user sees and edits the page. Lives in packages/sdk/src/chrome/viewport/.

The canvas — where the user sees and edits the page. Lives in packages/sdk/src/chrome/viewport/.

Key files

ComponentCanvasItem

Wraps every rendered node. Renders:

  • Drag handle (TbGripVertical) on hover
  • Selection outline + handles
  • Tooltip via react-tooltip (PAGEHUB_RTT_GLOBAL_ID)
  • Pinning math for component-canvas mode (slot-positioned masters/state cards)

Tooltip rule: never title="" — always data-tooltip-id={PAGEHUB_RTT_GLOBAL_ID}. See .claude/rules/tooltips.md.

NodeBreadcrumb

Top of canvas. Walks the selected node's ancestor chain to ROOT, displays as clickable trail. Click an ancestor to select it. Each item shows:

  • An icon (page / role-derived)
  • The node name (custom.displayName or props.type)

removeParentPrefixes strips redundant prefixes when names cascade (e.g. "Header > Header Container" → "Header > Container").

Page isolation

IsolateAtom (Zedux) holds the currently isolated page id. Header/footer share across pages; only the body of the isolated page renders. hasPageIsolation() is the read.

Related