On this page
Project-scoped add and remove mutations for named, nestable frame-tag ranges, mirroring the client store and riding meta-snapshot undo records for reliable revert.
#server.src.pixelweaver.frame_tag_ops
#server.src.pixelweaver.frame_tag_ops
Project-scoped frame-tag mutations (add_tag / remove_tag).
Frame tags are named, nestable frame ranges -- a faithful mirror of the client frame-tags.svelte.ts singleton. They are project-scoped and ride the full-state patch + save file under the client's canonical serialized shape: each tag is {id, name, color, startFrame, endFrame, parentId, children:[...]}.
Both mutations return a meta_snapshot undo record for the frame_tags project attribute (before/after the whole list), applied by undo_history. The id and color are CLIENT-generated (crypto.randomUUID + a cycled palette) and embedded into the forwarded command, so the server never mints its own -- both sides agree on tag identity.
#add_tag
def add_tag(project: ProjectState, *, tag_id: str, name: str, color: str, start_frame: int, end_frame: int, parent_id: str | None) -> dict[str, Any]Add a frame tag (client-minted id + color embedded). Mirror of addTag.
Inserts under parent_id when given (hard error if the parent is missing), else at the root. startFrame <= endFrame is enforced exactly like the client.
#remove_tag
def remove_tag(project: ProjectState, *, tag_id: str) -> dict[str, Any]Remove a frame tag (and its subtree) by id. Mirror of removeTag.