feat(viewer): post/surface vocabulary — engine UI, host contract, helper rename (A5)#143
Merged
Merged
Conversation
0162ffa to
36725f0
Compare
…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>
36725f0 to
74597b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A5 of the
workspace ▸ session ▸ post ▸ surfacerename: 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 keysurface-created/surface-updated/surface-deleted{ surface: <id> }key andauthor:"surface"valuesurfaceCountfield; comment fieldspostId/postTitleRoute.surfaceIdfield (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
surface→post, blockpart→surface(focusPost,standalonePost,posts,postLink,postImageLink,Card/StandaloneViewproppost,surfaceFrames).ImagePart→ImageSurface,JsonPart→JsonSurface,TracePart→TraceSurface(proppart→surface)..part-unsupported→.surface-unsupported,.imagepart→.image-surface,.tracepart→.trace-surface,.jsonpart→.json-surface,.tl-surface→.tl-post(emitters updated in lockstep).board/snippetterms.surfaceParts.ts→postSurfaces.ts,coerceSurfaceParts→coerceSurfaces,validateSurfaceParts→validateSurfaces; all importers + thecoercePartspublic alias inmcpHttp.tsupdated.The host identity key
identity.accountSlugis renamed toidentity.workspaceSluginviewer/src/host.tsandviewer/embed.d.ts. Any embedder must rename it when bumping to a release containing this PR.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✓ ·test256/256 ✓ ·lint✓ ·format:check✓ ·build✓ · changeset:sideshowminor🤖 Generated with Claude Code