Comments — create, read, edit, reply, resolve, tag, and list scene/project comments. A comment is an opaque CommentHandle (its server id). Comments may be anchored to a component at a 3D point, carry @mentions (by email) and emojis, be resolved / reopened, and hold a reply thread. Accessed via snaptrude.core.comment.
Read a comment's full detail — its text, author, pin location, resolved state, and reply thread. Comments are otherwise write-only; this is the read side. Accepts a top-level comment handle or a reply handle (a reply has an empty thread).
Parameters:
comment: CommentHandle — The comment (or reply) to read
Returns: PluginCommentDetails| null — null if the handle doesn't match a live comment (reads never throw for a miss). Deleted replies are excluded from thread.
Failed calls reject with a typed PluginError — see Error Handling. Conditions specific to this namespace:
Code
Thrown by
When
details
HANDLE_INVALID
create
The position vec3 handle cannot be resolved
kind: "vec3"
HANDLE_INVALID
reply
The target is unknown or is itself a reply
kind: "comment"
OPERATION_FAILED
create, reply
The server rejected the new comment / reply
—
update, resolve, reopen, tag, and delete never throw for a failed or unknown comment — they report the outcome as false by contract; isResolved likewise returns false for an unknown handle, and get returns null. An unresolvable component anchor in create is not an error either — the comment is created un-anchored.
Comment
Comments — create, read, edit, reply, resolve, tag, and list scene/project comments. A comment is an opaque
CommentHandle(its server id). Comments may be anchored to a component at a 3D point, carry @mentions (by email) and emojis, be resolved / reopened, and hold a reply thread. Accessed viasnaptrude.core.comment.Types
CommentHandleOpaque handle to a comment — its server-assigned id (entity-style: a raw, persistable string resolved live, not a registry-minted value handle).
PluginCommentCreateArgsWire schema for
create.componentComponentHandle?positionVec3Handle?messagestringmentionsstring[]?PluginCommentUpdateArgsWire schema for
update.commentCommentHandlemessagestringmentionsstring[]?PluginCommentRefArgsWire schema for
resolve/reopen/isResolved/delete/get.commentCommentHandlePluginCommentTagArgsWire schema for
tag.commentCommentHandleemailstringPluginCommentReplyArgsWire schema for
reply.commentCommentHandletextstringPluginCommentAuthorThe author of a comment or reply.
namestringemailstringPluginCommentReplyOne reply in a comment's thread.
idCommentHandlecontentstringauthorPluginCommentAuthor?nullif unknown)createdAtstringPluginCommentDetailsThe read model of a comment — returned by
get. The inverse ofcreate.idCommentHandlecontentstringauthorPluginCommentAuthor?nullif unknown)positionVec3Components?nullif un-anchoredcomponentComponentHandle?nullif un-anchoredisResolvedbooleancreatedAtstringthreadPluginCommentReply[]Functions
create(message, component?, position?, mentions?)Create a comment.
message:string— Comment text (emojis = plain unicode)component:ComponentHandle(optional) — Component to anchor the comment toposition:Vec3Handle(optional) — Pin point; defaults to the component's centermentions:string[](optional) — User emails, appended as real @mention tagsCommentHandle— The new comment's handle.update(comment, message, mentions?)Edit a comment's message (and optional @mentions).
comment:CommentHandle— The comment to editmessage:string— New message textmentions:string[](optional) — User emails to @mentionbooleanresolve(comment)Mark a comment resolved. Paired with
reopen.comment:CommentHandle— The target commentbooleanreopen(comment)Reopen a resolved comment. Paired with
resolve.comment:CommentHandle— The target commentbooleanisResolved(comment)Whether a comment is resolved.
comment:CommentHandle— The target commentbooleantag(comment, email)Tag (mention) a user on an existing comment, by email.
comment:CommentHandle— The comment to add a mention toemail:string— The user's email to @mentionbooleandelete(comment)Delete a comment.
comment:CommentHandle— The target commentbooleanlist()List all (non-deleted) comment handles in the project.
CommentHandle[]— Possibly empty, nevernull.get(comment)Read a comment's full detail — its text, author, pin location, resolved state, and reply thread. Comments are otherwise write-only; this is the read side. Accepts a top-level comment handle or a reply handle (a reply has an empty
thread).comment:CommentHandle— The comment (or reply) to readPluginCommentDetails| null—nullif the handle doesn't match a live comment (reads never throw for a miss). Deleted replies are excluded fromthread.reply(comment, text)Reply to a comment — posts a new comment threaded under
comment, mirroring the sidebar Reply action.comment:CommentHandle— The top-level comment to reply to (native threading is single-level; the target may not itself be a reply)text:string— The reply text (emojis = plain unicode)CommentHandle— The new reply's handle.Errors
Failed calls reject with a typed
PluginError— see Error Handling. Conditions specific to this namespace:detailsHANDLE_INVALIDcreatepositionvec3 handle cannot be resolvedkind: "vec3"HANDLE_INVALIDreplykind: "comment"OPERATION_FAILEDcreate,replyupdate,resolve,reopen,tag, anddeletenever throw for a failed or unknown comment — they report the outcome asfalseby contract;isResolvedlikewise returnsfalsefor an unknown handle, andgetreturnsnull. An unresolvablecomponentanchor increateis not an error either — the comment is created un-anchored.