Skip to content

feat(viewer): post/surface vocabulary — engine UI, host contract, helper rename (A5)#143

Merged
benvinegar merged 1 commit into
mainfrom
feat/viewer-post-surface-vocab
Jun 25, 2026
Merged

feat(viewer): post/surface vocabulary — engine UI, host contract, helper rename (A5)#143
benvinegar merged 1 commit into
mainfrom
feat/viewer-post-surface-vocab

Conversation

@benvinegar

Copy link
Copy Markdown
Member

What

A5 of the workspace ▸ session ▸ post ▸ surface rename: adopt the post/surface vocabulary throughout the viewer engine, the host contract, and one server helper. A post is the published artifact (an ordered list of surfaces); a surface is one block inside a post.

Builds on #135 (model/store types) and #140 (wire routes + MCP tools). Types were already correct; this is the UI / identifier / label / CSS / host-contract sweep.

Behavior is unchanged — wire strings kept byte-identical

This is an internal rename. Every string that crosses to the server or to embedders is preserved verbatim, so self-hosted behavior is identical:

  • /api/* fetch paths (incl. /api/surfaces/...), /s/ nav URLs, ?part= query key
  • SSE event types surface-created / surface-updated / surface-deleted
  • comment body { surface: <id> } key and author:"surface" value
  • server-provided surfaceCount field; comment fields postId/postTitle
  • the Route.surfaceId field (only the identity slug changes — see below)

Renamed functions that still hit a legacy wire path (e.g. postLink()/s/<id>) carry an inline "legacy wire alias" comment.

Changes

  • Viewer identifiers / props / signals: artifact surfacepost, block partsurface (focusPost, standalonePost, posts, postLink, postImageLink, Card/StandaloneView prop post, surfaceFrames).
  • Component files renamed: ImagePartImageSurface, JsonPartJsonSurface, TracePartTraceSurface (prop partsurface).
  • CSS classes: .part-unsupported.surface-unsupported, .imagepart.image-surface, .tracepart.trace-surface, .jsonpart.json-surface, .tl-surface.tl-post (emitters updated in lockstep).
  • User-visible strings: "surface"→"post"; onboarding copy reworded off the retired board/snippet terms.
  • Server helper: surfaceParts.tspostSurfaces.ts, coerceSurfacePartscoerceSurfaces, validateSurfacePartsvalidateSurfaces; all importers + the coerceParts public alias in mcpHttp.ts updated.

⚠️ Host-contract change (embedders must update)

The host identity key identity.accountSlug is renamed to identity.workspaceSlug in viewer/src/host.ts and viewer/embed.d.ts. Any embedder must rename it when bumping to a release containing this PR.

sideshow-cloud follow-up: the cloud's web/host.ts has a TODO(A5) that currently feeds accountSlug: from identity.workspaceSlug. When the cloud bumps its sideshow pin to include this rename, that line must change to workspaceSlug: identity.workspaceSlug in the same change — TypeScript won't catch the nested-identity mismatch.

Review

Writer + fresh-context reviewer + adversarial (Sonnet) pass. Both reviewers verified: no wire string accidentally renamed, no order-trap collisions, all CSS↔JSX emitter pairs matched both directions, all renamed-component call sites pass the new prop, host contract correct in both files.

Gates

typecheck ✓ · test 256/256 ✓ · lint ✓ · format:check ✓ · build ✓ · changeset: sideshow minor

🤖 Generated with Claude Code

@benvinegar benvinegar force-pushed the feat/viewer-post-surface-vocab branch from 0162ffa to 36725f0 Compare June 25, 2026 18:26
…per rename

Adopt the canonical workspace ▸ session ▸ post ▸ surface model in the viewer
engine. A post is the published artifact (an ordered list of surfaces); a
surface is one block inside a post.

Internal rename only — behavior is unchanged and every wire-bound string is
kept byte-identical: /api/* paths, /s/ nav URLs, the ?part= query key, SSE
event types (surface-created/-updated/-deleted), the comment body { surface }
key and author:"surface" value, and the server-provided surfaceCount field.
The Route type's surfaceId field is also left intact.

- viewer local identifiers/props/signals/functions: artifact surface→post,
  block part→surface (focusPost, standalonePost, posts, postLink, postImageLink,
  Card/StandaloneView prop post, surfaceFrames).
- component files renamed: ImagePart→ImageSurface, JsonPart→JsonSurface,
  TracePart→TraceSurface (prop part→surface).
- CSS classes: .part-unsupported→.surface-unsupported, .imagepart→.image-surface,
  .tracepart→.trace-surface, .jsonpart→.json-surface, .tl-surface→.tl-post.
- user-visible strings: "surface"→"post"; onboarding copy reworded off the
  retired board/snippet terms.
- host contract: identity.accountSlug→identity.workspaceSlug (embedders must
  update) in viewer/src/host.ts and viewer/embed.d.ts.
- server helper: surfaceParts.ts→postSurfaces.ts, coerceSurfaceParts→coerceSurfaces,
  validateSurfaceParts→validateSurfaces; importers + mcpHttp coerceParts alias updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@benvinegar benvinegar force-pushed the feat/viewer-post-surface-vocab branch from 36725f0 to 74597b1 Compare June 25, 2026 18:38
@benvinegar benvinegar merged commit 80cc684 into main Jun 25, 2026
9 checks passed
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