Skip to content

CreatorTrack /app app segments

LIVE on prod 2026-07-06 (merge d710dda-era; migration applied to prod DB). Typing /app in any page body opens a three-step picker (installed app, tab, segment) and inserts an app_segment block that mounts a live piece of that app inline. Post-merge fix: toast API standardized the same day (no position, no pos tone); segments adapted.

Architecture

  • Block type app_segment, props { appId, appTab, segment }. DB migration widens blocks_type_check (db/migrations/20260707T000352). Wire type passes through lib/block-types.ts unchanged.
  • Registry metadata: components/workspace/blocks/appSegmentDefs.ts (pure module, server-safe). Client component map: components/workspace/blocks/AppSegmentBlock.tsx (next/dynamic, ssr:false). Adding a segment = one defs entry + one dynamic entry + the segment component.
  • Picker: components/workspace/blocks/AppSegmentPicker.tsx, anchored-floating (PagePicker pattern), keyboard nav, Backspace/ArrowLeft walks back a step. Filters to apps installed in the workspace (useInstalledApps) AND present in the registry.
  • Slash entry: SLASH_ONLY_DEFS type app_insert, alias app (exact-match rank). SLASH_MENU_DEFS picks Basic slash-only entries BY INDEX; a new Basic entry must be added there explicitly.
  • Segments are self-contained: they fetch via the app's normal REST routes (useSegmentTasks hook wraps GET /api/tasks), never reach into the app's client state. Quadrant-drop mapping mirrors TasksClient.moveTaskToQuadrant verbatim.
  • Chrome css: ws-appseg* classes at the end of app/(suite)/workspace.css; segments import their app's global css (e.g. tasks.css) themselves.

Shipped segments (Tasks app)

Add task (full Composer incl. attachments), Today list, Eisenhower Matrix (drag between quadrants, Peek on row click), Add project.

Gotchas

  • Read-only surfaces render a labeled card via BlockRenderer (no live mount).
  • Dev-slot reaper deleted the whole worktree mid-session when >4 slots ran (over-cap reap ignores idle time); the branch survived because work was committed. Commit early in parallel slots.

URL: https://mkdocs.justinsforge.com/memory/general/reference_creatortrack_app_segments/