AI-native design editor. Open-source Figma alternative.
feat: add layer statuses with configurable workflows (#1232)
Danila Poyarkov372294196cd0
diff --git a/changes/1232/added.md b/changes/1232/added.mdnew file mode 100644index 000000000..ff3a53497--- /dev/null+++ b/changes/1232/added.md@@ -0,0 +1 @@+- Sections, frames, components and instances take a status from the document's own list of states, such as Draft, In review or Ready for dev, shown beside their titles on the canvas and set from there or the Design panel; a Statuses dialog edits the states and shows which layers a change affects. Figma's Ready for dev and Completed open and save as Figma's own statuses, and scripts and agents read and set any status through `openpencil.getStatus` and `openpencil.setStatus` or the `get_statuses` and `set_status` MCP tools (#1203).diff --git a/changes/1232/fixed.md b/changes/1232/fixed.mdnew file mode 100644index 000000000..ddab6b1b5--- /dev/null+++ b/changes/1232/fixed.md@@ -0,0 +1 @@+- Choosing from a menu that showed a placeholder, such as Move to in a dialog, no longer leaves the dialog hidden from screen readers.diff --git a/packages/core/src/canvas/index.ts b/packages/core/src/canvas/index.tsindex 18b1e032c..b7fe79da0 100644--- a/packages/core/src/canvas/index.ts+++ b/packages/core/src/canvas/index.ts@@ -42,3 +42,4 @@ export type {DesignIssueSeverity,PlacedIssueMarker} from './issues/types'+export { hitTestStatusLabels, type PlacedStatusLabel } from './labels/status'diff --git a/packages/core/src/canvas/labels/draw.ts b/packages/core/src/canvas/labels/draw.tsindex 244712f00..f85ec9e1e 100644--- a/packages/core/src/canvas/labels/draw.ts+++ b/packages/core/src/canvas/labels/draw.ts@@ -1,11 +1,22 @@import type { Canvas } from 'canvaskit-wasm'-import type { SceneNode, SceneGraph } from '@open-pencil/scene-graph'+import { shownStatusState, type SceneNode, type SceneGraph } from '@open-pencil/scene-graph'+import type { Mat3 } from '@open-pencil/scene-graph/matrix'+import type { Rect } from '@open-pencil/scene-graph/primitives'import type { RenderOverlays, SkiaRenderer } from '#core/canvas/renderer'import { SECTION_TITLE_RADIUS } from '#core/constants'-import { labelLayout, labelViewport } from './layout'+import { labelLayout, labelViewport, type LabelLayout } from './layout'+import {+ drawSectionStatus,+ drawStatusDot,+ placeStatusLabel,+ SECTION_STATUS_ROOM,+ statusDotCenter,+ statusDotHitRect,+ TITLE_STATUS_ROOM+} from './status'import { frameTitleColor, sectionLabelColors } from './style'import { frameLabelPlacement, labelScreenMatrix, labelTransform } from './transform'@@ -39,7 +50,10 @@ function drawSectionTitle(nested: boolean,overlays?: RenderOverlays): void {- const initialLayout = labelLayout('section', node.width * r.zoom, nested)+ const status = shownStatusState(graph, node)+ // A title leaves room for its status, so zooming out cuts the title short, not the status.+ const titleWidth = node.width * r.zoom - (status ? SECTION_STATUS_ROOM : 0)+ const initialLayout = labelLayout('section', titleWidth, nested)if (!initialLayout) returnconst { background, foreground, border, hover } = sectionLabelColors(r, graph, node)r.labelParagraphCache.use(@@ -51,11 +65,12 @@ function drawSectionTitle(foreground,r.fontGeneration,({ paragraph, metrics }) => {- const layout = labelLayout('section', node.width * r.zoom, nested, metrics)+ const layout = labelLayout('section', titleWidth, nested, metrics)if (!layout) returncanvas.save()try {- canvas.concat(labelScreenMatrix(labelTransform(node, graph, overlays?.rotationPreview), r))+ const matrix = labelScreenMatrix(labelTransform(node, graph, overlays?.rotationPreview), r)+ canvas.concat(matrix)r.auxFill.setColor(r.ck.Color4f(background.r, background.g, background.b, background.a))const { x, y, width, height } = layout.boundsconst bounds = r.ck.RRectXY(@@ -74,6 +89,12 @@ function drawSectionTitle(canvas.drawRRect(bounds, r.auxStroke)r.auxFill.setColor(foreground)canvas.drawParagraph(paragraph, layout.text.x, layout.text.y)+ if (status) {+ const colors = { background, foreground, border }+ const place = (rect: Rect) => placeStatusLabel(r, node.id, matrix, rect)+ const width = node.width * r.zoom+ drawSectionStatus(r, canvas, provider, status, layout.bounds, colors, width, place)+ }} finally {canvas.restore()}@@ -82,6 +103,26 @@ function drawSectionTitle()}+/** A frame's or component's status, as a dot after its name. */+function drawTitleStatus(+ r: SkiaRenderer,+ canvas: Canvas,+ graph: SceneGraph,+ node: SceneNode,+ layout: LabelLayout,+ textWidth: number,+ screenWidth: number,+ matrix: Mat3+): void {+ const status = shownStatusState(graph, node)+ if (!status) return+ const { text, fontSize } = layout+ const center = statusDotCenter(text.x, text.y, textWidth, fontSize, screenWidth)+ if (!center) return+ drawStatusDot(r, canvas, status, center)+ placeStatusLabel(r, node.id, matrix, statusDotHitRect(center))+}+export function drawComponentLabels(r: SkiaRenderer,canvas: Canvas,@@ -102,12 +143,14 @@ export function drawComponentLabels(for (const { node, inside } of components) {const transform = labelTransform(node, graph, overlays?.rotationPreview)- const layout = labelLayout('component', node.width * r.zoom, inside)+ const room = shownStatusState(graph, node) ? TITLE_STATUS_ROOM : 0+ const layout = labelLayout('component', node.width * r.zoom - room, inside)if (!layout?.icon) continueconst iconS = layout.icon.widthcanvas.save()- canvas.concat(labelScreenMatrix(transform, r))+ const matrix = labelScreenMatrix(transform, r)+ canvas.concat(matrix)const iconX = layout.icon.xconst iconY = layout.icon.y@@ -150,7 +193,7 @@ export function drawComponentLabels(immutablePath.delete()}- r.labelParagraphCache.draw(+ const textWidth = r.labelParagraphCache.draw(r.ck,canvas,provider,@@ -163,6 +206,7 @@ export function drawComponentLabels(layout.text.y,layout.fontWeight)+ drawTitleStatus(r, canvas, graph, node, layout, textWidth, node.width * r.zoom, matrix)canvas.restore()}}@@ -189,12 +233,14 @@ export function drawFrameTitles()for (const { node } of frames) {const transform = frameLabelPlacement(node, graph, overlays?.rotationPreview)- const layout = labelLayout('frame', transform.width * r.zoom)+ const room = shownStatusState(graph, node) ? TITLE_STATUS_ROOM : 0+ const layout = labelLayout('frame', transform.width * r.zoom - room)if (!layout) continueconst highlighted = selectedIds.has(node.id) || overlays?.hoveredNodeId === node.idcanvas.save()- canvas.concat(labelScreenMatrix(transform, r))- r.labelParagraphCache.draw(+ const matrix = labelScreenMatrix(transform, r)+ canvas.concat(matrix)+ const textWidth = r.labelParagraphCache.draw(r.ck,canvas,provider,@@ -207,6 +253,7 @@ export function drawFrameTitles(layout.text.y,layout.fontWeight)+ drawTitleStatus(r, canvas, graph, node, layout, textWidth, transform.width * r.zoom, matrix)canvas.restore()}}diff --git a/packages/core/src/canvas/labels/layout.ts b/packages/core/src/canvas/labels/layout.tsindex e316b050b..da6815c14 100644--- a/packages/core/src/canvas/labels/layout.ts+++ b/packages/core/src/canvas/labels/layout.ts@@ -42,31 +42,55 @@ export function hasFrameTitle(node: SceneNode, parentType: string | undefined):)}+/** A label boxed as a section title is: where its box and text go, and how wide the text may get. */+export interface PillLayout {+ bounds: Rect+ text: Vector+ /** The text is cut short with an ellipsis past this width. */+ maxTextWidth: number+}++/**+ * A label boxed as a section title: padded text at the title's height, starting at `x` and no+ * wider than `width`, with room `before` and `after` the text for marks such as a status dot.+ * Without `metrics` it gives the widest the text may get, to lay the text out with.+ */+export function pillLayout(+ x: number,+ y: number,+ width: number,+ metrics?: LabelTextMetrics,+ before = 0,+ after = 0+): PillLayout | null {+ if (width <= 0) return null+ const chrome = SECTION_TITLE_PADDING_X * 2 + before + after+ const textWidth = metrics?.width ?? width+ return {+ bounds: { x, y, width: Math.min(textWidth + chrome, width), height: SECTION_TITLE_HEIGHT },+ text: {+ x: x + SECTION_TITLE_PADDING_X + before,+ y: y + (SECTION_TITLE_HEIGHT - (metrics?.height ?? SECTION_TITLE_FONT_SIZE)) / 2+ },+ maxTextWidth: Math.max(1, width - chrome)+ }+}+function sectionLabelLayout(screenWidth: number,inside: boolean,metrics?: LabelTextMetrics): LabelLayout | null {const x = inside ? SECTION_TITLE_GAP : 0- if (screenWidth <= x) return nullconst y = inside ? SECTION_TITLE_GAP : -SECTION_TITLE_HEIGHT - SECTION_TITLE_GAP- const textWidth = metrics?.width ?? screenWidth+ const pill = pillLayout(x, y, screenWidth - x, metrics)+ if (!pill) return nullreturn {kind: 'section',- bounds: {- x,- y,- width: Math.min(textWidth + SECTION_TITLE_PADDING_X * 2, screenWidth - x),- height: SECTION_TITLE_HEIGHT- },- text: {- x: x + SECTION_TITLE_PADDING_X,- y: y + (SECTION_TITLE_HEIGHT - (metrics?.height ?? SECTION_TITLE_FONT_SIZE)) / 2- },+ ...pill,icon: null,fontSize: SECTION_TITLE_FONT_SIZE,- fontWeight: 600,- maxTextWidth: Math.max(1, screenWidth - x - SECTION_TITLE_PADDING_X * 2)+ fontWeight: 600}}diff --git a/packages/core/src/canvas/labels/status.ts b/packages/core/src/canvas/labels/status.tsnew file mode 100644index 000000000..d03347c0e--- /dev/null+++ b/packages/core/src/canvas/labels/status.ts@@ -0,0 +1,196 @@+import type { Canvas, Paragraph } from 'canvaskit-wasm'++import type { StatusState } from '@open-pencil/scene-graph'+import Matrix, { type Mat3 } from '@open-pencil/scene-graph/matrix'+import type { Color, Rect, Vector } from '@open-pencil/scene-graph/primitives'++import type { SkiaRenderer } from '#core/canvas/renderer'+import {+ SECTION_TITLE_FONT_SIZE,+ SECTION_TITLE_PADDING_X,+ SECTION_TITLE_RADIUS+} from '#core/constants'++import { pillLayout, type LabelTextMetrics, type PillLayout } from './layout'++/** Space between a section's title and its status pill, in screen pixels. */+const PILL_GAP = 4+/** A frame's or component's status dot: its radius and its gap after the name. */+const DOT_RADIUS = 3.5+const DOT_GAP = 5++/** A status label drawn in the last frame, in canvas-element CSS pixels, for hit testing. */+export interface PlacedStatusLabel {+ nodeId: string+ rect: Rect+}++/** Records where a label drawn under `matrix` went, so a click on it finds its layer. */+export function placeStatusLabel(r: SkiaRenderer, nodeId: string, matrix: Mat3, local: Rect): void {+ const corners = [+ Matrix.mapPoint(matrix, { x: local.x, y: local.y }),+ Matrix.mapPoint(matrix, { x: local.x + local.width, y: local.y }),+ Matrix.mapPoint(matrix, { x: local.x, y: local.y + local.height }),+ Matrix.mapPoint(matrix, { x: local.x + local.width, y: local.y + local.height })+ ]+ const xs = corners.map((corner) => corner.x)+ const ys = corners.map((corner) => corner.y)+ const x = Math.min(...xs)+ const y = Math.min(...ys)+ r.statusLabels.push({+ nodeId,+ rect: { x, y, width: Math.max(...xs) - x, height: Math.max(...ys) - y }+ })+}++/** The topmost status label under a point; labels drawn last are on top. */+export function hitTestStatusLabels(+ placed: readonly PlacedStatusLabel[],+ x: number,+ y: number+): PlacedStatusLabel | null {+ return (+ placed.findLast(+ ({ rect }) =>+ x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height+ ) ?? null+ )+}++/** A pill with no name, only the dot. */+const NO_TEXT = { width: 0, height: SECTION_TITLE_FONT_SIZE }++/**+ * Room a section's title leaves for its status, a compact pill with the dot alone: zoomed out,+ * the title is cut short rather than the status left out, as Figma keeps its Ready for dev icon.+ */+export const SECTION_STATUS_ROOM = PILL_GAP + SECTION_TITLE_PADDING_X * 2 + DOT_RADIUS * 2++/** Room a frame's or component's name leaves for its status dot. */+export const TITLE_STATUS_ROOM = DOT_GAP + DOT_RADIUS * 2++/** Narrowest a state's name gets before the pill keeps only its dot: about a letter and "…". */+const MIN_NAME_WIDTH = 16++/** A section's status pill, laid out as the title is, and whether it has room for the name. */+export interface SectionStatusPill extends PillLayout {+ compact: boolean+}++/**+ * Where a section's status pill goes, beside its title, in the title's pixel space: the dot and+ * the state's name, padded like the title. The name is cut short with an ellipsis as the title+ * is; with no room for even a letter, the pill keeps the dot alone, and null when not even that+ * fits. Without `metrics` it gives the widest the name may get.+ */+export function sectionStatusPill(+ title: Rect,+ screenWidth: number,+ metrics?: LabelTextMetrics+): SectionStatusPill | null {+ const x = title.x + title.width + PILL_GAP+ const width = screenWidth - x+ const full = pillLayout(x, title.y, width, metrics, DOT_RADIUS * 2 + DOT_GAP)+ if (full && full.maxTextWidth >= MIN_NAME_WIDTH) return { ...full, compact: false }+ const compact = pillLayout(x, title.y, width, NO_TEXT, DOT_RADIUS * 2)+ if (!compact || compact.bounds.width < SECTION_TITLE_PADDING_X * 2 + DOT_RADIUS * 2) return null+ return { ...compact, compact: true }+}++/** Where a frame's or component's status dot goes, after its name, in the label's pixel space. */+export function statusDotCenter(+ textX: number,+ textY: number,+ textWidth: number,+ fontSize: number,+ screenWidth: number+): Vector | null {+ const x = textX + textWidth + DOT_GAP + DOT_RADIUS+ if (x + DOT_RADIUS > screenWidth) return null+ return { x, y: textY + fontSize / 2 + 1 }+}++/** The area around a status dot a click takes, a little larger than the dot. */+export function statusDotHitRect(center: Vector): Rect {+ const reach = DOT_RADIUS + 3+ return { x: center.x - reach, y: center.y - reach, width: reach * 2, height: reach * 2 }+}++/** The title's own look, which the pill beside it shares. */+export interface SectionTitleColors {+ background: Color+ foreground: Float32Array+ border: Float32Array+}++/**+ * A section's status as Figma draws Ready for dev: a pill beside the title, in the title's colors+ * so any state color stays readable, with a dot in the state's color and its name. Drawn in the+ * title's space.+ */+export function drawSectionStatus(+ r: SkiaRenderer,+ canvas: Canvas,+ provider: NonNullable<SkiaRenderer['fontProvider']>,+ label: StatusState,+ title: Rect,+ colors: SectionTitleColors,+ screenWidth: number,+ place: (rect: Rect) => void+): void {+ const widest = sectionStatusPill(title, screenWidth)+ if (!widest) return+ const draw = (pill: SectionStatusPill, paragraph?: Paragraph) => {+ const { x, y, width, height } = pill.bounds+ place(pill.bounds)+ const bounds = r.ck.RRectXY(+ r.ck.LTRBRect(x, y, x + width, y + height),+ SECTION_TITLE_RADIUS,+ SECTION_TITLE_RADIUS+ )+ const { background } = colors+ r.auxFill.setColor(r.ck.Color4f(background.r, background.g, background.b, background.a))+ canvas.drawRRect(bounds, r.auxFill)+ r.auxStroke.setColor(colors.border)+ r.auxStroke.setStrokeWidth(1)+ r.auxStroke.setPathEffect(null)+ canvas.drawRRect(bounds, r.auxStroke)+ r.auxFill.setColor(r.ck.Color4f(label.color.r, label.color.g, label.color.b, 1))+ canvas.drawCircle(+ x + SECTION_TITLE_PADDING_X + DOT_RADIUS,+ y + height / 2,+ DOT_RADIUS,+ r.auxFill+ )+ if (paragraph) canvas.drawParagraph(paragraph, pill.text.x, pill.text.y)+ }+ if (widest.compact) {+ draw(widest)+ return+ }+ r.labelParagraphCache.use(+ r.ck,+ provider,+ label.name,+ SECTION_TITLE_FONT_SIZE,+ widest.maxTextWidth,+ colors.foreground,+ r.fontGeneration,+ ({ paragraph, metrics }) => {+ const pill = sectionStatusPill(title, screenWidth, metrics)+ if (pill) draw(pill, paragraph)+ },+ 600+ )+}++/** A frame's or component's status: a dot in the state's color after its name. */+export function drawStatusDot(+ r: SkiaRenderer,+ canvas: Canvas,+ label: StatusState,+ center: Vector+): void {+ r.auxFill.setColor(r.ck.Color4f(label.color.r, label.color.g, label.color.b, 1))+ canvas.drawCircle(center.x, center.y, DOT_RADIUS, r.auxFill)+}diff --git a/packages/core/src/canvas/renderer.ts b/packages/core/src/canvas/renderer.tsindex 393a2c271..6c12e9f07 100644--- a/packages/core/src/canvas/renderer.ts+++ b/packages/core/src/canvas/renderer.ts@@ -81,6 +81,7 @@ export interface PendingFontNode {}import type { PlacedIssueMarker } from './issues/types'+import type { PlacedStatusLabel } from './labels/status'import { EffectRasterCache } from './renderer/effect-raster-cache'import { TiledSceneController } from './renderer/tiles'import type { TransientCanvasPreview } from './renderer/transient-previews'@@ -221,6 +222,8 @@ export class SkiaRenderer {pageId: string | null = null/** Issue markers placed in the last overlay pass; hit testing reads the same layout. */issueMarkers: PlacedIssueMarker[] = []+ /** Status labels drawn in the last label pass; clicks on them open the status menu. */+ statusLabels: PlacedStatusLabel[] = []/** Screen rectangles of UI floating over this canvas, which overlays such as edge pins avoid. */overlayObstacles: readonly Rect[] = []diff --git a/packages/core/src/canvas/renderer/pipeline.ts b/packages/core/src/canvas/renderer/pipeline.tsindex 073a2a443..9477d6ee4 100644--- a/packages/core/src/canvas/renderer/pipeline.ts+++ b/packages/core/src/canvas/renderer/pipeline.ts@@ -208,6 +208,7 @@ function drawAboveScene(canvas.save()canvas.scale(r.dpr, r.dpr)r.labelCache.update(graph, r.pageId, sceneVersion, graph.positionPreviewVersion)+ r.statusLabels = []if (!overlays.playing) drawLabelPass(r, canvas, graph, selectedIds, overlays)canvas.restore()diff --git a/packages/core/src/clipboard/fig-import.ts b/packages/core/src/clipboard/fig-import.tsindex 60eb3eb63..6c9747075 100644--- a/packages/core/src/clipboard/fig-import.ts+++ b/packages/core/src/clipboard/fig-import.ts@@ -26,11 +26,18 @@ export function prepareClipboardImport(parentId})const roots = new Set(plan.rootIds)- for (const node of plan.nodes)+ for (const node of plan.nodes) {if (roots.has(node.id)) {node.props.x = (node.props.x ?? 0) + offsetXnode.props.y = (node.props.y ?? 0) + offsetY}+ // Figma's paste drops statuses: a pasted copy is a new design nobody has reviewed.+ if (node.props.status && node.props.source) {+ const { editedFields } = node.props.source+ node.props.status = null+ node.props.source = { ...node.props.source, editedFields: [...editedFields, 'status'] }+ }+ }let snapshot = planconst operation = {sourceIds: fragment.sources,diff --git a/packages/core/src/editor/create.ts b/packages/core/src/editor/create.tsindex 36b65f2ae..dd378d02d 100644--- a/packages/core/src/editor/create.ts+++ b/packages/core/src/editor/create.ts@@ -48,6 +48,7 @@ import { createShaderActions } from './shaders/actions'import { createShaderFrames } from './shaders/frames'import { createShapeActions } from './shapes'import { createDefaultEditorState } from './state'+import { createStatusActions } from './statuses'import { createStickyActions } from './stickies'import { createStructureActions } from './structure'import { createTextActions } from './text'@@ -282,6 +283,7 @@ export function createEditor(options?: EditorOptions) {const vectorize = createVectorizeActions(ctx)const icons = createIconActions(ctx)const stickies = createStickyActions(ctx)+ const statuses = createStatusActions(ctx)const shaders = createShaderActions(ctx, nodes)const alignment = createAlignmentActions(ctx)const preview = createPlayActions(ctx)@@ -441,6 +443,10 @@ export function createEditor(options?: EditorOptions) {...vectorize,...icons,...stickies,+ statusWorkflow: statuses.statusWorkflow,+ getShownStatus: statuses.getShownStatus,+ setStatus: statuses.setStatus,+ setStatusWorkflow: statuses.setStatusWorkflow,...shaders,...shaderFrames,diff --git a/packages/core/src/editor/statuses.ts b/packages/core/src/editor/statuses.tsnew file mode 100644index 000000000..615e41059--- /dev/null+++ b/packages/core/src/editor/statuses.ts@@ -0,0 +1,99 @@+import {+ cachedStatusWorkflow,+ OPEN_PENCIL_PLUGIN_DATA,+ readPluginData,+ shownStatusState,+ statusPlacement,+ withPluginData,+ type StatusState,+ type StatusWorkflow+} from '@open-pencil/scene-graph'++import type { EditorContext } from './types'++/** Statuses as the canvas and panels show them, and the commands that change them. */+export function createStatusActions(ctx: EditorContext) {+ function statusWorkflow(): StatusWorkflow {+ return cachedStatusWorkflow(ctx.graph)+ }++ /** The state `nodeId` shows, or null when it shows none. */+ function getShownStatus(nodeId: string): StatusState | null {+ const node = ctx.graph.getNode(nodeId)+ return node ? shownStatusState(ctx.graph, node) : null+ }++ /** Puts `statuses` on their layers as one undo step, labelled `label`. */+ function applyStatuses(label: string, statuses: ReadonlyMap<string, string | null>): void {+ const previous = new Map(+ [...statuses.keys()].map((id) => [id, ctx.graph.getNode(id)?.status ?? null])+ )+ const write = (values: ReadonlyMap<string, string | null>) => {+ for (const [id, status] of values) ctx.graph.updateNode(id, { status })+ ctx.requestRender()+ }+ write(statuses)+ ctx.undo.push({ label, forward: () => write(statuses), inverse: () => write(previous) })+ }++ /**+ * Sets `stateId` on the layers of `nodeIds` that can show a status, or clears theirs with null,+ * in one undo step. Returns how many layers changed.+ */+ function setStatus(nodeIds: readonly string[], stateId: string | null): number {+ const statuses = new Map<string, string | null>()+ for (const id of nodeIds) {+ const node = ctx.graph.getNode(id)+ if (!node || node.status === stateId) continue+ if (stateId !== null && statusPlacement(ctx.graph, node) !== 'ok') continue+ if (stateId === null && !node.status) continue+ statuses.set(id, stateId)+ }+ if (statuses.size > 0)+ applyStatuses(stateId === null ? 'Remove status' : 'Set status', statuses)+ return statuses.size+ }++ /**+ * Replaces the document's statuses as one undo step. `moves` sends the layers in a state the+ * new workflow drops to another state, or clears theirs with null. Undo restores only the+ * workflow and those layers, so comments written meanwhile on the document node stay.+ */+ function setStatusWorkflow(+ next: StatusWorkflow,+ moves: Readonly<Record<string, string | null>> = {}+ ): void {+ const { statuses } = OPEN_PENCIL_PLUGIN_DATA+ const rootId = ctx.graph.rootId+ const previous = readPluginData(ctx.graph.getNode(rootId)?.pluginData, statuses)+ const write = (value: StatusWorkflow | undefined) => {+ const root = ctx.graph.getNode(rootId)+ if (!root) return+ ctx.graph.updateNode(rootId, {+ pluginData: withPluginData(root.pluginData, statuses, value && structuredClone(value))+ })+ ctx.requestRender()+ }+ const moved = new Map<string, string | null>()+ for (const node of ctx.graph.getAllNodes()) {+ const target = node.status ? moves[node.status] : undefined+ if (target !== undefined) moved.set(node.id, target)+ }+ ctx.undo.runBatch('Edit statuses', () => {+ write(next)+ ctx.undo.push({+ label: 'Edit statuses',+ forward: () => write(next),+ inverse: () => write(previous)+ })+ if (moved.size > 0) applyStatuses('Edit statuses', moved)+ })+ }++ return {+ statusWorkflow,+ getShownStatus,+ setStatus,+ setStatusWorkflow+ }+}diff --git a/packages/core/src/figma-api/dev-status.ts b/packages/core/src/figma-api/dev-status.tsnew file mode 100644index 000000000..028990a1d--- /dev/null+++ b/packages/core/src/figma-api/dev-status.ts@@ -0,0 +1,65 @@+import * as v from 'valibot'++import {+ effectiveStatus,+ FIGMA_DEV_STATUSES,+ FIGMA_STATUS_STATE_IDS,+ figmaDevStatusOf,+ statusPlacement,+ STATUS_NODE_TYPES,+ type FigmaDevStatus+} from '@open-pencil/scene-graph'++import type { NodeProxyInternals, ProxyThis } from './accessor-utils'+import { graph, raw, updateNode } from './accessor-utils'++/** Figma's `DevStatus`; a description is not kept, as comments hold what people say about it. */+export type FigmaDevStatusValue = { type: FigmaDevStatus; description?: string } | null++const devStatusInput = v.nullable(+ v.object({ type: v.picklist(FIGMA_DEV_STATUSES), description: v.optional(v.string()) })+)++/** Figma's errors for a layer that cannot show a status where it is (Figma desktop 126). */+const PLACEMENT_ERRORS = {+ parent:+ 'in set_devStatus: Cannot set devStatus on a node that is not directly under a page or section',+ ancestor:+ 'in set_devStatus: Cannot set devStatus on a node inside another node with non-null devStatus'+} as const++/**+ * `devStatus` on the layers Figma gives it to. It reads the status the layer shows, as Figma's+ * Ready for dev or Completed, and null for a hidden status or one Figma has no counterpart for;+ * a description given with it is not kept.+ * Other layers have no `devStatus`, and setting it does nothing, as in Figma.+ */+export function installDevStatusAccessors(prototype: object, internals: NodeProxyInternals): void {+ Object.defineProperties(prototype, {+ devStatus: {+ get(this: ProxyThis): FigmaDevStatusValue | undefined {+ const node = raw(this, internals)+ if (!STATUS_NODE_TYPES.has(node.type)) return undefined+ const status = effectiveStatus(graph(this, internals), node)+ const type = status ? figmaDevStatusOf(status) : null+ return type ? { type } : null+ },+ set(this: ProxyThis, value: unknown) {+ const node = raw(this, internals)+ if (!STATUS_NODE_TYPES.has(node.type)) return+ const parsed = v.safeParse(devStatusInput, value)+ if (!parsed.success) throw new Error('in set_devStatus: Expected a DevStatus or null')+ if (parsed.output === null) {+ updateNode(this, internals, { status: null })+ return+ }+ const placement = statusPlacement(graph(this, internals), node)+ if (placement === 'parent' || placement === 'ancestor') {+ throw new Error(PLACEMENT_ERRORS[placement])+ }+ const status = FIGMA_STATUS_STATE_IDS[parsed.output.type]+ updateNode(this, internals, { status })+ }+ }+ })+}diff --git a/packages/core/src/figma-api/proxy.ts b/packages/core/src/figma-api/proxy.tsindex da68cfadf..06c8b172b 100644--- a/packages/core/src/figma-api/proxy.ts+++ b/packages/core/src/figma-api/proxy.ts@@ -45,6 +45,7 @@ import {type FigmaPaint} from './accessors/visual'import { installComponentPropertyAccessors } from './components'+import { installDevStatusAccessors, type FigmaDevStatusValue } from './dev-status'import type { FigmaFontName } from './fonts'import type { FigmaFrameNode, FigmaInstanceNode } from './node-types'import { installInstanceOverrideAccessors, type FigmaInstanceOverride } from './overrides'@@ -115,6 +116,7 @@ export class FigmaNodeProxy {declare opacity: numberdeclare visible: booleandeclare locked: boolean+ declare devStatus: FigmaDevStatusValue | undefineddeclare blendMode: stringdeclare clipsContent: booleandeclare cornerRadius: number | typeof MIXED@@ -584,3 +586,4 @@ installVariableModeNodeProxyAccessors(FigmaNodeProxy.prototype, proxyInternals)installComponentPropertyAccessors(FigmaNodeProxy.prototype, proxyInternals)installInstanceOverrideAccessors(FigmaNodeProxy.prototype, proxyInternals)installSlotAccessors(FigmaNodeProxy.prototype, proxyInternals)+installDevStatusAccessors(FigmaNodeProxy.prototype, proxyInternals)diff --git a/packages/core/src/openpencil-api/index.ts b/packages/core/src/openpencil-api/index.tsindex 58bf54071..eeac8c26b 100644--- a/packages/core/src/openpencil-api/index.ts+++ b/packages/core/src/openpencil-api/index.ts@@ -22,8 +22,10 @@ import {type CommentHandle,type NewComment} from './comments'+import { getStatus, listStatuses, setStatus, type StatusInfo } from './statuses'export { BehaviourHandle, type NodeRef } from './behaviours'+export type { StatusInfo } from './statuses'export {CommentHandle,DEFAULT_COMMENT_AUTHOR,@@ -82,4 +84,25 @@ export class OpenPencilAPI {addComment(text: string, options?: NewComment): CommentHandle {return addComment(this.figma.graph, this.figma.currentPageId, text, options)}++ /**+ * The document's statuses, such as Ready for dev or the team's own Approved, with each one's+ * color and the status Figma shows for it, if any.+ */+ get statuses(): StatusInfo[] {+ return listStatuses(this.figma.graph)+ }++ /** The name of the status a section, frame, component, set or instance shows, or null. */+ getStatus(node: NodeRef): string | null {+ return getStatus(this.figma.graph, node)+ }++ /**+ * Give a layer one of the document's statuses by name, or clear it with null. Only sections,+ * frames, components, sets and instances directly on a page or in a section take one.+ */+ setStatus(node: NodeRef, status: string | null): void {+ setStatus(this.figma.graph, node, status)+ }}diff --git a/packages/core/src/openpencil-api/statuses.ts b/packages/core/src/openpencil-api/statuses.tsnew file mode 100644index 000000000..ed61fdfa0--- /dev/null+++ b/packages/core/src/openpencil-api/statuses.ts@@ -0,0 +1,62 @@+import {+ cachedStatusWorkflow,+ figmaDevStatusOf,+ shownStatusState,+ statusPlacement,+ type FigmaDevStatus,+ type SceneGraph,+ type StatusPlacement+} from '@open-pencil/scene-graph'+import { colorToHex } from '@open-pencil/scene-graph/color'++import { nodeOf, type NodeRef } from './behaviours'++/** One of the document's statuses as scripts see it. */+export interface StatusInfo {+ name: string+ /** `#RRGGBB`. */+ color: string+ /** The status Figma shows for it, if it has one. */+ figma: FigmaDevStatus | null+}++/** The document's statuses, in the order menus list them. */+export function listStatuses(graph: SceneGraph): StatusInfo[] {+ return cachedStatusWorkflow(graph).states.map((state) => ({+ name: state.name,+ color: colorToHex(state.color),+ figma: figmaDevStatusOf(state.id)+ }))+}++/** The name of the status a layer shows, or null; a status its place hides reads as null. */+export function getStatus(graph: SceneGraph, ref: NodeRef): string | null {+ return shownStatusState(graph, nodeOf(graph, ref))?.name ?? null+}++/** Why a layer cannot take a status where it is, after its name. */+const PLACEMENT_ERRORS = {+ type: 'only sections, frames, components, component sets and instances can',+ parent: 'it is not directly on a page or in a section',+ ancestor: 'a section around it has one'+} as const satisfies Record<Exclude<StatusPlacement, 'ok'>, string>++/** Give a layer the status named `name`, or clear its status with null. */+export function setStatus(graph: SceneGraph, ref: NodeRef, name: string | null): void {+ const node = nodeOf(graph, ref)+ if (name === null) {+ graph.updateNode(node.id, { status: null })+ return+ }+ const { states } = cachedStatusWorkflow(graph)+ const state = states.find((entry) => entry.name === name)+ if (!state) {+ const names = states.map((entry) => entry.name).join(', ')+ throw new Error(`No status named ${name}; the document has ${names}`)+ }+ const placement = statusPlacement(graph, node)+ if (placement !== 'ok') {+ throw new Error(`${node.name} cannot have a status: ${PLACEMENT_ERRORS[placement]}`)+ }+ graph.updateNode(node.id, { status: state.id })+}diff --git a/packages/core/src/tools/analyze/eval/index.ts b/packages/core/src/tools/analyze/eval/index.tsindex 69ed86759..e2c496b1d 100644--- a/packages/core/src/tools/analyze/eval/index.ts+++ b/packages/core/src/tools/analyze/eval/index.ts@@ -7,7 +7,7 @@ import { compileScript } from './wrap'export const evalCode = defineTool({name: 'eval',description:- 'Execute JavaScript with full Figma Plugin API access. Use for operations not covered by other tools. The `figma` global is the Figma Plugin API; the `openpencil` global adds what Figma has no API for, such as component behaviours (`openpencil.setBehaviour`, `openpencil.getBehaviour`, `openpencil.behaviourKinds`), slots (`openpencil.createSlot`), and comments (`openpencil.getComments`, `openpencil.getComment`, `openpencil.addComment`, and each comment’s `reply` and `resolve`).',+ 'Execute JavaScript with full Figma Plugin API access. Use for operations not covered by other tools. The `figma` global is the Figma Plugin API; the `openpencil` global adds what Figma has no API for, such as component behaviours (`openpencil.setBehaviour`, `openpencil.getBehaviour`, `openpencil.behaviourKinds`), slots (`openpencil.createSlot`), comments (`openpencil.getComments`, `openpencil.getComment`, `openpencil.addComment`, and each comment’s `reply` and `resolve`), and statuses (`openpencil.statuses`, `openpencil.getStatus`, `openpencil.setStatus`).',execution: { kind: 'async', mutation: 'document' },capabilities: ['document:read', 'document:write', 'code:execute'],availability: 'eval',diff --git a/packages/core/src/tools/registry-extended.ts b/packages/core/src/tools/registry-extended.tsindex 094ee686f..694148721 100644--- a/packages/core/src/tools/registry-extended.ts+++ b/packages/core/src/tools/registry-extended.ts@@ -59,6 +59,7 @@ import {switchPage} from './read'import type { ToolDef } from './schema'+import { getStatuses, setStatus } from './statuses'import {arrangeNodes,cloneNode,@@ -126,6 +127,8 @@ export const EXTENDED_TOOLS: ToolDef[] = [addComment,replyToComment,resolveComment,+ getStatuses,+ setStatus,getFontStatus,listFonts,listAvailableFonts,diff --git a/packages/core/src/tools/statuses.ts b/packages/core/src/tools/statuses.tsnew file mode 100644index 000000000..fee47e777--- /dev/null+++ b/packages/core/src/tools/statuses.ts@@ -0,0 +1,55 @@+import * as v from 'valibot'++import { STATUS_NODE_TYPES } from '@open-pencil/scene-graph'++import { OpenPencilAPI } from '#core/openpencil-api'+import { defineTool, toolFailure } from '#core/tools/schema'++export const getStatuses = defineTool({+ name: 'get_statuses',+ description:+ 'Read the document’s statuses, such as Draft, In review or Ready for dev, and the layers ' ++ 'that show one: sections, frames, components and instances, with their page. Use it to ' ++ 'find what is ready to build or still in review, and set_status to change one.',+ execution: { kind: 'sync', mutation: 'none' },+ input: v.strictObject({+ status: v.optional(v.pipe(v.string(), v.description('Only layers with this status name')))+ }),+ execute: (figma, { status }) => {+ const api = new OpenPencilAPI(figma)+ const { graph } = figma+ const layers = [...graph.getAllNodes()].flatMap((node) => {+ if (!STATUS_NODE_TYPES.has(node.type) || !node.status) return []+ const name = api.getStatus(node.id)+ if (!name || (status !== undefined && name !== status)) return []+ const page = graph.getNode(graph.pageOf(node.id) ?? '')+ return [{ id: node.id, name: node.name, type: node.type, page: page?.name, status: name }]+ })+ return { statuses: api.statuses, layers }+ }+})++export const setStatus = defineTool({+ name: 'set_status',+ description:+ 'Give a section, frame, component or instance one of the document’s statuses by name, as ' ++ 'get_statuses lists them, or clear its status with null. Only layers directly on a page or ' ++ 'in a section take one.',+ execution: { kind: 'sync', mutation: 'document' },+ input: v.strictObject({+ node: v.pipe(v.string(), v.description('Layer ID')),+ status: v.pipe(+ v.nullable(v.string()),+ v.description('A status name from get_statuses, or null to clear it')+ )+ }),+ execute: (figma, { node, status }) => {+ try {+ const api = new OpenPencilAPI(figma)+ api.setStatus(node, status)+ return { node, status: api.getStatus(node) }+ } catch (error) {+ return toolFailure(error)+ }+ }+})diff --git a/packages/core/tests/canvas/labels/status.test.ts b/packages/core/tests/canvas/labels/status.test.tsnew file mode 100644index 000000000..41ba76916--- /dev/null+++ b/packages/core/tests/canvas/labels/status.test.ts@@ -0,0 +1,33 @@+import { describe, expect, test } from 'bun:test'++import { sectionStatusPill } from '#core/canvas/labels/status'++const title = { x: 0, y: -30, width: 80, height: 24 }+const name = (width: number) => ({ width, height: 11 })++describe("a section's status pill", () => {+ test('shows the whole name where it fits', () => {+ const pill = sectionStatusPill(title, 400, name(70))+ expect(pill?.compact).toBe(false)+ expect(pill?.maxTextWidth).toBeGreaterThan(70)+ expect(pill?.bounds.x).toBeGreaterThan(title.width)+ })++ test('cuts the name short as the title is, before dropping it', () => {+ const widest = sectionStatusPill(title, 140)+ expect(widest?.compact).toBe(false)+ expect(widest?.maxTextWidth).toBeLessThan(70)+ const pill = sectionStatusPill(title, 140, name(widest?.maxTextWidth ?? 0))+ expect((pill?.bounds.x ?? 0) + (pill?.bounds.width ?? 0)).toBeLessThanOrEqual(140)+ })++ test('keeps only the dot with no room for a letter', () => {+ const pill = sectionStatusPill(title, 110)+ expect(pill?.compact).toBe(true)+ expect((pill?.bounds.x ?? 0) + (pill?.bounds.width ?? 0)).toBeLessThanOrEqual(110)+ })++ test('is left out when not even the dot fits', () => {+ expect(sectionStatusPill(title, 90)).toBeNull()+ })+})diff --git a/packages/core/tests/editor/clipboard/statuses.test.ts b/packages/core/tests/editor/clipboard/statuses.test.tsnew file mode 100644index 000000000..769ddd265--- /dev/null+++ b/packages/core/tests/editor/clipboard/statuses.test.ts@@ -0,0 +1,46 @@+import { afterEach, describe, expect, test } from 'bun:test'++import { expectDefined } from '#core-tests/helpers/assert'++import { buildFigmaClipboardHTML } from '@open-pencil/core/clipboard'+import { createEditor, type Editor } from '@open-pencil/core/editor'+import { initCodec } from '@open-pencil/core/kiwi'++let editor: Editor++afterEach(() => editor.dispose())++const ready = 'ready-for-dev'++function setup() {+ editor = createEditor()+ return editor.graph.createNode('FRAME', editor.state.currentPageId, {+ name: 'Checkout',+ width: 100,+ height: 100,+ status: ready+ })+}++// Figma desktop 126 drops the status on ⌘D and on copy and paste (2026-10-15).+describe('copies of a layer with a status', () => {+ test('a duplicate starts without one', () => {+ const frame = setup()+ editor.select([frame.id])+ editor.duplicateSelected()+ const copy = expectDefined(editor.graph.getNode([...editor.state.selectedIds][0]))+ expect(copy.id).not.toBe(frame.id)+ expect(copy.status).toBeNull()+ expect(editor.graph.getNode(frame.id)?.status).toEqual(ready)+ })++ test('a pasted copy starts without one', async () => {+ await initCodec()+ const frame = setup()+ const html = expectDefined(await buildFigmaClipboardHTML([frame], editor.graph))+ await editor.pasteFromHTML(html)+ const pasted = expectDefined(editor.graph.getNode([...editor.state.selectedIds][0]))+ expect(pasted.id).not.toBe(frame.id)+ expect(pasted.status).toBeNull()+ })+})diff --git a/packages/core/tests/editor/statuses.test.ts b/packages/core/tests/editor/statuses.test.tsnew file mode 100644index 000000000..2eccd1029--- /dev/null+++ b/packages/core/tests/editor/statuses.test.ts@@ -0,0 +1,60 @@+import { afterEach, describe, expect, test } from 'bun:test'++import { createEditor, type Editor } from '@open-pencil/core/editor'+import { STATUS_WORKFLOW_PRESETS, writeStatusWorkflow } from '@open-pencil/scene-graph'++let editor: Editor++afterEach(() => editor.dispose())++function setup() {+ editor = createEditor()+ const { graph } = editor+ writeStatusWorkflow(graph, STATUS_WORKFLOW_PRESETS.review)+ const section = graph.createNode('SECTION', editor.state.currentPageId, {+ name: 'Checkout',+ status: 'approved'+ })+ const card = graph.createNode('FRAME', section.id, { name: 'Card' })+ return { section, card }+}++const statusOf = (id: string) => editor.graph.getNode(id)?.status++describe('statuses in the editor', () => {+ test('sets a status on every layer that can show one, as one undo step', () => {+ const { section, card } = setup()+ const frame = editor.graph.createNode('FRAME', editor.state.currentPageId, { name: 'Other' })+ expect(editor.setStatus([section.id, card.id, frame.id], 'in-review')).toBe(2)+ expect(statusOf(card.id)).toBeNull()+ expect(statusOf(frame.id)).toBe('in-review')+ expect(editor.getShownStatus(section.id)?.name).toBe('In review')+ editor.undo.undo()+ expect(statusOf(section.id)).toBe('approved')+ expect(statusOf(frame.id)).toBeNull()+ editor.undo.redo()+ expect(statusOf(section.id)).toBe('in-review')+ expect(statusOf(frame.id)).toBe('in-review')+ })++ test('clears statuses, undoably', () => {+ const { section } = setup()+ editor.setStatus([section.id], null)+ expect(statusOf(section.id)).toBeNull()+ editor.undo.undo()+ expect(statusOf(section.id)).toBe('approved')+ })++ test('a workflow edit moves layers off a dropped state and undoes as one step', () => {+ const { section } = setup()+ const states = STATUS_WORKFLOW_PRESETS.review.states.filter((state) => state.id !== 'approved')+ editor.setStatusWorkflow({ states }, { approved: 'ready-for-dev' })+ expect(editor.statusWorkflow().states.map((state) => state.id)).not.toContain('approved')+ expect(statusOf(section.id)).toBe('ready-for-dev')+ editor.undo.undo()+ expect(editor.statusWorkflow().preset).toBe('review')+ expect(statusOf(section.id)).toBe('approved')+ editor.undo.redo()+ expect(statusOf(section.id)).toBe('ready-for-dev')+ })+})diff --git a/packages/core/tests/figma-api/dev-status.test.ts b/packages/core/tests/figma-api/dev-status.test.tsnew file mode 100644index 000000000..26730c87a--- /dev/null+++ b/packages/core/tests/figma-api/dev-status.test.ts@@ -0,0 +1,131 @@+import { describe, expect, test } from 'bun:test'++import type { FigmaNodeProxy } from '@open-pencil/core'+import { FigmaAPI } from '@open-pencil/core/figma-api'+import { SceneGraph } from '@open-pencil/scene-graph'++const createAPI = () => new FigmaAPI(new SceneGraph())++// Recorded in Figma desktop 126 with the same script (2026-10-15).+const NOT_ON_PAGE =+ 'in set_devStatus: Cannot set devStatus on a node that is not directly under a page or section'+const UNDER_STATUS =+ 'in set_devStatus: Cannot set devStatus on a node inside another node with non-null devStatus'++function setup() {+ const api = createAPI()+ const host = api.createSection()+ const frame = (parent: FigmaNodeProxy, name: string) => {+ const node = api.createFrame()+ node.name = name+ parent.appendChild(node)+ return node+ }+ return { api, host, frame }+}++describe('devStatus', () => {+ test('goes on sections, frames, components, sets and instances on a page or in a section', () => {+ const { api, host, frame } = setup()+ const section = api.createSection()+ host.appendChild(section)+ const component = api.createComponent()+ host.appendChild(component)+ const instance = component.createInstance()+ host.appendChild(instance)+ const variants = [api.createComponent(), api.createComponent()]+ variants[0].name = 'v=1'+ variants[1].name = 'v=2'+ const set = api.combineAsVariants(variants, host)+ const pageFrame = api.createFrame()++ for (const node of [section, frame(host, 'F'), component, instance, set, pageFrame]) {+ node.devStatus = { type: 'READY_FOR_DEV' }+ expect(node.devStatus).toEqual({ type: 'READY_FOR_DEV' })+ }+ expect(() => {+ variants[0].devStatus = { type: 'READY_FOR_DEV' }+ }).toThrow(NOT_ON_PAGE)+ })++ test('is refused inside a frame or a section showing a status', () => {+ const { api, host, frame } = setup()+ const outer = frame(host, 'Outer')+ expect(() => {+ frame(outer, 'Inner').devStatus = { type: 'READY_FOR_DEV' }+ }).toThrow(NOT_ON_PAGE)++ const section = api.createSection()+ host.appendChild(section)+ section.devStatus = { type: 'READY_FOR_DEV' }+ expect(() => {+ frame(section, 'Child').devStatus = { type: 'READY_FOR_DEV' }+ }).toThrow(UNDER_STATUS)+ })++ test('is missing on rectangles and groups, and setting it does nothing', () => {+ const { api, host } = setup()+ const rect = api.createRectangle()+ host.appendChild(rect)+ const group = api.group([api.createRectangle()], host)+ for (const node of [rect, group]) {+ node.devStatus = { type: 'READY_FOR_DEV' }+ expect(node.devStatus).toBeUndefined()+ }+ })++ test('clears with null; a description is not kept, comments hold it', () => {+ const { host, frame } = setup()+ const node = frame(host, 'F')+ node.devStatus = { type: 'COMPLETED', description: 'hello **bold**' }+ expect(node.devStatus).toEqual({ type: 'COMPLETED' })+ node.devStatus = null+ expect(node.devStatus).toBeNull()+ })++ test('hides while the layer cannot show it, and shows again once it can', () => {+ const { api, host, frame } = setup()+ const moved = frame(host, 'Moved')+ moved.devStatus = { type: 'READY_FOR_DEV' }+ const outer = frame(host, 'Outer')+ outer.appendChild(moved)+ expect(moved.devStatus).toBeNull()+ host.appendChild(moved)+ expect(moved.devStatus).toEqual({ type: 'READY_FOR_DEV' })++ const marked = api.createSection()+ host.appendChild(marked)+ marked.devStatus = { type: 'READY_FOR_DEV' }+ const done = frame(host, 'Done')+ done.devStatus = { type: 'COMPLETED' }+ marked.appendChild(done)+ expect(done.devStatus).toBeNull()+ host.appendChild(done)+ expect(done.devStatus).toEqual({ type: 'COMPLETED' })++ const parent = api.createSection()+ host.appendChild(parent)+ const child = frame(parent, 'Child')+ child.devStatus = { type: 'READY_FOR_DEV' }+ parent.devStatus = { type: 'COMPLETED' }+ expect(child.devStatus).toBeNull()+ parent.devStatus = null+ expect(child.devStatus).toEqual({ type: 'READY_FOR_DEV' })++ const wrapped = frame(host, 'Wrapped')+ wrapped.devStatus = { type: 'READY_FOR_DEV' }+ const group = api.group([wrapped], host)+ expect(wrapped.devStatus).toBeNull()+ api.ungroup(group)+ expect(wrapped.devStatus).toEqual({ type: 'READY_FOR_DEV' })+ })++ test('is not copied by clone()', () => {+ const { host, frame } = setup()+ const node = frame(host, 'F')+ node.devStatus = { type: 'READY_FOR_DEV' }+ const copy = node.clone()+ host.appendChild(copy)+ expect(copy.devStatus).toBeNull()+ })+})diff --git a/packages/core/tests/io/formats/fig/roundtrip/statuses.test.ts b/packages/core/tests/io/formats/fig/roundtrip/statuses.test.tsnew file mode 100644index 000000000..05c79a669--- /dev/null+++ b/packages/core/tests/io/formats/fig/roundtrip/statuses.test.ts@@ -0,0 +1,26 @@+import { describe, expect, test } from 'bun:test'++import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'+import { createEditor } from '@open-pencil/core/editor'+import {+ readStatusWorkflow,+ STATUS_WORKFLOW_PRESETS,+ writeStatusWorkflow+} from '@open-pencil/scene-graph'++describe('.fig round trip of statuses', () => {+ test('keeps the workflow and every status, Figma-shown or not', async () => {+ await initCodec()+ const editor = createEditor()+ const pageId = editor.state.currentPageId+ writeStatusWorkflow(editor.graph, STATUS_WORKFLOW_PRESETS.review)+ const section = editor.graph.createNode('SECTION', pageId, { name: 'Checkout', status: 'approved' })+ editor.graph.createNode('FRAME', section.id, { name: 'Cart', status: 'ready-for-dev' })++ const reopened = await parseFigFile((await exportFigFile(editor.graph)).slice().buffer)+ const byName = (name: string) => [...reopened.nodes.values()].find((node) => node.name === name)+ expect(readStatusWorkflow(reopened)).toEqual(STATUS_WORKFLOW_PRESETS.review)+ expect(byName('Checkout')?.status).toBe('approved')+ expect(byName('Cart')?.status).toBe('ready-for-dev')+ })+})diff --git a/packages/core/tests/openpencil-api/statuses.test.ts b/packages/core/tests/openpencil-api/statuses.test.tsnew file mode 100644index 000000000..46dab8dfc--- /dev/null+++ b/packages/core/tests/openpencil-api/statuses.test.ts@@ -0,0 +1,63 @@+import { describe, expect, test } from 'bun:test'++import { FigmaAPI } from '@open-pencil/core/figma-api'+import { compileScript } from '@open-pencil/core/tools'+import { SceneGraph, STATUS_WORKFLOW_PRESETS, writeStatusWorkflow } from '@open-pencil/scene-graph'++/** A document with the design review statuses and a Checkout section holding a Cart frame. */+async function document() {+ const graph = new SceneGraph()+ writeStatusWorkflow(graph, STATUS_WORKFLOW_PRESETS.review)+ const figma = new FigmaAPI(graph)+ const ids = await compileScript(`+ const section = figma.createSection()+ section.name = 'Checkout'+ const cart = figma.createFrame()+ cart.name = 'Cart'+ section.appendChild(cart)+ const box = figma.createRectangle()+ figma.currentPage.appendChild(box)+ return { section: section.id, cart: cart.id, box: box.id }+ `)(figma)+ if (!ids || typeof ids !== 'object') throw new Error('No layers')+ return { figma, ...(ids as { section: string; cart: string; box: string }) }+}++describe('openpencil statuses', () => {+ test('a script lists the statuses and sets one by name', async () => {+ const { figma, section } = await document()+ const result = await compileScript(`+ const names = openpencil.statuses.map((status) => status.name)+ openpencil.setStatus(${JSON.stringify(section)}, 'Approved')+ return { names, approved: openpencil.getStatus(${JSON.stringify(section)}), ready: openpencil.statuses.find((status) => status.figma === 'READY_FOR_DEV').name }+ `)(figma)+ expect(result).toEqual({+ names: STATUS_WORKFLOW_PRESETS.review.states.map((state) => state.name),+ approved: 'Approved',+ ready: 'Ready for dev'+ })+ })++ test('a status hidden by a section around the layer reads as null', async () => {+ const { figma, section, cart } = await document()+ const result = await compileScript(`+ openpencil.setStatus(${JSON.stringify(cart)}, 'Draft')+ openpencil.setStatus(${JSON.stringify(section)}, 'Approved')+ const hidden = openpencil.getStatus(${JSON.stringify(cart)})+ openpencil.setStatus(${JSON.stringify(section)}, null)+ return { hidden, shown: openpencil.getStatus(${JSON.stringify(cart)}) }+ `)(figma)+ expect(result).toEqual({ hidden: null, shown: 'Draft' })+ })++ test('errors name the statuses there are and say why a layer cannot have one', async () => {+ const { figma, section, box } = await document()+ const run = (body: string) => compileScript(body)(figma)+ expect(run(`openpencil.setStatus(${JSON.stringify(section)}, 'Done')`)).rejects.toThrow(+ 'No status named Done; the document has Draft, In review'+ )+ expect(run(`openpencil.setStatus(${JSON.stringify(box)}, 'Draft')`)).rejects.toThrow(+ 'only sections, frames, components, component sets and instances can'+ )+ })+})diff --git a/packages/core/tests/tools/statuses.test.ts b/packages/core/tests/tools/statuses.test.tsnew file mode 100644index 000000000..9f5123dad--- /dev/null+++ b/packages/core/tests/tools/statuses.test.ts@@ -0,0 +1,32 @@+import { describe, expect, test } from 'bun:test'++import { FigmaAPI } from '@open-pencil/core/figma-api'+import { SceneGraph, STATUS_WORKFLOW_PRESETS, writeStatusWorkflow } from '@open-pencil/scene-graph'++import { getStatuses, setStatus } from '#core/tools/statuses'++describe('status tools', () => {+ test('agents list statuses, set one by name, and find the layers that show it', async () => {+ const graph = new SceneGraph()+ writeStatusWorkflow(graph, STATUS_WORKFLOW_PRESETS.review)+ const figma = new FigmaAPI(graph)+ const section = figma.createSection()+ section.name = 'Checkout'++ expect(await setStatus.execute(figma, { node: section.id, status: 'In review' })).toEqual({+ node: section.id,+ status: 'In review'+ })+ expect(await getStatuses.execute(figma, { status: 'In review' })).toMatchObject({+ layers: [{ id: section.id, name: 'Checkout', type: 'SECTION', status: 'In review' }]+ })+ expect(await getStatuses.execute(figma, { status: 'Approved' })).toMatchObject({ layers: [] })+ })++ test('an unknown status is reported, not set', async () => {+ const figma = new FigmaAPI(new SceneGraph())+ const section = figma.createSection()+ const result = await setStatus.execute(figma, { node: section.id, status: 'Approved' })+ expect(result).toEqual({ error: 'No status named Approved; the document has Ready for dev, Completed' })+ })+})diff --git a/packages/docs/pl/programmable/cli/scripting.md b/packages/docs/pl/programmable/cli/scripting.mdindex 4fe28bcee..0f1de5104 100644--- a/packages/docs/pl/programmable/cli/scripting.md+++ b/packages/docs/pl/programmable/cli/scripting.md@@ -94,7 +94,8 @@ Najczęściej używane właściwości można odczytywać i zapisywać przez poś- wygląd: `fills`, `strokes`, `effects`, `opacity`, `visible`, `locked`, `blendMode`, `clipsContent`;- tekst: `characters`, `fontSize`, `fontName`, `fontWeight`, wyrównanie, interlinia, odstęp między znakami i funkcje zakresów stylów;- automatyczny układ: `layoutMode`, `primaryAxisAlignItems`, `counterAxisAlignItems`, `itemSpacing`, wypełnienie, rozmiary i położenie;-- obwiednia: `strokeWeight`, `strokeAlign`, `dashPattern`.+- obwiednia: `strokeWeight`, `strokeAlign`, `dashPattern`;+- status: `devStatus` sekcji, ramek, komponentów, zestawów komponentów i instancji leżących bezpośrednio na stronie lub w sekcji: `{ type: 'READY_FOR_DEV' | 'COMPLETED' }` albo `null` (opis nie jest zachowywany); odczytuje się jako `null`, dopóki warstwa leży tam, gdzie status nie jest widoczny.### Narzędzia pomocniczediff --git a/packages/docs/programmable/cli/scripting.md b/packages/docs/programmable/cli/scripting.mdindex 7e9b79835..f80fc16ce 100644--- a/packages/docs/programmable/cli/scripting.md+++ b/packages/docs/programmable/cli/scripting.md@@ -125,6 +125,20 @@ openpencil eval design.fig -w -c '- `openpencil.addComment(text, { node, page, x, y, author })` pins a comment on a layer, which it follows, or at a point of a page; the current page by default. `author` is `"Agent"` when left out.- A comment has `id`, `text` (Markdown), `author`, `createdAt`, `resolved`, `page`, `node` (the top-level layer it is pinned to), `position`, and `replies`, and `reply(text, { author })`, `resolve()`, `reopen()`, and `remove()`. `openpencil.getComment(id)` finds one.+Statuses mark where a section, frame, component, or instance stands, from the document's own list such as Draft, In review, or Ready for dev:++```sh+openpencil eval design.fig -w -c '+ const checkout = figma.currentPage.findOne(n => n.name === "Checkout")+ openpencil.setStatus(checkout, "Approved")+ openpencil.statuses.map(status => status.name)+'+```++- `openpencil.statuses` lists the document's statuses in order, each with `name`, `color` (`#RRGGBB`), and `figma`, the status Figma shows for it (`READY_FOR_DEV`, `COMPLETED`, or `null`).+- `openpencil.getStatus(node)` reads the name of the status a layer shows, or `null`, also while a section around it shows its own.+- `openpencil.setStatus(node, name)` sets one by name, and `null` clears it. Only sections, frames, components, component sets, and instances directly on a page or in a section take one; anything else fails with an error that says why, and an unknown name lists the statuses there are.+## Supported API surfaceThe API is intentionally close to Figma's Plugin API, but it maps to OpenPencil's scene graph and file format.@@ -199,6 +213,7 @@ Common node properties are readable/writable through the proxy, including:- Text lists and paragraphs: `getRangeListOptions` / `setRangeListOptions` for bulleted (`UNORDERED`) and numbered (`ORDERED`) items, `getRangeIndentation` / `setRangeIndentation` for nesting (1–5 for list items), `listSpacing`, `paragraphSpacing`, and `paragraphIndent` for the whole text (`figma.mixed` when paragraphs differ) or per paragraph with `getRangeListSpacing` / `setRangeListSpacing`, `getRangeParagraphSpacing` / `setRangeParagraphSpacing`, and `getRangeParagraphIndent` / `setRangeParagraphIndent`, and `hangingList`- Auto-layout: `layoutMode`, `primaryAxisAlignItems`, `counterAxisAlignItems`, `itemSpacing`, padding, sizing, and layout positioning fields- Stroke helpers: `strokeWeight`, `strokeAlign`, `dashPattern`+- Status: `devStatus` on sections, frames, components, component sets, and instances directly on a page or in a section, as `{ type: 'READY_FOR_DEV' | 'COMPLETED' }` or `null` (a description is not kept); it reads `null` while the layer sits where it cannot show one### Utilitiesdiff --git a/packages/docs/programmable/mcp-server.md b/packages/docs/programmable/mcp-server.mdindex 18efdc122..ac2c89e9b 100644--- a/packages/docs/programmable/mcp-server.md+++ b/packages/docs/programmable/mcp-server.md@@ -360,6 +360,13 @@ Settings tools never expose credentials, AI models, MCP connections, storage, or| `reply_to_comment` | Answer a thread, which reopens it if it was resolved || `resolve_comment` | Resolve a thread once its feedback is addressed, or reopen it |+### Statuses++| Tool | Description |+|------|-------------|+| `get_statuses` | List the document's statuses and the sections, frames, components, and instances that show one, optionally only one status |+| `set_status` | Give a layer one of the document's statuses by name, or clear it |+### Navigation| Tool | Description |diff --git a/packages/docs/ru/programmable/cli/scripting.md b/packages/docs/ru/programmable/cli/scripting.mdindex 82ffb07e6..3a1a0f4dc 100644--- a/packages/docs/ru/programmable/cli/scripting.md+++ b/packages/docs/ru/programmable/cli/scripting.md@@ -133,7 +133,8 @@ API намеренно близок к Figma Plugin API, но работает- радиусы: `cornerRadius`, `topLeftRadius`, `topRightRadius`, `bottomRightRadius`, `bottomLeftRadius`;- текст: `characters`, `fontSize`, `fontName`, `fontWeight`, выравнивание, интерлиньяж, межбуквенный интервал и функции для диапазонов стилей;- автоматическая компоновка: `layoutMode`, `primaryAxisAlignItems`, `counterAxisAlignItems`, `itemSpacing`, отступы, размеры и положение;-- обводка: `strokeWeight`, `strokeAlign`, `dashPattern`.+- обводка: `strokeWeight`, `strokeAlign`, `dashPattern`;+- статус: `devStatus` у секций, фреймов, компонентов, наборов компонентов и экземпляров, лежащих прямо на странице или в секции: `{ type: 'READY_FOR_DEV' | 'COMPLETED' }` или `null` (описание не сохраняется); он читается как `null`, пока слой лежит там, где статус не показывается.### Служебные возможностиdiff --git a/packages/fig/src/node-change/convert.ts b/packages/fig/src/node-change/convert.tsindex e7cf55574..1c8844e3a 100644--- a/packages/fig/src/node-change/convert.ts+++ b/packages/fig/src/node-change/convert.ts@@ -28,6 +28,7 @@ import {extractPluginRelaunchData,readNodeChangePluginData} from './plugin-data'+import { extractNodeStatus } from './status'import { styleRefId } from './style/refs'import { importStyleRuns } from './style/runs'import { importParagraphStyles } from './text/lines'@@ -726,6 +727,7 @@ export function nodeChangeToProps(variableBindingScales: sourceVariableBindingScales(nc),variableModes: extractVariableModes(nc),exportSettings: extractExportSettings(nc),+ status: extractNodeStatus(nc),pluginData: extractPluginData(nc),librarySource: extractLibrarySource(nc),pluginRelaunchData: extractPluginRelaunchData(nc),diff --git a/packages/fig/src/node-change/export/node.ts b/packages/fig/src/node-change/export/node.tsindex a68de997a..672289585 100644--- a/packages/fig/src/node-change/export/node.ts+++ b/packages/fig/src/node-change/export/node.ts@@ -32,6 +32,7 @@ import {mergePluginData,serializePluginRelaunchData} from '../plugin-data'+import { serializeNodeStatus } from '../status'import {applyColorVariableBinding,createFillPaints,@@ -1046,6 +1047,7 @@ export function sceneNodeToKiwiWithContext(applyExportSettingsPluginData(node)applyLibrarySourcePluginData(node)+ serializeNodeStatus(node, nc)applyTextPathBoxPluginData(node)const pluginData = mergePluginData(node.pluginData)if (pluginData.length > 0) nc.pluginData = pluginDatadiff --git a/packages/fig/src/node-change/status.ts b/packages/fig/src/node-change/status.tsnew file mode 100644index 000000000..655074122--- /dev/null+++ b/packages/fig/src/node-change/status.ts@@ -0,0 +1,56 @@+import * as v from 'valibot'++import type { NodeChange } from '@open-pencil/kiwi/fig/codec'+import {+ FIGMA_STATUS_STATE_IDS,+ figmaDevStatusOf,+ OPEN_PENCIL_PLUGIN_DATA,+ withPluginData,+ type FigmaDevStatus,+ type SceneNode+} from '@open-pencil/scene-graph'++import { readEffectiveFigmaRawField } from '../source-metadata'+import type { KiwiNodeChange } from './export/context'+import { readNodeChangePluginData } from './plugin-data'++const FIGMA_SECTION_STATUS = { READY_FOR_DEV: 'BUILD', COMPLETED: 'COMPLETED' } as const++const sectionStatusInfo = v.object({+ status: v.fallback(v.picklist(['NONE', 'BUILD', 'COMPLETED']), 'NONE')+})++function figmaStatus(nc: NodeChange): FigmaDevStatus | null {+ const parsed = v.safeParse(sectionStatusInfo, nc.sectionStatusInfo)+ const status = parsed.success ? parsed.output.status : 'NONE'+ if (status === 'BUILD') return 'READY_FOR_DEV'+ if (status === 'COMPLETED') return 'COMPLETED'+ return null+}++/**+ * A record's status. Figma keeps only Ready for dev or Completed in `sectionStatusInfo`;+ * OpenPencil's plugin data names any state. The plugin data counts while Figma's field still+ * agrees with it; once someone changed the status in Figma, Figma's status counts.+ */+export function extractNodeStatus(nc: NodeChange): string | null {+ const figma = figmaStatus(nc)+ const stored = readNodeChangePluginData(nc, OPEN_PENCIL_PLUGIN_DATA.status) ?? null+ if (stored !== null && figmaDevStatusOf(stored) === figma) return stored+ return figma ? FIGMA_STATUS_STATE_IDS[figma] : null+}++/**+ * Writes the status as Figma reads it, where it has a counterpart, and as plugin data. A status+ * unchanged since the file was read keeps the file's own record.+ */+export function serializeNodeStatus(node: SceneNode, nc: KiwiNodeChange): void {+ node.pluginData = withPluginData(+ node.pluginData,+ OPEN_PENCIL_PLUGIN_DATA.status,+ node.status ?? undefined+ )+ if (readEffectiveFigmaRawField(node, 'sectionStatusInfo') !== undefined) return+ const figma = node.status ? figmaDevStatusOf(node.status) : null+ if (figma) nc.sectionStatusInfo = { status: FIGMA_SECTION_STATUS[figma] }+}diff --git a/packages/fig/src/source-metadata.ts b/packages/fig/src/source-metadata.tsindex c1ee6e358..816136c9b 100644--- a/packages/fig/src/source-metadata.ts+++ b/packages/fig/src/source-metadata.ts@@ -29,6 +29,7 @@ const EDITED_RAW_FIELDS: Partial<Record<string, readonly string[]>> = {layoutGrids: ['layoutGrids'],guides: ['guides'],exportSettings: ['exportSettings'],+ status: ['sectionStatusInfo'],cornerRadius: ['cornerRadius'],independentCorners: ['rectangleCornerRadiiIndependent'],topLeftRadius: ['rectangleTopLeftCornerRadius', 'rectangleCornerRadiiIndependent'],diff --git a/packages/fig/tests/node-change/status.test.ts b/packages/fig/tests/node-change/status.test.tsnew file mode 100644index 000000000..60f1945fb--- /dev/null+++ b/packages/fig/tests/node-change/status.test.ts@@ -0,0 +1,55 @@+import { describe, expect, test } from 'bun:test'++import type { KiwiNodeChange } from '#fig/node-change/export/context'+import { extractNodeStatus, serializeNodeStatus } from '#fig/node-change/status'++import type { NodeChange } from '@open-pencil/kiwi/fig/codec'+import { OPEN_PENCIL_PLUGIN_DATA, OPEN_PENCIL_PLUGIN_ID } from '@open-pencil/scene-graph'+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'++function written(status: string): NodeChange {+ let id = 0+ const node = createDefaultNode(() => String(++id), 'SECTION', { status })+ const nc: KiwiNodeChange = {}+ serializeNodeStatus(node, nc)+ return {+ ...nc,+ pluginData: node.pluginData.map((entry) => ({+ pluginID: entry.pluginId,+ key: entry.key,+ value: entry.value+ }))+ }+}++describe('section status in .fig records', () => {+ test('writes Ready for dev and Completed as Figma stores them', () => {+ expect(written('ready-for-dev').sectionStatusInfo).toEqual({ status: 'BUILD' })+ expect(written('completed').sectionStatusInfo).toEqual({ status: 'COMPLETED' })+ })++ test('a status Figma has no counterpart for lives in plugin data only', () => {+ const nc = written('approved')+ expect(nc.sectionStatusInfo).toBeUndefined()+ expect(extractNodeStatus(nc)).toBe('approved')+ })++ test('a status changed in Figma wins over the one OpenPencil wrote', () => {+ expect(+ extractNodeStatus({ ...written('approved'), sectionStatusInfo: { status: 'COMPLETED' } })+ ).toBe('completed')+ expect(+ extractNodeStatus({ ...written('ready-for-dev'), sectionStatusInfo: { status: 'NONE' } })+ ).toBeNull()+ })++ test("Figma's status reads without plugin data, and a malformed entry is ignored", () => {+ const nc: NodeChange = {+ sectionStatusInfo: { status: 'BUILD' },+ pluginData: [+ { pluginID: OPEN_PENCIL_PLUGIN_ID, key: OPEN_PENCIL_PLUGIN_DATA.status.key, value: '{' }+ ]+ }+ expect(extractNodeStatus(nc)).toBe('ready-for-dev')+ })+})diff --git a/packages/scene-graph/AGENTS.md b/packages/scene-graph/AGENTS.mdindex 3f915e3bc..ab78b166a 100644--- a/packages/scene-graph/AGENTS.md+++ b/packages/scene-graph/AGENTS.md@@ -19,6 +19,7 @@ Framework-neutral document model. Owns node types, primitives, geometry, matrice- Formats read auto layout keywords (stack direction, `justify-content`, `align-items`, `align-self`, padding shorthand) through `packages/scene-graph/src/layout/keywords.ts`, and an importer builds fill and hug for a node not yet in the graph with `fillSizingFields` and `autoLayoutSizingFields`. Design JSX and `.pen` pass their own spellings straight to it, and DOM/CSS parses CSS values first with `parseCSSJustifyContent` and its siblings in `@open-pencil/scene-graph/css` (`packages/scene-graph/tests/layout/keywords.test.ts`, `packages/scene-graph/tests/css/layout.test.ts`).- CSS values that become scene-graph types, such as grid track lists, are parsed in `@open-pencil/scene-graph/css` on `postcss-value-parser`; design-jsx and dom-css call it instead of splitting or matching CSS by hand (`packages/scene-graph/tests/css`).- Every plugin-data key OpenPencil writes is a field of `OPEN_PENCIL_PLUGIN_DATA` in `packages/scene-graph/src/plugin-data/fields.ts`, with the Valibot schema that reads it and its role: `content` travels with library assets and counts towards their hash (`contentPluginData`), `format` repeats a node field for files, `bookkeeping` stays behind. Read and replace entries with `readPluginData` and `withPluginData` instead of matching `pluginId` and `key` by hand. The fields test checks that keys stay unique.+- A layer's `status` stays stored wherever the layer moves, as Figma keeps it; whether it shows, and whether one may be set, come from `effectiveStatus` and `statusPlacement` in `packages/scene-graph/src/statuses/node.ts`, which the Figma API, `.fig` and the UI share. Copies start without one (`packages/core/tests/figma-api/dev-status.test.ts`).- Vector network types live here; `vectorNetworkBlob` codecs live in `packages/core/src/vector/`.- `packages/scene-graph/src/checkpoint.ts` owns transaction checkpoint recovery, including hierarchy and indexes; Core's atomic tool execution relies on it.- Export named types and primitives (`Color`, `Vector`, `Rect`, `SceneNode`, `Effect`, `Fill`, `Stroke`) from the public entry; downstream packages reuse them instead of respelling shapes.diff --git a/packages/scene-graph/src/copy.ts b/packages/scene-graph/src/copy.tsindex 5d358ee78..dfb23877c 100644--- a/packages/scene-graph/src/copy.ts+++ b/packages/scene-graph/src/copy.ts@@ -289,6 +289,8 @@ export function cloneNodeProps(pluginData: copySpread(src.pluginData),pluginRelaunchData: copySpread(src.pluginRelaunchData),exportSettings: copySpread(src.exportSettings),+ // Generated instance descendants have no status of their own.+ status: componentId === null ? src.status : null,componentPropertyValues: { ...src.componentPropertyValues },derivedLayout: src.derivedLayout ? { ...src.derivedLayout } : null,arcData: src.arcData ? copyArcData(src.arcData) : null,diff --git a/packages/scene-graph/src/index.ts b/packages/scene-graph/src/index.tsindex 3c700532f..fa9b9a60a 100644--- a/packages/scene-graph/src/index.ts+++ b/packages/scene-graph/src/index.ts@@ -43,6 +43,10 @@ export * from './comments/document'export * from './comments/list'export * from './comments/merge'export * from './comments/threads'+export * from './statuses/impact'+export * from './statuses/node'+export * from './statuses/schema'+export * from './statuses/workflow'export * from './copy'export {createDefaultNode,@@ -906,7 +910,10 @@ export class SceneGraph {// `as SourceMetadata` required: cloneNodeProps returns Partial<SceneNode>,// so props.source is SourceMetadata | undefined, but we know it's always set.props.source = { ...(props.source as SourceMetadata), id: null, orderKey: null }+ // A copy is a new design nobody has reviewed: Figma's duplicate and clone() drop the status.+ props.status = nullconst clone = this.createNode(src.type, parentId, { ...props, ...overrides })+ if (src.status) markSourceFieldsEdited(clone, ['status'])for (const childId of src.childIds) {this.cloneTree(childId, clone.id)diff --git a/packages/scene-graph/src/node-defaults.ts b/packages/scene-graph/src/node-defaults.tsindex 74583d8b9..f47ef7069 100644--- a/packages/scene-graph/src/node-defaults.ts+++ b/packages/scene-graph/src/node-defaults.ts@@ -202,6 +202,7 @@ export function createDefaultNode(componentScale: 1,variableModes: {},exportSettings: [],+ status: null,pluginData: [],pluginRelaunchData: [],internalOnly: false,diff --git a/packages/scene-graph/src/plugin-data/fields.ts b/packages/scene-graph/src/plugin-data/fields.tsindex 2f386cf87..c0cdc3c77 100644--- a/packages/scene-graph/src/plugin-data/fields.ts+++ b/packages/scene-graph/src/plugin-data/fields.ts@@ -7,6 +7,7 @@ import { clampExportScale } from '../export-scale'import { iconSchema, iconTintSchema } from '../icons/schema'import type { Rect } from '../primitives'import { shaderPaintSchema } from '../shaders/schema'+import { nodeStatusSchema, statusWorkflowSchema } from '../statuses/schema'import {MODE_ATTRIBUTE_PATTERN,TOKEN_UNITS,@@ -208,6 +209,10 @@ export const OPEN_PENCIL_PLUGIN_DATA = {),/** Canvas comment threads, deleted ones included, on the DOCUMENT node. */comments: jsonPluginDataField('comments', 'bookkeeping', comments),+ /** The statuses layers can be in, on the DOCUMENT node. */+ statuses: jsonPluginDataField('statuses', 'bookkeeping', statusWorkflowSchema),+ /** A layer's status, any state of the workflow; Figma's `sectionStatusInfo` knows only two. */+ status: jsonPluginDataField('status', 'format', nodeStatusSchema),/** Unit and CSS expressions, on each VARIABLE. */token: jsonPluginDataField('token', 'format', token),/** Mode conditions by mode id, on each VARIABLE_SET. */diff --git a/packages/scene-graph/src/statuses/impact.ts b/packages/scene-graph/src/statuses/impact.tsnew file mode 100644index 000000000..6f9460a98--- /dev/null+++ b/packages/scene-graph/src/statuses/impact.ts@@ -0,0 +1,38 @@+import { groupBy } from 'es-toolkit'++import type { SceneGraph } from '../index'+import { effectiveStatus } from './node'+import type { StatusWorkflow } from './schema'+import { findStatusState } from './workflow'++/** A group of layers that would show another state, or none when `to` is null. */+export interface StatusWorkflowImpact {+ from: string+ to: string | null+ count: number+}++/**+ * What replacing the `current` workflow with `next` does to the layers that show a status, where+ * `moves` sends the layers in a state `next` drops to another state or clears theirs with null.+ * Renamed and moved states both read here as the name people will see change.+ */+export function statusWorkflowImpact(+ graph: SceneGraph,+ current: StatusWorkflow,+ next: StatusWorkflow,+ moves: Readonly<Partial<Record<string, string | null>>>+): StatusWorkflowImpact[] {+ const changes: { from: string; to: string | null }[] = []+ for (const node of graph.getAllNodes()) {+ const id = effectiveStatus(graph, node)+ if (id === null) continue+ const from = findStatusState(current, id)?.name+ if (from === undefined) continue+ const target = moves[id]+ const to = target === null ? null : (findStatusState(next, target ?? id)?.name ?? null)+ if (to !== from) changes.push({ from, to })+ }+ const groups = groupBy(changes, (change) => `${change.from}\0${change.to ?? ''}`)+ return Object.values(groups).map((group) => ({ ...group[0], count: group.length }))+}diff --git a/packages/scene-graph/src/statuses/node.ts b/packages/scene-graph/src/statuses/node.tsnew file mode 100644index 000000000..64f500d2e--- /dev/null+++ b/packages/scene-graph/src/statuses/node.ts@@ -0,0 +1,63 @@+import type { SceneGraph } from '../index'+import type { NodeType, SceneNode } from '../types'++/** Layers Figma lets carry a status, `DevStatusMixin` in the Plugin API. */+export const STATUS_NODE_TYPES: ReadonlySet<NodeType> = new Set<NodeType>([+ 'SECTION',+ 'FRAME',+ 'COMPONENT',+ 'COMPONENT_SET',+ 'INSTANCE'+])++const STATUS_PARENT_TYPES: ReadonlySet<NodeType> = new Set<NodeType>(['CANVAS', 'SECTION'])++/**+ * Whether a layer can show a status where it is, and if not, why:+ * - `type`: the kind of layer never has one;+ * - `parent`: it is not directly on a page or in a section;+ * - `ancestor`: a section around it shows a status of its own.+ */+export type StatusPlacement = 'ok' | 'type' | 'parent' | 'ancestor'++function isPlacedForStatus(graph: SceneGraph, node: SceneNode): boolean {+ const parent = node.parentId ? graph.getNode(node.parentId) : undefined+ return (+ STATUS_NODE_TYPES.has(node.type) && parent !== undefined && STATUS_PARENT_TYPES.has(parent.type)+ )+}++/** The layer and its ancestors below the page, outermost first. */+function sectionChain(graph: SceneGraph, node: SceneNode): SceneNode[] {+ const chain: SceneNode[] = []+ graph.closest(node.id, (current) => {+ if (current.type === 'CANVAS' || current.id === graph.rootId) return true+ chain.push(current)+ return false+ })+ return chain.reverse()+}++/** The outermost layer from `node` up whose status shows; it hides every status inside it. */+function showingStatusOwner(graph: SceneGraph, node: SceneNode): SceneNode | undefined {+ return sectionChain(graph, node).find(+ (current) => current.status !== null && isPlacedForStatus(graph, current)+ )+}++export function statusPlacement(graph: SceneGraph, node: SceneNode): StatusPlacement {+ if (!STATUS_NODE_TYPES.has(node.type)) return 'type'+ if (!isPlacedForStatus(graph, node)) return 'parent'+ const owner = showingStatusOwner(graph, node)+ return owner && owner.id !== node.id ? 'ancestor' : 'ok'+}++/**+ * The state id a layer shows. As in Figma, a status stays stored while the layer sits where it+ * cannot show one, inside a frame or in a section showing its own, and shows again once the+ * layer is back on a page or in a plain section.+ */+export function effectiveStatus(graph: SceneGraph, node: SceneNode): string | null {+ if (!node.status) return null+ return showingStatusOwner(graph, node)?.id === node.id ? node.status : null+}diff --git a/packages/scene-graph/src/statuses/schema.ts b/packages/scene-graph/src/statuses/schema.tsnew file mode 100644index 000000000..1dc6bf4bc--- /dev/null+++ b/packages/scene-graph/src/statuses/schema.ts@@ -0,0 +1,39 @@+import * as v from 'valibot'++/** Figma's own statuses, `DevStatus['type']` in the Plugin API. */+export const FIGMA_DEV_STATUSES = ['READY_FOR_DEV', 'COMPLETED'] as const+export type FigmaDevStatus = (typeof FIGMA_DEV_STATUSES)[number]++const color = v.object({+ r: v.pipe(v.number(), v.minValue(0), v.maxValue(1)),+ g: v.pipe(v.number(), v.minValue(0), v.maxValue(1)),+ b: v.pipe(v.number(), v.minValue(0), v.maxValue(1)),+ a: v.pipe(v.number(), v.minValue(0), v.maxValue(1))+})++const statusState = v.object({+ id: v.pipe(v.string(), v.nonEmpty()),+ name: v.pipe(v.string(), v.trim(), v.nonEmpty(), v.maxLength(100)),+ color+})++/** One status a document's layers can be in. */+export type StatusState = v.InferOutput<typeof statusState>++/** A document's statuses, in the order menus list them. */+export const statusWorkflowSchema = v.pipe(+ v.object({+ /** The preset the states started from, so the editor can name it while they still match. */+ preset: v.optional(v.string()),+ states: v.pipe(v.array(statusState), v.minLength(1))+ }),+ v.check(+ ({ states }) => new Set(states.map((state) => state.id)).size === states.length,+ 'Status ids must be unique'+ )+)++export type StatusWorkflow = v.InferOutput<typeof statusWorkflowSchema>++/** A layer's status: the id of a state in the document's workflow. */+export const nodeStatusSchema = v.pipe(v.string(), v.nonEmpty())diff --git a/packages/scene-graph/src/statuses/workflow.ts b/packages/scene-graph/src/statuses/workflow.tsnew file mode 100644index 000000000..a3f463ed9--- /dev/null+++ b/packages/scene-graph/src/statuses/workflow.ts@@ -0,0 +1,121 @@+import { parseColor } from '../color'+import type { SceneGraph } from '../index'+import { readPluginData, withPluginData } from '../plugin-data/field'+import { OPEN_PENCIL_PLUGIN_DATA } from '../plugin-data/fields'+import type { SceneNode } from '../types'+import { effectiveStatus } from './node'+import type { FigmaDevStatus, StatusState, StatusWorkflow } from './schema'++const { statuses } = OPEN_PENCIL_PLUGIN_DATA++/**+ * The states Figma shows, by fixed id. Teams rename them as they like, but a `.fig` file's+ * Ready for dev and Completed always read back as these, without the document's workflow.+ */+export const FIGMA_STATUS_STATE_IDS = {+ READY_FOR_DEV: 'ready-for-dev',+ COMPLETED: 'completed'+} as const satisfies Record<FigmaDevStatus, string>++const READY_FOR_DEV: StatusState = {+ id: FIGMA_STATUS_STATE_IDS.READY_FOR_DEV,+ name: 'Ready for dev',+ color: parseColor('#14ae5c')+}++const COMPLETED: StatusState = {+ id: FIGMA_STATUS_STATE_IDS.COMPLETED,+ name: 'Completed',+ color: parseColor('#8a8a8a')+}++/**+ * Workflows to start from. Their states keep fixed ids, so a document using a preset, or no+ * workflow of its own, reads the same states back.+ */+export const STATUS_WORKFLOW_PRESETS = {+ handoff: { preset: 'handoff', states: [READY_FOR_DEV, COMPLETED] },+ simple: {+ preset: 'simple',+ states: [+ { id: 'draft', name: 'Draft', color: parseColor('#b3b3b3') },+ { id: 'in-progress', name: 'In progress', color: parseColor('#0d99ff') },+ { ...COMPLETED, name: 'Done', color: parseColor('#14ae5c') }+ ]+ },+ review: {+ preset: 'review',+ states: [+ { id: 'draft', name: 'Draft', color: parseColor('#b3b3b3') },+ { id: 'in-review', name: 'In review', color: parseColor('#9747ff') },+ { id: 'changes-requested', name: 'Changes requested', color: parseColor('#f24822') },+ { id: 'approved', name: 'Approved', color: parseColor('#0d99ff') },+ READY_FOR_DEV,+ { ...COMPLETED, name: 'Shipped' }+ ]+ }+} as const satisfies Record<string, StatusWorkflow>++export type StatusWorkflowPreset = keyof typeof STATUS_WORKFLOW_PRESETS++/**+ * The document's statuses. A document that never chose any has Figma's own, so a `.fig` file's+ * Ready for dev and Completed read as statuses without setup.+ */+export function readStatusWorkflow(graph: SceneGraph): StatusWorkflow {+ return (+ readPluginData(graph.getNode(graph.rootId)?.pluginData, statuses) ??+ STATUS_WORKFLOW_PRESETS.handoff+ )+}++/** Stores the workflow on the document node, as an undoable document change. */+export function writeStatusWorkflow(graph: SceneGraph, workflow: StatusWorkflow): void {+ const root = graph.getNode(graph.rootId)+ if (!root) return+ graph.updateNode(root.id, {+ pluginData: withPluginData(root.pluginData, statuses, structuredClone(workflow))+ })+}++/**+ * The state `stateId` names: the workflow's own, or Figma's when the workflow has no such state,+ * as a `.fig` file's Ready for dev reads in a document whose team removed it.+ */+export function findStatusState(+ workflow: StatusWorkflow,+ stateId: string+): StatusState | undefined {+ return (+ workflow.states.find((state) => state.id === stateId) ??+ STATUS_WORKFLOW_PRESETS.handoff.states.find((state) => state.id === stateId)+ )+}++/** The Figma status a state shows as in Figma and the Plugin API's `devStatus`, if any. */+export function figmaDevStatusOf(stateId: string): FigmaDevStatus | null {+ if (stateId === FIGMA_STATUS_STATE_IDS.READY_FOR_DEV) return 'READY_FOR_DEV'+ if (stateId === FIGMA_STATUS_STATE_IDS.COMPLETED) return 'COMPLETED'+ return null+}++const WORKFLOWS = new WeakMap<SceneGraph, { entries: unknown; workflow: StatusWorkflow }>()++/**+ * The document's statuses, read once per change to the document node: canvas labels ask for+ * them on every frame.+ */+export function cachedStatusWorkflow(graph: SceneGraph): StatusWorkflow {+ const entries = graph.getNode(graph.rootId)?.pluginData+ const known = WORKFLOWS.get(graph)+ if (known && known.entries === entries) return known.workflow+ const workflow = readStatusWorkflow(graph)+ WORKFLOWS.set(graph, { entries, workflow })+ return workflow+}++/** The state a layer shows, if any. */+export function shownStatusState(graph: SceneGraph, node: SceneNode): StatusState | null {+ const id = effectiveStatus(graph, node)+ return id === null ? null : (findStatusState(cachedStatusWorkflow(graph), id) ?? null)+}diff --git a/packages/scene-graph/src/types.ts b/packages/scene-graph/src/types.tsindex 262b3923d..ffa985845 100644--- a/packages/scene-graph/src/types.ts+++ b/packages/scene-graph/src/types.ts@@ -716,6 +716,12 @@ export interface SceneNode {componentScale: numbervariableModes: VariableModeMapexportSettings: ExportSetting[]+ /**+ * The id of the status a team gave the layer, a state of the document's workflow such as Ready+ * for dev. It stays while the layer sits where it cannot show one; `effectiveStatus` tells+ * whether it shows.+ */+ status: string | nullpluginData: PluginDataEntry[]pluginRelaunchData: PluginRelaunchDataEntry[]diff --git a/packages/scene-graph/tests/statuses/impact.test.ts b/packages/scene-graph/tests/statuses/impact.test.tsnew file mode 100644index 000000000..cbd79ea99--- /dev/null+++ b/packages/scene-graph/tests/statuses/impact.test.ts@@ -0,0 +1,50 @@+import { describe, expect, test } from 'bun:test'++import {+ SceneGraph,+ statusWorkflowImpact,+ STATUS_WORKFLOW_PRESETS,+ type StatusWorkflow+} from '@open-pencil/scene-graph'++const { review } = STATUS_WORKFLOW_PRESETS++function setup(states: Record<string, string>) {+ const graph = new SceneGraph()+ const page = graph.getPages()[0].id+ for (const [name, status] of Object.entries(states)) graph.createNode('FRAME', page, { name, status })+ return graph+}++function renamed(workflow: StatusWorkflow, id: string, name: string): StatusWorkflow {+ return {+ states: workflow.states.map((state) => (state.id === id ? { ...state, name } : state))+ }+}++describe('what a workflow change does to layers', () => {+ test('nothing for a change no layer shows', () => {+ const graph = setup({ A: 'approved' })+ expect(statusWorkflowImpact(graph, review, renamed(review, 'draft', 'Idea'), {})).toEqual([])+ })++ test('a rename of a state in use, counted per pair of names', () => {+ const graph = setup({ A: 'approved', B: 'approved', C: 'draft' })+ expect(statusWorkflowImpact(graph, review, renamed(review, 'approved', 'Signed off'), {})).toEqual([+ { from: 'Approved', to: 'Signed off', count: 2 }+ ])+ })++ test('a dropped state moves its layers or clears their status', () => {+ const graph = setup({ A: 'approved', B: 'draft' })+ const next = {+ states: review.states.filter((state) => state.id !== 'approved' && state.id !== 'draft')+ }+ expect(+ statusWorkflowImpact(graph, review, next, { approved: 'ready-for-dev', draft: null })+ ).toEqual([+ { from: 'Approved', to: 'Ready for dev', count: 1 },+ { from: 'Draft', to: null, count: 1 }+ ])+ })+})diff --git a/packages/scene-graph/tests/statuses/workflow.test.ts b/packages/scene-graph/tests/statuses/workflow.test.tsnew file mode 100644index 000000000..8961267c9--- /dev/null+++ b/packages/scene-graph/tests/statuses/workflow.test.ts@@ -0,0 +1,43 @@+import { describe, expect, test } from 'bun:test'++import {+ findStatusState,+ OPEN_PENCIL_PLUGIN_DATA,+ readStatusWorkflow,+ SceneGraph,+ STATUS_WORKFLOW_PRESETS,+ withPluginData,+ writeStatusWorkflow+} from '@open-pencil/scene-graph'++describe('status workflow', () => {+ test("a document without one has Figma's Ready for dev and Completed", () => {+ expect(readStatusWorkflow(new SceneGraph())).toEqual(STATUS_WORKFLOW_PRESETS.handoff)+ })++ test('is stored on the document node and read back', () => {+ const graph = new SceneGraph()+ writeStatusWorkflow(graph, STATUS_WORKFLOW_PRESETS.review)+ expect(readStatusWorkflow(graph)).toEqual(STATUS_WORKFLOW_PRESETS.review)+ })++ test('a workflow with repeated ids is ignored', () => {+ const graph = new SceneGraph()+ const root = graph.getNode(graph.rootId)+ if (!root) throw new Error('missing root')+ const [state] = STATUS_WORKFLOW_PRESETS.simple.states+ graph.updateNode(root.id, {+ pluginData: withPluginData(root.pluginData, OPEN_PENCIL_PLUGIN_DATA.statuses, {+ states: [state, state]+ })+ })+ expect(readStatusWorkflow(graph)).toEqual(STATUS_WORKFLOW_PRESETS.handoff)+ })++ test("Figma's states read even in a workflow that removed them", () => {+ const { simple } = STATUS_WORKFLOW_PRESETS+ expect(findStatusState(simple, 'ready-for-dev')?.name).toBe('Ready for dev')+ expect(findStatusState(simple, 'completed')?.name).toBe('Done')+ expect(findStatusState(simple, 'unknown')).toBeUndefined()+ })+})diff --git a/packages/vue/src/canvas/statuses/use.ts b/packages/vue/src/canvas/statuses/use.tsnew file mode 100644index 000000000..070ef59a5--- /dev/null+++ b/packages/vue/src/canvas/statuses/use.ts@@ -0,0 +1,57 @@+import { useEventListener } from '@vueuse/core'+import { computed, onScopeDispose, shallowRef, type Ref } from 'vue'++import type { PlacedStatusLabel } from '@open-pencil/core/canvas'+import type { Editor } from '@open-pencil/core/editor'++export interface CanvasStatusLabelOptions {+ /** Status label under a point in canvas-element CSS pixels; `useCanvas()` returns one. */+ hitTest: (screenX: number, screenY: number) => PlacedStatusLabel | null+ /** Called on a primary click on a label, after its layer is selected. */+ onActivate?: (label: PlacedStatusLabel) => void+}++/**+ * Makes the status pills and dots on canvas titles clickable: a click selects the layer and opens+ * its status, the way Figma's Ready for dev pill opens its menu. Listeners run in the capture phase+ * so the click never starts a selection drag or a tool.+ */+export function useCanvasStatusLabels(+ canvasRef: Ref<HTMLCanvasElement | null>,+ editor: Editor,+ options: CanvasStatusLabelOptions+) {+ const hovered = shallowRef<PlacedStatusLabel | null>(null)++ function labelAt(event: MouseEvent) {+ const canvas = canvasRef.value+ if (!canvas) return null+ const rect = canvas.getBoundingClientRect()+ return options.hitTest(event.clientX - rect.left, event.clientY - rect.top)+ }++ function onMouseMove(event: MouseEvent) {+ hovered.value = event.buttons === 0 ? labelAt(event) : null+ if (!hovered.value) return+ editor.setHoveredNode(hovered.value.nodeId)+ event.stopImmediatePropagation()+ }++ function onMouseDown(event: MouseEvent) {+ if (event.button !== 0) return+ const label = labelAt(event)+ if (!label) return+ event.preventDefault()+ event.stopImmediatePropagation()+ editor.select([label.nodeId])+ options.onActivate?.(label)+ }++ useEventListener(canvasRef, 'mousemove', onMouseMove, { capture: true })+ useEventListener(canvasRef, 'mousedown', onMouseDown, { capture: true })+ useEventListener(canvasRef, 'mouseleave', () => (hovered.value = null))+ const stopViewport = editor.onEditorEvent('viewport:changed', () => (hovered.value = null))+ onScopeDispose(stopViewport)++ return { cursor: computed(() => (hovered.value ? 'pointer' : null)) }+}diff --git a/packages/vue/src/canvas/surface/overlays.ts b/packages/vue/src/canvas/surface/overlays.tsindex e7cd93121..361111c5f 100644--- a/packages/vue/src/canvas/surface/overlays.ts+++ b/packages/vue/src/canvas/surface/overlays.ts@@ -1,4 +1,8 @@-import { hitTestIssueMarkers, type SkiaRenderer } from '@open-pencil/core/canvas'+import {+ hitTestIssueMarkers,+ hitTestStatusLabels,+ type SkiaRenderer+} from '@open-pencil/core/canvas'import type { Editor } from '@open-pencil/core/editor'import { useViewportKind } from '#vue/editor/viewport-kind/use'@@ -56,5 +60,17 @@ export function createCanvasHitTests(editor: Editor, getRenderer: () => SkiaRendreturn renderer ? hitTestIssueMarkers(renderer.issueMarkers, screenX, screenY) : null}- return { hitTestSectionTitle, hitTestComponentLabel, hitTestFrameTitle, hitTestIssueMarker }+ /** Status pill or dot under a point in canvas-element CSS pixels, from the last drawn frame. */+ function hitTestStatusLabel(screenX: number, screenY: number) {+ const renderer = getRenderer()+ return renderer ? hitTestStatusLabels(renderer.statusLabels, screenX, screenY) : null+ }++ return {+ hitTestSectionTitle,+ hitTestComponentLabel,+ hitTestFrameTitle,+ hitTestIssueMarker,+ hitTestStatusLabel+ }}diff --git a/packages/vue/src/canvas/surface/use.ts b/packages/vue/src/canvas/surface/use.tsindex eaa36f37a..20fb441ff 100644--- a/packages/vue/src/canvas/surface/use.ts+++ b/packages/vue/src/canvas/surface/use.ts@@ -64,8 +64,13 @@ export function useCanvas(})}- const { hitTestSectionTitle, hitTestComponentLabel, hitTestFrameTitle, hitTestIssueMarker } =- createCanvasHitTests(editor, surface.getRenderer)+ const {+ hitTestSectionTitle,+ hitTestComponentLabel,+ hitTestFrameTitle,+ hitTestIssueMarker,+ hitTestStatusLabel+ } = createCanvasHitTests(editor, surface.getRenderer)return {render: surface.markDirty,@@ -73,6 +78,7 @@ export function useCanvas(hitTestSectionTitle,hitTestComponentLabel,hitTestFrameTitle,- hitTestIssueMarker+ hitTestIssueMarker,+ hitTestStatusLabel}}diff --git a/packages/vue/src/i18n/index.ts b/packages/vue/src/i18n/index.tsindex 1a627d197..b3e603820 100644--- a/packages/vue/src/i18n/index.ts+++ b/packages/vue/src/i18n/index.ts@@ -22,6 +22,7 @@ export {useRenderingMessages,useRenameMessages,useSettingsMessages,+ useStatusMessages,useStorageMessages,useToolMessages,useUpdateMessages,diff --git a/packages/vue/src/i18n/locales/de/index.ts b/packages/vue/src/i18n/locales/de/index.tsindex 0beaf3fd8..44dc76dfb 100644--- a/packages/vue/src/i18n/locales/de/index.ts+++ b/packages/vue/src/i18n/locales/de/index.ts@@ -21,6 +21,7 @@ import recovery from './recovery.json'import rename from './rename.json'import rendering from './rendering.json'import settings from './settings.json'+import statuses from './statuses.json'import storage from './storage.json'import tools from './tools.json'import updates from './updates.json'@@ -49,6 +50,7 @@ export default {rendering,rename,settings,+ statuses,storage,tools,updates,diff --git a/packages/vue/src/i18n/locales/de/statuses.json b/packages/vue/src/i18n/locales/de/statuses.jsonnew file mode 100644index 000000000..fb666c82d--- /dev/null+++ b/packages/vue/src/i18n/locales/de/statuses.json@@ -0,0 +1,36 @@+{+ "status": "Status",+ "statuses": "Status",+ "addStatus": "Status hinzufügen",+ "removeStatus": "Status entfernen",+ "editStatuses": "Status bearbeiten…",+ "mixed": "Gemischt",+ "setFor": "Für {count} von {total} Ebenen",+ "hiddenInside": "{state} ist ausgeblendet, solange die Ebene in {layer} liegt",+ "remove": "Entfernen",+ "presetHandoff": "Figma-Übergabe",+ "presetSimple": "Einfach",+ "presetReview": "Design-Review",+ "preset": "Vorlage",+ "custom": "Eigene",+ "name": "Name",+ "color": "Farbe",+ "newStatus": "Neuer Status",+ "deleteStatus": "Status löschen",+ "inUse": "{state} ist auf {layers}. Verschieben nach:",+ "noStatus": "Kein Status",+ "figmaShows": "In Figma als {status} angezeigt",+ "readyForDev": "Bereit für die Entwicklung",+ "completed": "Abgeschlossen",+ "moveTo": "Verschieben nach",+ "layerCount": {+ "one": "{count} Ebene",+ "many": "{count} Ebenen"+ },+ "impactHeading": "Beim Anwenden ändert sich, was diese Ebenen zeigen",+ "restore": "Wiederherstellen",+ "chooseWhere": "Wähle, wohin die Ebenen gelöschter Status gehen",+ "discardTitle": "Änderungen an den Status verwerfen?",+ "discardDescription": "Die Änderungen hier wurden noch nicht angewendet.",+ "discard": "Verwerfen"+}diff --git a/packages/vue/src/i18n/locales/es/index.ts b/packages/vue/src/i18n/locales/es/index.tsindex 0beaf3fd8..44dc76dfb 100644--- a/packages/vue/src/i18n/locales/es/index.ts+++ b/packages/vue/src/i18n/locales/es/index.ts@@ -21,6 +21,7 @@ import recovery from './recovery.json'import rename from './rename.json'import rendering from './rendering.json'import settings from './settings.json'+import statuses from './statuses.json'import storage from './storage.json'import tools from './tools.json'import updates from './updates.json'@@ -49,6 +50,7 @@ export default {rendering,rename,settings,+ statuses,storage,tools,updates,diff --git a/packages/vue/src/i18n/locales/es/statuses.json b/packages/vue/src/i18n/locales/es/statuses.jsonnew file mode 100644index 000000000..962fc2a27--- /dev/null+++ b/packages/vue/src/i18n/locales/es/statuses.json@@ -0,0 +1,36 @@+{+ "status": "Estado",+ "statuses": "Estados",+ "addStatus": "Añadir estado",+ "removeStatus": "Quitar estado",+ "editStatuses": "Editar estados…",+ "mixed": "Mixto",+ "setFor": "Para {count} de {total} capas",+ "hiddenInside": "{state} está oculto mientras la capa esté dentro de {layer}",+ "remove": "Quitar",+ "presetHandoff": "Entrega en Figma",+ "presetSimple": "Sencillo",+ "presetReview": "Revisión de diseño",+ "preset": "Plantilla",+ "custom": "Personalizado",+ "name": "Nombre",+ "color": "Color",+ "newStatus": "Nuevo estado",+ "deleteStatus": "Eliminar estado",+ "inUse": "{state} está en {layers}. Moverlas a:",+ "noStatus": "Sin estado",+ "figmaShows": "En Figma se muestra como {status}",+ "readyForDev": "Listo para desarrollo",+ "completed": "Completado",+ "moveTo": "Mover a",+ "layerCount": {+ "one": "{count} capa",+ "many": "{count} capas"+ },+ "impactHeading": "Al aplicar cambia lo que muestran estas capas",+ "restore": "Restaurar",+ "chooseWhere": "Elige adónde van las capas de cada estado eliminado",+ "discardTitle": "¿Descartar los cambios en los estados?",+ "discardDescription": "Los cambios hechos aquí no se han aplicado.",+ "discard": "Descartar"+}diff --git a/packages/vue/src/i18n/locales/fr/index.ts b/packages/vue/src/i18n/locales/fr/index.tsindex 0beaf3fd8..44dc76dfb 100644--- a/packages/vue/src/i18n/locales/fr/index.ts+++ b/packages/vue/src/i18n/locales/fr/index.ts@@ -21,6 +21,7 @@ import recovery from './recovery.json'import rename from './rename.json'import rendering from './rendering.json'import settings from './settings.json'+import statuses from './statuses.json'import storage from './storage.json'import tools from './tools.json'import updates from './updates.json'@@ -49,6 +50,7 @@ export default {rendering,rename,settings,+ statuses,storage,tools,updates,diff --git a/packages/vue/src/i18n/locales/fr/statuses.json b/packages/vue/src/i18n/locales/fr/statuses.jsonnew file mode 100644index 000000000..59ffbe727--- /dev/null+++ b/packages/vue/src/i18n/locales/fr/statuses.json@@ -0,0 +1,36 @@+{+ "status": "Statut",+ "statuses": "Statuts",+ "addStatus": "Ajouter un statut",+ "removeStatus": "Retirer le statut",+ "editStatuses": "Modifier les statuts…",+ "mixed": "Mixte",+ "setFor": "Pour {count} calques sur {total}",+ "hiddenInside": "{state} est masqué tant que le calque est dans {layer}",+ "remove": "Retirer",+ "presetHandoff": "Transmission Figma",+ "presetSimple": "Simple",+ "presetReview": "Revue de design",+ "preset": "Modèle",+ "custom": "Personnalisé",+ "name": "Nom",+ "color": "Couleur",+ "newStatus": "Nouveau statut",+ "deleteStatus": "Supprimer le statut",+ "inUse": "{state} est sur {layers}. Les déplacer vers :",+ "noStatus": "Aucun statut",+ "figmaShows": "Affiché dans Figma comme {status}",+ "readyForDev": "Prêt pour le développement",+ "completed": "Terminé côté dev",+ "moveTo": "Déplacer vers",+ "layerCount": {+ "one": "{count} calque",+ "many": "{count} calques"+ },+ "impactHeading": "Appliquer change ce qu’affichent ces calques",+ "restore": "Rétablir",+ "chooseWhere": "Choisissez où vont les calques de chaque statut supprimé",+ "discardTitle": "Abandonner les modifications des statuts ?",+ "discardDescription": "Les modifications faites ici n’ont pas été appliquées.",+ "discard": "Abandonner"+}diff --git a/packages/vue/src/i18n/locales/it/index.ts b/packages/vue/src/i18n/locales/it/index.tsindex 0beaf3fd8..44dc76dfb 100644--- a/packages/vue/src/i18n/locales/it/index.ts+++ b/packages/vue/src/i18n/locales/it/index.ts@@ -21,6 +21,7 @@ import recovery from './recovery.json'import rename from './rename.json'import rendering from './rendering.json'import settings from './settings.json'+import statuses from './statuses.json'import storage from './storage.json'import tools from './tools.json'import updates from './updates.json'@@ -49,6 +50,7 @@ export default {rendering,rename,settings,+ statuses,storage,tools,updates,diff --git a/packages/vue/src/i18n/locales/it/statuses.json b/packages/vue/src/i18n/locales/it/statuses.jsonnew file mode 100644index 000000000..758339ea5--- /dev/null+++ b/packages/vue/src/i18n/locales/it/statuses.json@@ -0,0 +1,36 @@+{+ "status": "Stato",+ "statuses": "Stati",+ "addStatus": "Aggiungi stato",+ "removeStatus": "Rimuovi stato",+ "editStatuses": "Modifica stati…",+ "mixed": "Misto",+ "setFor": "Per {count} livelli su {total}",+ "hiddenInside": "{state} è nascosto finché il livello è dentro {layer}",+ "remove": "Rimuovi",+ "presetHandoff": "Consegna in Figma",+ "presetSimple": "Semplice",+ "presetReview": "Revisione del design",+ "preset": "Modello",+ "custom": "Personalizzato",+ "name": "Nome",+ "color": "Colore",+ "newStatus": "Nuovo stato",+ "deleteStatus": "Elimina stato",+ "inUse": "{state} è su {layers}. Spostali in:",+ "noStatus": "Nessuno stato",+ "figmaShows": "In Figma appare come {status}",+ "readyForDev": "Pronto per lo sviluppo",+ "completed": "Completato",+ "moveTo": "Sposta in",+ "layerCount": {+ "one": "{count} livello",+ "many": "{count} livelli"+ },+ "impactHeading": "Applicando cambia ciò che mostrano questi livelli",+ "restore": "Ripristina",+ "chooseWhere": "Scegli dove vanno i livelli di ogni stato eliminato",+ "discardTitle": "Annullare le modifiche agli stati?",+ "discardDescription": "Le modifiche fatte qui non sono state applicate.",+ "discard": "Annulla modifiche"+}diff --git a/packages/vue/src/i18n/locales/ja/index.ts b/packages/vue/src/i18n/locales/ja/index.tsindex 0beaf3fd8..44dc76dfb 100644--- a/packages/vue/src/i18n/locales/ja/index.ts+++ b/packages/vue/src/i18n/locales/ja/index.ts@@ -21,6 +21,7 @@ import recovery from './recovery.json'import rename from './rename.json'import rendering from './rendering.json'import settings from './settings.json'+import statuses from './statuses.json'import storage from './storage.json'import tools from './tools.json'import updates from './updates.json'@@ -49,6 +50,7 @@ export default {rendering,rename,settings,+ statuses,storage,tools,updates,diff --git a/packages/vue/src/i18n/locales/ja/statuses.json b/packages/vue/src/i18n/locales/ja/statuses.jsonnew file mode 100644index 000000000..63b6c1c09--- /dev/null+++ b/packages/vue/src/i18n/locales/ja/statuses.json@@ -0,0 +1,35 @@+{+ "status": "ステータス",+ "statuses": "ステータス",+ "addStatus": "ステータスを追加",+ "removeStatus": "ステータスを削除",+ "editStatuses": "ステータスを編集…",+ "mixed": "混在",+ "setFor": "{total} 件中 {count} 件のレイヤーに設定",+ "hiddenInside": "レイヤーが {layer} の中にある間、{state} は非表示です",+ "remove": "削除",+ "presetHandoff": "Figma への引き渡し",+ "presetSimple": "シンプル",+ "presetReview": "デザインレビュー",+ "preset": "プリセット",+ "custom": "カスタム",+ "name": "名前",+ "color": "色",+ "newStatus": "新しいステータス",+ "deleteStatus": "ステータスを削除",+ "inUse": "{state} は {layers}に設定されています。移動先:",+ "noStatus": "ステータスなし",+ "figmaShows": "Figma では {status} と表示",+ "readyForDev": "開発準備完了",+ "completed": "開発完了",+ "moveTo": "移動先",+ "layerCount": {+ "many": "{count} レイヤー"+ },+ "impactHeading": "適用すると、これらのレイヤーの表示が変わります",+ "restore": "元に戻す",+ "chooseWhere": "削除するステータスのレイヤーの移動先を選んでください",+ "discardTitle": "ステータスの変更を破棄しますか?",+ "discardDescription": "ここでの変更はまだ適用されていません。",+ "discard": "破棄"+}diff --git a/packages/vue/src/i18n/locales/pl/index.ts b/packages/vue/src/i18n/locales/pl/index.tsindex 0beaf3fd8..44dc76dfb 100644--- a/packages/vue/src/i18n/locales/pl/index.ts+++ b/packages/vue/src/i18n/locales/pl/index.ts@@ -21,6 +21,7 @@ import recovery from './recovery.json'import rename from './rename.json'import rendering from './rendering.json'import settings from './settings.json'+import statuses from './statuses.json'import storage from './storage.json'import tools from './tools.json'import updates from './updates.json'@@ -49,6 +50,7 @@ export default {rendering,rename,settings,+ statuses,storage,tools,updates,diff --git a/packages/vue/src/i18n/locales/pl/statuses.json b/packages/vue/src/i18n/locales/pl/statuses.jsonnew file mode 100644index 000000000..5f9253bc3--- /dev/null+++ b/packages/vue/src/i18n/locales/pl/statuses.json@@ -0,0 +1,37 @@+{+ "status": "Status",+ "statuses": "Statusy",+ "addStatus": "Dodaj status",+ "removeStatus": "Usuń status",+ "editStatuses": "Edytuj statusy…",+ "mixed": "Różne",+ "setFor": "Dla {count} z {total} warstw",+ "hiddenInside": "{state} jest ukryty, dopóki warstwa jest w {layer}",+ "remove": "Usuń",+ "presetHandoff": "Przekazanie w Figmie",+ "presetSimple": "Prosty",+ "presetReview": "Przegląd projektu",+ "preset": "Szablon",+ "custom": "Własny",+ "name": "Nazwa",+ "color": "Kolor",+ "newStatus": "Nowy status",+ "deleteStatus": "Usuń status",+ "inUse": "{state} ma {layers}. Przenieś je do:",+ "noStatus": "Bez statusu",+ "figmaShows": "W Figmie widoczny jako {status}",+ "readyForDev": "Gotowe do wdrożenia",+ "completed": "Ukończone",+ "moveTo": "Przenieś do",+ "layerCount": {+ "one": "{count} warstwa",+ "few": "{count} warstwy",+ "many": "{count} warstw"+ },+ "impactHeading": "Po zastosowaniu te warstwy będą wyglądać inaczej",+ "restore": "Przywróć",+ "chooseWhere": "Wybierz, dokąd trafią warstwy z usuniętych statusów",+ "discardTitle": "Odrzucić zmiany statusów?",+ "discardDescription": "Zmiany wprowadzone tutaj nie zostały zastosowane.",+ "discard": "Odrzuć"+}diff --git a/packages/vue/src/i18n/locales/ru/index.ts b/packages/vue/src/i18n/locales/ru/index.tsindex 0beaf3fd8..44dc76dfb 100644--- a/packages/vue/src/i18n/locales/ru/index.ts+++ b/packages/vue/src/i18n/locales/ru/index.ts@@ -21,6 +21,7 @@ import recovery from './recovery.json'import rename from './rename.json'import rendering from './rendering.json'import settings from './settings.json'+import statuses from './statuses.json'import storage from './storage.json'import tools from './tools.json'import updates from './updates.json'@@ -49,6 +50,7 @@ export default {rendering,rename,settings,+ statuses,storage,tools,updates,diff --git a/packages/vue/src/i18n/locales/ru/statuses.json b/packages/vue/src/i18n/locales/ru/statuses.jsonnew file mode 100644index 000000000..650c82118--- /dev/null+++ b/packages/vue/src/i18n/locales/ru/statuses.json@@ -0,0 +1,37 @@+{+ "status": "Статус",+ "statuses": "Статусы",+ "addStatus": "Добавить статус",+ "removeStatus": "Убрать статус",+ "editStatuses": "Изменить статусы…",+ "mixed": "Разные",+ "setFor": "Для {count} из {total} слоёв",+ "hiddenInside": "«{state}» скрыт, пока слой находится внутри «{layer}»",+ "remove": "Убрать",+ "presetHandoff": "Передача в Figma",+ "presetSimple": "Простой",+ "presetReview": "Дизайн-ревью",+ "preset": "Шаблон",+ "custom": "Свой",+ "name": "Название",+ "color": "Цвет",+ "newStatus": "Новый статус",+ "deleteStatus": "Удалить статус",+ "inUse": "«{state}» у {layers}. Перенести их в:",+ "noStatus": "Без статуса",+ "figmaShows": "В Figma показывается как «{status}»",+ "readyForDev": "Готово к разработке",+ "completed": "Завершено",+ "moveTo": "Перенести в",+ "layerCount": {+ "one": "{count} слой",+ "few": "{count} слоя",+ "many": "{count} слоёв"+ },+ "impactHeading": "После применения эти слои будут выглядеть иначе",+ "restore": "Вернуть",+ "chooseWhere": "Выберите, куда перенести слои из удалённых статусов",+ "discardTitle": "Отменить изменения статусов?",+ "discardDescription": "Изменения ещё не применены.",+ "discard": "Отменить"+}diff --git a/packages/vue/src/i18n/locales/zh-cn/index.ts b/packages/vue/src/i18n/locales/zh-cn/index.tsindex 0beaf3fd8..44dc76dfb 100644--- a/packages/vue/src/i18n/locales/zh-cn/index.ts+++ b/packages/vue/src/i18n/locales/zh-cn/index.ts@@ -21,6 +21,7 @@ import recovery from './recovery.json'import rename from './rename.json'import rendering from './rendering.json'import settings from './settings.json'+import statuses from './statuses.json'import storage from './storage.json'import tools from './tools.json'import updates from './updates.json'@@ -49,6 +50,7 @@ export default {rendering,rename,settings,+ statuses,storage,tools,updates,diff --git a/packages/vue/src/i18n/locales/zh-cn/statuses.json b/packages/vue/src/i18n/locales/zh-cn/statuses.jsonnew file mode 100644index 000000000..d5d5bc4b0--- /dev/null+++ b/packages/vue/src/i18n/locales/zh-cn/statuses.json@@ -0,0 +1,35 @@+{+ "status": "状态",+ "statuses": "状态",+ "addStatus": "添加状态",+ "removeStatus": "移除状态",+ "editStatuses": "编辑状态…",+ "mixed": "混合",+ "setFor": "已为 {total} 个图层中的 {count} 个设置",+ "hiddenInside": "图层位于「{layer}」内时,「{state}」处于隐藏状态",+ "remove": "移除",+ "presetHandoff": "Figma 交付",+ "presetSimple": "简单",+ "presetReview": "设计审查",+ "preset": "预设",+ "custom": "自定义",+ "name": "名称",+ "color": "颜色",+ "newStatus": "新状态",+ "deleteStatus": "删除状态",+ "inUse": "「{state}」用于 {layers}。将它们移至:",+ "noStatus": "无状态",+ "figmaShows": "在 Figma 中显示为「{status}」",+ "readyForDev": "可供开发",+ "completed": "开发完成",+ "moveTo": "移至",+ "layerCount": {+ "many": "{count} 个图层"+ },+ "impactHeading": "应用后,这些图层的显示会改变",+ "restore": "恢复",+ "chooseWhere": "请选择已删除状态中的图层移至何处",+ "discardTitle": "放弃对状态的更改?",+ "discardDescription": "此处的更改尚未应用。",+ "discard": "放弃"+}diff --git a/packages/vue/src/i18n/messages.ts b/packages/vue/src/i18n/messages.tsindex 4aa628a2a..cff30a753 100644--- a/packages/vue/src/i18n/messages.ts+++ b/packages/vue/src/i18n/messages.ts@@ -22,6 +22,7 @@ import { recoveryMessageDefaults, recoveryMessages } from '#vue/i18n/messages/reimport { renameMessageDefaults, renameMessages } from '#vue/i18n/messages/rename'import { renderingMessageDefaults, renderingMessages } from '#vue/i18n/messages/rendering'import { settingsMessageDefaults, settingsMessages } from '#vue/i18n/messages/settings'+import { statusMessageDefaults, statusMessages } from '#vue/i18n/messages/statuses'import { storageMessageDefaults, storageMessages } from '#vue/i18n/messages/storage'import { toolMessageDefaults, toolMessages } from '#vue/i18n/messages/tools'import { updatesMessageDefaults, updatesMessages } from '#vue/i18n/messages/updates'@@ -53,6 +54,7 @@ export {renderingMessages,renameMessages,settingsMessages,+ statusMessages,storageMessages,toolMessages,updatesMessages,@@ -82,6 +84,7 @@ export const messageDefaults = {rendering: renderingMessageDefaults,rename: renameMessageDefaults,settings: settingsMessageDefaults,+ statuses: statusMessageDefaults,storage: storageMessageDefaults,tools: toolMessageDefaults,updates: updatesMessageDefaults,diff --git a/packages/vue/src/i18n/messages/statuses.ts b/packages/vue/src/i18n/messages/statuses.tsnew file mode 100644index 000000000..c9c6af98a--- /dev/null+++ b/packages/vue/src/i18n/messages/statuses.ts@@ -0,0 +1,39 @@+import { count, params } from '@nanostores/i18n'++import { i18n } from '#vue/i18n/create'++export const statusMessageDefaults = {+ status: 'Status',+ statuses: 'Statuses',+ addStatus: 'Add status',+ removeStatus: 'Remove status',+ editStatuses: 'Edit statuses…',+ mixed: 'Mixed',+ setFor: params('Set for {count} of {total} layers'),+ moveTo: 'Move to',+ hiddenInside: params('{state} is hidden while this layer is inside {layer}'),+ remove: 'Remove',+ presetHandoff: 'Figma handoff',+ presetSimple: 'Simple',+ presetReview: 'Design review',+ preset: 'Preset',+ custom: 'Custom',+ name: 'Name',+ color: 'Color',+ newStatus: 'New status',+ deleteStatus: 'Delete status',+ inUse: params('{state} is on {layers}. Move them to:'),+ noStatus: 'No status',+ figmaShows: params('Shows in Figma as {status}'),+ readyForDev: 'Ready for dev',+ completed: 'Completed',+ layerCount: count({ one: '{count} layer', many: '{count} layers' }),+ impactHeading: 'Applying changes what these layers show',+ restore: 'Restore',+ chooseWhere: 'Choose where the layers in each deleted status go',+ discardTitle: 'Discard changes to statuses?',+ discardDescription: 'The changes you made here have not been applied.',+ discard: 'Discard'+} as const++export const statusMessages = i18n('statuses', statusMessageDefaults)diff --git a/packages/vue/src/i18n/useI18n.ts b/packages/vue/src/i18n/useI18n.tsindex f64063735..5f3df1e91 100644--- a/packages/vue/src/i18n/useI18n.ts+++ b/packages/vue/src/i18n/useI18n.ts@@ -26,6 +26,7 @@ import {renderingMessages,renameMessages,settingsMessages,+ statusMessages,storageMessages,toolMessages,updatesMessages,@@ -58,6 +59,7 @@ export const useRecoveryMessages = () => useI18nNamespace(recoveryMessages)export const useRenderingMessages = () => useI18nNamespace(renderingMessages)export const useRenameMessages = () => useI18nNamespace(renameMessages)export const useSettingsMessages = () => useI18nNamespace(settingsMessages)+export const useStatusMessages = () => useI18nNamespace(statusMessages)export const useStorageMessages = () => useI18nNamespace(storageMessages)export const useToolMessages = () => useI18nNamespace(toolMessages)export const useUpdateMessages = () => useI18nNamespace(updatesMessages)diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.tsindex 6ad390ab4..7abf2b964 100644--- a/packages/vue/src/index.ts+++ b/packages/vue/src/index.ts@@ -28,6 +28,7 @@ export {type AutoLayoutValueField} from '#vue/shared/input/auto-layout-hover'export { useCanvasIssueMarkers } from '#vue/canvas/issues/use'+export { useCanvasStatusLabels } from '#vue/canvas/statuses/use'export type { CanvasIssueMarkerOptions } from '#vue/canvas/issues/use'export type { CanvasLabelEdit, CanvasLabelKind } from '#vue/canvas/labels/edit'export { useCanvasVirtualReference } from '#vue/canvas/overlays/useCanvasVirtualReference'diff --git a/skills/open-pencil/SKILL.md b/skills/open-pencil/SKILL.mdindex 123f2bf74..bd0c55bfe 100644--- a/skills/open-pencil/SKILL.md+++ b/skills/open-pencil/SKILL.md@@ -201,6 +201,15 @@ openpencil eval design.fig -w -c 'openpencil.getComment("c_…").reply("Title is`openpencil.addComment(text, { node, page, x, y, author })` leaves a new one. Over MCP the same is `get_comments`, `add_comment`, `reply_to_comment`, and `resolve_comment`. Comment text is Markdown.+Statuses say where a section, frame, component, or instance stands, from the document's own list. Read the list, find what is ready, and move a layer on once your work on it is done:++```bash+openpencil eval design.fig -c 'openpencil.statuses.map(s => s.name)'+openpencil eval design.fig -w -c 'openpencil.setStatus(figma.currentPage.findOne(n => n.name === "Checkout"), "In review")'+```++`openpencil.getStatus(node)` reads one. Over MCP the same is `get_statuses` and `set_status`.+### DiffCompare nodes and documents, and apply patches:diff --git a/src/app/editor/session/types.ts b/src/app/editor/session/types.tsindex c2a736759..b668cc6a3 100644--- a/src/app/editor/session/types.ts+++ b/src/app/editor/session/types.ts@@ -26,6 +26,7 @@ export function createInitialAppEditorState(pageId: string): AppEditorState {nodeEditState: null,renameSelectionOpen: false,variablesOpen: false,+ statusesOpen: false,iconPickerOpen: false,renameNodeId: null,numberFieldFocused: false,@@ -50,6 +51,8 @@ export type AppEditorState = EditorState & {renameSelectionOpen: boolean/** The variables dialog, opened from the Design panel, the View menu, or the palette. */variablesOpen: boolean+ /** The statuses dialog, opened from the Status section, the canvas menu, or the page panel. */+ statusesOpen: boolean/** The icon picker, opened from the toolbar, the Object menu, or the palette. */iconPickerOpen: booleanrenameNodeId: string | nulldiff --git a/src/app/editor/statuses/dialog.ts b/src/app/editor/statuses/dialog.tsnew file mode 100644index 000000000..d0c118e20--- /dev/null+++ b/src/app/editor/statuses/dialog.ts@@ -0,0 +1,5 @@+import type { EditorStore } from '@/app/editor/active-store'++export function openStatusesDialog(store: EditorStore): void {+ store.state.statusesOpen = true+}diff --git a/src/app/editor/statuses/selection.ts b/src/app/editor/statuses/selection.tsnew file mode 100644index 000000000..98c2c4a2a--- /dev/null+++ b/src/app/editor/statuses/selection.ts@@ -0,0 +1,78 @@+import { computed } from 'vue'++import {+ STATUS_NODE_TYPES,+ statusPlacement,+ type SceneNode,+ type StatusState+} from '@open-pencil/scene-graph'+import { useSceneComputed } from '@open-pencil/vue'++import { useEditorStore } from '@/app/editor/active-store'++/** A status stored on the layer that its place hides, and the layer that hides it. */+export interface HiddenStatus {+ state: StatusState | undefined+ inside: SceneNode | undefined+}++/**+ * The status of the selected layers that can carry one, sections, frames, components, sets and+ * instances, and the commands the Status section and the canvas status menu share.+ */+export function useSelectedStatuses() {+ const store = useEditorStore()++ const targets = useSceneComputed(() =>+ [...store.state.selectedIds].flatMap((id) => {+ const node = store.graph.getNode(id)+ return node && STATUS_NODE_TYPES.has(node.type) ? [node] : []+ })+ )+ const workflow = useSceneComputed(() => store.statusWorkflow())+ const shown = useSceneComputed(() =>+ targets.value.flatMap((node) => {+ const state = store.getShownStatus(node.id)+ return state ? [state] : []+ })+ )+ const eligible = useSceneComputed(() =>+ targets.value.filter((node) => statusPlacement(store.graph, node) === 'ok')+ )++ /** The state every target shows, '' when they differ or have none. */+ const stateId = computed(() => {+ const ids = new Set(shown.value.map((state) => state.id))+ return shown.value.length === targets.value.length && ids.size === 1 ? [...ids][0] : ''+ })+ const state = computed(() => (stateId.value ? shown.value[0] : undefined))+ const mixed = computed(() => shown.value.length > 0 && stateId.value === '')++ const hidden = useSceneComputed<HiddenStatus | null>(() => {+ const node = targets.value.at(0)+ if (targets.value.length !== 1 || !node?.status || shown.value.length > 0) return null+ // Either a section around it shows its own status, or it sits inside a frame or a group.+ const parentId = node.parentId ?? ''+ const inside =+ statusPlacement(store.graph, node) === 'ancestor'+ ? store.graph.closest(parentId, (ancestor) => store.getShownStatus(ancestor.id) !== null)+ : store.graph.getNode(parentId)+ return { state: workflow.value.states.find((entry) => entry.id === node.status), inside }+ })++ function setState(id: string) {+ store.setStatus(+ eligible.value.map((node) => node.id),+ id+ )+ }++ function remove() {+ store.setStatus(+ targets.value.map((node) => node.id),+ null+ )+ }++ return { targets, eligible, workflow, state, stateId, mixed, hidden, setState, remove }+}diff --git a/src/app/editor/statuses/workflow.ts b/src/app/editor/statuses/workflow.tsnew file mode 100644index 000000000..15959fd47--- /dev/null+++ b/src/app/editor/statuses/workflow.ts@@ -0,0 +1,187 @@+import { isEqual } from 'es-toolkit'+import { computed, shallowRef, watch } from 'vue'++import {+ STATUS_WORKFLOW_PRESETS,+ statusWorkflowImpact,+ type StatusState,+ type StatusWorkflow,+ type StatusWorkflowPreset+} from '@open-pencil/scene-graph'+import { parseColor } from '@open-pencil/scene-graph/color'+import type { Color } from '@open-pencil/scene-graph/primitives'+import { randomHex } from '@open-pencil/scene-graph/random'+import { useSceneComputed } from '@open-pencil/vue'++import { useEditorStore } from '@/app/editor/active-store'++/** Colors a new status takes in turn, the presets' own and a few more. */+export const STATUS_COLORS: readonly Color[] = [+ '#b3b3b3',+ '#0d99ff',+ '#9747ff',+ '#14ae5c',+ '#ffcd29',+ '#ff8c1a',+ '#f24822',+ '#ff24bd'+].map(parseColor)++const PRESETS = Object.keys(STATUS_WORKFLOW_PRESETS) as StatusWorkflowPreset[]++/** The preset `states` are exactly, if any. */+function presetOf(states: readonly StatusState[]): StatusWorkflowPreset | undefined {+ return PRESETS.find((preset) => isEqual(STATUS_WORKFLOW_PRESETS[preset].states, states))+}++/**+ * The Statuses dialog's draft of the document's statuses. Edits stay in the draft, which shows+ * what applying it would do to the layers that have statuses; Apply commits the whole draft as+ * one undo step, and a state layers use is deleted only once they have somewhere to go.+ */+export function useStatusWorkflowDraft() {+ const store = useEditorStore()+ const current = useSceneComputed(() => store.statusWorkflow())+ /** The statuses the draft started from; edits are what differs from them. */+ const base = shallowRef<StatusState[]>(current.value.states)+ // Shallow: every edit replaces the list, so its states stay plain objects structuredClone copies.+ const draft = shallowRef<StatusState[]>(structuredClone(current.value.states))+ /** Deleted states layers use, with where those layers go: a state, none, or not chosen yet. */+ const removals = shallowRef<Record<string, string | null | undefined>>({})++ /** How many layers have each state, hidden ones included, across every page. */+ const usage = useSceneComputed(() => {+ const counts = new Map<string, number>()+ for (const node of store.graph.getAllNodes()) {+ if (node.status) counts.set(node.status, (counts.get(node.status) ?? 0) + 1)+ }+ return counts+ })++ const dirty = computed(+ () => !isEqual(draft.value, base.value) || Object.keys(removals.value).length > 0+ )+ const removed = computed(() =>+ current.value.states.filter((state) => Object.hasOwn(removals.value, state.id))+ )+ const unresolved = computed(() =>+ removed.value.filter((state) => removals.value[state.id] === undefined)+ )+ const moves = computed(() => {+ const result: Record<string, string | null> = {}+ for (const [id, target] of Object.entries(removals.value)) {+ if (target !== undefined) result[id] = target+ }+ return result+ })+ const next = computed<StatusWorkflow>(() => {+ const preset = presetOf(draft.value)+ return preset ? { preset, states: draft.value } : { states: draft.value }+ })+ const impact = useSceneComputed(() =>+ dirty.value ? statusWorkflowImpact(store.graph, current.value, next.value, moves.value) : []+ )++ function reset() {+ base.value = current.value.states+ draft.value = structuredClone(current.value.states)+ removals.value = {}+ }++ // Undo, redo, or another person's edit replace the statuses; a draft nobody touched follows.+ watch(current, () => {+ if (!dirty.value) reset()+ })++ function update(id: string, changes: Partial<Omit<StatusState, 'id'>>) {+ draft.value = draft.value.map((state) => (state.id === id ? { ...state, ...changes } : state))+ }++ function rename(id: string, name: string) {+ const trimmed = name.trim()+ if (trimmed) update(id, { name: trimmed })+ }++ function setColor(id: string, color: Color) {+ update(id, { color })+ }++ function add(name: string) {+ const color = STATUS_COLORS[draft.value.length % STATUS_COLORS.length] ?? STATUS_COLORS[0]+ draft.value = [...draft.value, { id: `s_${randomHex(8)}`, name, color }]+ }++ function remove(id: string) {+ if (draft.value.length < 2) return+ draft.value = draft.value.filter((state) => state.id !== id)+ if (usage.value.has(id)) removals.value = { ...removals.value, [id]: undefined }+ }++ /** Sends the layers in a deleted state to `target`, or clears theirs with null. */+ function chooseReplacement(id: string, target: string | null) {+ removals.value = { ...removals.value, [id]: target }+ }++ /** Brings a deleted state back where it was. */+ function restore(id: string) {+ const state = current.value.states.find((entry) => entry.id === id)+ if (!state) return+ const states = [...draft.value]+ states.splice(Math.min(current.value.states.indexOf(state), states.length), 0, state)+ draft.value = states+ removals.value = Object.fromEntries(+ Object.entries(removals.value).filter(([removedId]) => removedId !== id)+ )+ }++ function reorder(id: string, index: number) {+ const moved = draft.value.find((state) => state.id === id)+ if (!moved) return+ const states = draft.value.filter((state) => state.id !== id)+ states.splice(index, 0, moved)+ draft.value = states+ }++ /** Starts the draft from a preset; states layers use that it lacks wait for a destination. */+ function applyPreset(preset: StatusWorkflowPreset) {+ const states = structuredClone(STATUS_WORKFLOW_PRESETS[preset].states)+ const kept = new Set(states.map((state) => state.id))+ const pending: Record<string, string | null | undefined> = {}+ for (const id of usage.value.keys()) {+ if (!kept.has(id)) pending[id] = removals.value[id]+ }+ draft.value = states+ removals.value = pending+ }++ /** Commits the draft as one undo step. False while a deleted state's layers have nowhere to go. */+ function apply(): boolean {+ if (unresolved.value.length > 0) return false+ const states = structuredClone(draft.value)+ const preset = presetOf(states)+ store.setStatusWorkflow(preset ? { preset, states } : { states }, { ...moves.value })+ reset()+ return true+ }++ return {+ draft,+ preset: computed(() => presetOf(draft.value)),+ usage,+ dirty,+ removed,+ removals,+ unresolved,+ impact,+ rename,+ setColor,+ add,+ remove,+ chooseReplacement,+ restore,+ reorder,+ applyPreset,+ apply,+ reset+ }+}diff --git a/src/components/DesignPanel.vue b/src/components/DesignPanel.vueindex eb983123f..7557ef5db 100644--- a/src/components/DesignPanel.vue+++ b/src/components/DesignPanel.vue@@ -40,6 +40,8 @@ import PositionSection from './properties/PositionSection.vue'import SelectionColorsSection from './properties/selection/SelectionColorsSection.vue'import SelectionLayoutSection from './properties/selection/SelectionLayoutSection.vue'import SelectionActionsControl from './properties/SelectionActionsControl.vue'+import StatusesSection from './properties/status/StatusesSection.vue'+import StatusSection from './properties/status/StatusSection.vue'import StickySection from './properties/sticky/StickySection.vue'import StrokeSection from './properties/stroke/StrokeSection.vue'import TypographySection from './properties/TypographySection.vue'@@ -112,6 +114,7 @@ const { panels } = useI18n()<SelectionActionsControl :show-boolean-operations="showBooleanOperations" /></template></PanelHeader>+ <StatusSection /><ComponentPropertiesSection /><PositionSection /><ConstraintsSection />@@ -189,6 +192,7 @@ const { panels } = useI18n()</template></PanelHeader>+ <StatusSection /><ComponentPropertiesSection v-if="node.type === 'INSTANCE'" /><VariantAuthoringSectionv-if="@@ -232,6 +236,7 @@ const { panels } = useI18n()><PageSection /><VariablesSection @open-dialog="openVariablesDialog(store)" />+ <StatusesSection /><ExportSection /></div></template>diff --git a/src/components/EditorCanvas.vue b/src/components/EditorCanvas.vueindex 455280755..358f215ba 100644--- a/src/components/EditorCanvas.vue+++ b/src/components/EditorCanvas.vue@@ -15,6 +15,7 @@ import IconLucidePanelLeft from '~icons/lucide/panel-left'import IconLucidePanelRight from '~icons/lucide/panel-right'import IconLucidePanelTop from '~icons/lucide/panel-top'+import type { PlacedStatusLabel } from '@open-pencil/core/canvas'import {AUTO_LAYOUT_PADDING_EDITOR_OFFSET_X,AUTO_LAYOUT_PADDING_EDITOR_OFFSET_Y,@@ -32,6 +33,7 @@ import {useCanvasDrop,useCanvasInput,useCanvasIssueMarkers,+ useCanvasStatusLabels,useCanvasVirtualReference,useTextEdit,type AutoLayoutValueField@@ -48,6 +50,7 @@ import CommentsLayer from '@/components/comments/CommentsLayer.vue'import IssueMarkerTooltip from '@/components/design-check/IssueMarkerTooltip.vue'import PreparationOverlay from '@/components/preparation/canvas/Overlay.vue'import FollowFrame from '@/components/presence/FollowFrame.vue'+import StatusLabelMenu from '@/components/statuses/StatusLabelMenu.vue'import AppDropOverlay from '@/components/ui/feedback/AppDropOverlay.vue'import { motionStyles } from '@/theme/motion/styles'import { floatingSurface } from '@/theme/overlay'@@ -112,17 +115,22 @@ useCanvas(sceneCanvasRef, store, {store.state.canvasPresentation = colorSpace}})-const { hitTestSectionTitle, hitTestComponentLabel, hitTestFrameTitle, hitTestIssueMarker } =- useCanvas(canvasRef, store, {- layer: 'overlays',- get showRulers() {- return appRuntimeConfig.showRulers && store.state.showRulers && paneView.value.play === null- },- getOverlayObstacles: () => canvasOverlayObstacles(canvasRef.value),- shouldSuspendRender,- getRenderState,- onViewportResize- })+const {+ hitTestSectionTitle,+ hitTestComponentLabel,+ hitTestFrameTitle,+ hitTestIssueMarker,+ hitTestStatusLabel+} = useCanvas(canvasRef, store, {+ layer: 'overlays',+ get showRulers() {+ return appRuntimeConfig.showRulers && store.state.showRulers && paneView.value.play === null+ },+ getOverlayObstacles: () => canvasOverlayObstacles(canvasRef.value),+ shouldSuspendRender,+ getRenderState,+ onViewportResize+})const {cursorOverride,canvasLabelEdit,@@ -151,6 +159,14 @@ watch(isActivePane, (active) => {onUnmounted(cleanupInteractions)const { activeTab: propertiesTab } = useAIChat()+const openStatusLabel = shallowRef<PlacedStatusLabel | null>(null)+const { cursor: statusLabelCursor } = useCanvasStatusLabels(canvasRef, store, {+ hitTest: hitTestStatusLabel,+ onActivate: (label) => {+ activatePane()+ openStatusLabel.value = label+ }+})const { detailMarker: hoveredIssueMarker, cursor: issueMarkerCursor } = useCanvasIssueMarkers(canvasRef,store,@@ -227,7 +243,10 @@ const valueEditorIcon = computed(() => {})const cursor = computed(() =>- toolCursor(store.state.activeTool, issueMarkerCursor.value ?? cursorOverride.value)+ toolCursor(+ store.state.activeTool,+ issueMarkerCursor.value ?? statusLabelCursor.value ?? cursorOverride.value+ ))</script>@@ -263,6 +282,11 @@ const cursor = computed(() =><PlayIslands :view="paneView" :drawn="drawnView" :canvas="canvasRef" /><AppDropOverlay :visible="isDraggingOver" /><IssueMarkerTooltip :marker="hoveredIssueMarker" :canvas="canvasRef" />+ <StatusLabelMenu+ :label="openStatusLabel"+ :canvas="canvasRef"+ @close="openStatusLabel = null"+ /><CanvasLabelEditor:edit="canvasLabelEdit":presentation="canvasLabelEditPresentation"diff --git a/src/components/editor/EditorWorkspace.vue b/src/components/editor/EditorWorkspace.vueindex ae37ca064..08a3c3473 100644--- a/src/components/editor/EditorWorkspace.vue+++ b/src/components/editor/EditorWorkspace.vue@@ -20,6 +20,7 @@ import LayersPanel from '@/components/LayersPanel.vue'import MobileDrawer from '@/components/MobileDrawer.vue'import MobileHud from '@/components/MobileHud/MobileHud.vue'import PropertiesPanel from '@/components/PropertiesPanel.vue'+import StatusesDialog from '@/components/statuses/StatusesDialog.vue'import Toolbar from '@/components/toolbar/Toolbar.vue'import IconButton from '@/components/ui/button/IconButton.vue'import VariablesDialog from '@/components/variables/VariablesDialog.vue'@@ -152,5 +153,6 @@ const { pending: roomPending } = useRoomActions()</div><VariablesDialog />+ <StatusesDialog /><CommentDeleteDialog /></template>diff --git a/src/components/properties/status/StatusSection.vue b/src/components/properties/status/StatusSection.vuenew file mode 100644index 000000000..a6855d1d9--- /dev/null+++ b/src/components/properties/status/StatusSection.vue@@ -0,0 +1,117 @@+<script setup lang="ts">+import { computed } from 'vue'++import { useStatusMessages } from '@open-pencil/vue'++import { useEditorStore } from '@/app/editor/active-store'+import { openStatusesDialog } from '@/app/editor/statuses/dialog'+import { useSelectedStatuses } from '@/app/editor/statuses/selection'+import StatusDot from '@/components/statuses/StatusDot.vue'+import IconButton from '@/components/ui/button/IconButton.vue'+import PanelSection from '@/components/ui/panel/PanelSection.vue'+import AppSelect from '@/components/ui/select/AppSelect.vue'++/** The status of the selected sections, frames, components, sets and instances. */+const store = useEditorStore()+const messages = useStatusMessages()+const { targets, eligible, workflow, state, stateId, mixed, hidden, setState, remove } =+ useSelectedStatuses()++const options = computed(() =>+ workflow.value.states.map((entry) => ({ value: entry.id, label: entry.name }))+)+const colorOf = (id: string) => workflow.value.states.find((entry) => entry.id === id)?.color+const hasStatus = computed(() => stateId.value !== '' || mixed.value)+const setFor = computed(() =>+ eligible.value.length < targets.value.length+ ? messages.value.setFor({+ count: String(eligible.value.length),+ total: String(targets.value.length)+ })+ : ''+)+</script>++<template>+ <PanelSection+ v-if="eligible.length > 0 || hasStatus || hidden"+ :label="messages.status"+ :empty="!hasStatus && !hidden"+ data-test-id="status-section"+ >+ <template #actions>+ <IconButton+ :label="messages.editStatuses"+ data-test-id="status-edit"+ @click="openStatusesDialog(store)"+ >+ <icon-lucide-settings-2 class="size-3.5" />+ </IconButton>+ <IconButton+ v-if="hasStatus"+ :label="messages.removeStatus"+ data-test-id="status-remove"+ @click="remove"+ >+ <icon-lucide-minus class="size-3.5" />+ </IconButton>+ <AppSelect+ v-else-if="eligible.length > 0"+ :model-value="stateId"+ :options="options"+ :label="messages.addStatus"+ @update:model-value="setState(String($event))"+ >+ <template #trigger>+ <IconButton :label="messages.addStatus" data-test-id="status-add">+ <icon-lucide-plus class="size-3.5" />+ </IconButton>+ </template>+ <template #option="{ option }">+ <span class="flex items-center gap-2">+ <StatusDot :color="colorOf(String(option.value))" />+ {{ option.label }}+ </span>+ </template>+ </AppSelect>+ </template>++ <template v-if="hasStatus">+ <div class="flex items-center gap-2">+ <StatusDot :color="state?.color" />+ <AppSelect+ :model-value="stateId"+ :options="options"+ :label="messages.status"+ :placeholder="messages.mixed"+ :ui="{ trigger: 'w-auto flex-1' }"+ data-test-id="status-select"+ @update:model-value="setState(String($event))"+ >+ <template #option="{ option }">+ <span class="flex items-center gap-2">+ <StatusDot :color="colorOf(String(option.value))" />+ {{ option.label }}+ </span>+ </template>+ </AppSelect>+ </div>+ <p v-if="setFor" class="mt-1 text-[11px] text-muted">{{ setFor }}</p>+ </template>++ <p v-else-if="hidden" class="mt-1 text-[11px] text-muted" data-test-id="status-hidden">+ {{+ messages.hiddenInside({+ state: hidden.state?.name ?? '',+ layer: hidden.inside?.name ?? ''+ })+ }}+ <button+ class="cursor-pointer border-none bg-transparent p-0 text-[11px] text-accent hover:underline"+ @click="remove"+ >+ {{ messages.remove }}+ </button>+ </p>+ </PanelSection>+</template>diff --git a/src/components/properties/status/StatusesSection.vue b/src/components/properties/status/StatusesSection.vuenew file mode 100644index 000000000..191192c30--- /dev/null+++ b/src/components/properties/status/StatusesSection.vue@@ -0,0 +1,30 @@+<script setup lang="ts">+import { useSceneComputed, useStatusMessages } from '@open-pencil/vue'++import { useEditorStore } from '@/app/editor/active-store'+import { openStatusesDialog } from '@/app/editor/statuses/dialog'+import StatusDot from '@/components/statuses/StatusDot.vue'+import IconButton from '@/components/ui/button/IconButton.vue'+import PanelSection from '@/components/ui/panel/PanelSection.vue'++/** The document's statuses at a glance, with nothing selected, and the way to edit them. */+const store = useEditorStore()+const messages = useStatusMessages()+const states = useSceneComputed(() => store.statusWorkflow().states)+</script>++<template>+ <PanelSection :label="messages.statuses" data-test-id="statuses-section">+ <template #actions>+ <IconButton :label="messages.editStatuses" @click="openStatusesDialog(store)">+ <icon-lucide-square-arrow-out-up-right class="size-3.5" />+ </IconButton>+ </template>+ <ul class="mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted">+ <li v-for="state in states" :key="state.id" class="flex items-center gap-1.5">+ <StatusDot :color="state.color" />+ {{ state.name }}+ </li>+ </ul>+ </PanelSection>+</template>diff --git a/src/components/statuses/StatusDot.vue b/src/components/statuses/StatusDot.vuenew file mode 100644index 000000000..cce9b12f7--- /dev/null+++ b/src/components/statuses/StatusDot.vue@@ -0,0 +1,20 @@+<script setup lang="ts">+import { computed } from 'vue'++import type { Color } from '@open-pencil/scene-graph'+import { colorToCSS } from '@open-pencil/scene-graph/color'++/** A status's color, as the canvas label, panels and menus mark it. */+const { color } = defineProps<{ color: Color | undefined }>()++const background = computed(() => (color ? colorToCSS(color) : undefined))+</script>++<template>+ <span+ aria-hidden="true"+ data-slot="status-dot"+ class="inline-block size-2 shrink-0 rounded-full bg-muted"+ :style="background ? { backgroundColor: background } : undefined"+ />+</template>diff --git a/src/components/statuses/StatusLabelMenu.vue b/src/components/statuses/StatusLabelMenu.vuenew file mode 100644index 000000000..2630aaa22--- /dev/null+++ b/src/components/statuses/StatusLabelMenu.vue@@ -0,0 +1,95 @@+<script setup lang="ts">+import { PopoverContent, PopoverPortal, PopoverRoot } from 'reka-ui'+import { computed } from 'vue'++import type { PlacedStatusLabel } from '@open-pencil/core/canvas'+import { useStatusMessages } from '@open-pencil/vue'++import { useEditorStore } from '@/app/editor/active-store'+import { openStatusesDialog } from '@/app/editor/statuses/dialog'+import { useSelectedStatuses } from '@/app/editor/statuses/selection'+import StatusDot from '@/components/statuses/StatusDot.vue'+import { menu } from '@/components/ui/menu/menu'++/**+ * The menu a status pill or dot on the canvas opens, beside it: the document's states and Remove.+ * Clicking the label selects its layer first, so the menu acts on the selection as the panel does.+ */+const { label, canvas } = defineProps<{+ label: PlacedStatusLabel | null+ canvas: HTMLElement | null+}>()+const emit = defineEmits<{ close: [] }>()++const store = useEditorStore()+const messages = useStatusMessages()+const { workflow, stateId, setState, remove } = useSelectedStatuses()+const styles = menu({ tone: 'default' })++const reference = computed(() => {+ const current = label+ const element = canvas+ if (!current || !element) return null+ return {+ getBoundingClientRect() {+ const bounds = element.getBoundingClientRect()+ const { rect } = current+ return new DOMRect(bounds.left + rect.x, bounds.top + rect.y, rect.width, rect.height)+ }+ }+})++function choose(id: string) {+ setState(id)+ emit('close')+}++function editStatuses() {+ openStatusesDialog(store)+ emit('close')+}++function clear() {+ remove()+ emit('close')+}+</script>++<template>+ <PopoverRoot :open="!!reference" @update:open="(open) => !open && emit('close')">+ <PopoverPortal>+ <PopoverContent+ v-if="reference"+ :reference="reference"+ side="bottom"+ align="start"+ :side-offset="4"+ :collision-padding="8"+ :class="[styles.content(), 'min-w-44']"+ data-test-id="status-label-menu"+ @open-auto-focus.prevent+ >+ <p :class="styles.label()">{{ messages.status }}</p>+ <button+ v-for="state in workflow.states"+ :key="state.id"+ type="button"+ :class="styles.item()"+ :data-current="stateId === state.id || undefined"+ @click="choose(state.id)"+ >+ <StatusDot :color="state.color" />+ <span class="flex-1 text-left">{{ state.name }}</span>+ <icon-lucide-check v-if="stateId === state.id" :class="styles.icon()" />+ </button>+ <div :class="styles.separator()" />+ <button type="button" :class="styles.item()" @click="clear">+ {{ messages.removeStatus }}+ </button>+ <button type="button" :class="styles.item()" @click="editStatuses">+ {{ messages.editStatuses }}+ </button>+ </PopoverContent>+ </PopoverPortal>+ </PopoverRoot>+</template>diff --git a/src/components/statuses/StatusStateRow.vue b/src/components/statuses/StatusStateRow.vuenew file mode 100644index 000000000..3d23ae5ac--- /dev/null+++ b/src/components/statuses/StatusStateRow.vue@@ -0,0 +1,90 @@+<script setup lang="ts">+import { computed, ref } from 'vue'++import { figmaDevStatusOf, type StatusState } from '@open-pencil/scene-graph'+import { colorToHex } from '@open-pencil/scene-graph/color'+import { useStatusMessages } from '@open-pencil/vue'++import { STATUS_COLORS } from '@/app/editor/statuses/workflow'+import StatusDot from '@/components/statuses/StatusDot.vue'+import IconButton from '@/components/ui/button/IconButton.vue'+import AppInput from '@/components/ui/input/AppInput.vue'+import AppSelect from '@/components/ui/select/AppSelect.vue'+import { statusRows } from '@/theme/statuses'++/** One status in the Statuses dialog: its color and name. */+const { state, states } = defineProps<{+ state: StatusState+ states: readonly StatusState[]+}>()+const emit = defineEmits<{+ rename: [name: string]+ color: [color: StatusState['color']]+ remove: []+}>()++const messages = useStatusMessages()+const ui = statusRows()+const draft = ref<string | null>(null)++const colorOptions = STATUS_COLORS.map((color) => ({+ value: colorToHex(color),+ label: colorToHex(color)+}))+const figma = computed(() => {+ const status = figmaDevStatusOf(state.id)+ if (!status) return ''+ const name = status === 'READY_FOR_DEV' ? messages.value.readyForDev : messages.value.completed+ return messages.value.figmaShows({ status: name })+})+function commitName() {+ if (draft.value !== null && draft.value.trim() && draft.value !== state.name) {+ emit('rename', draft.value)+ }+ draft.value = null+}+</script>++<template>+ <div :class="ui.row()" data-test-id="status-state-row" :data-state-id="state.id">+ <icon-lucide-grip-vertical :class="ui.handle()" aria-hidden="true" />+ <AppSelect+ :model-value="colorToHex(state.color)"+ :options="colorOptions"+ :label="messages.color"+ placement="below"+ @update:model-value="+ emit('color', STATUS_COLORS.find((color) => colorToHex(color) === $event) ?? state.color)+ "+ >+ <template #trigger>+ <IconButton :label="messages.color">+ <StatusDot :color="state.color" />+ </IconButton>+ </template>+ <template #option="{ option }">+ <span class="flex items-center gap-2">+ <StatusDot :color="STATUS_COLORS.find((color) => colorToHex(color) === option.value)" />+ {{ option.label }}+ </span>+ </template>+ </AppSelect>+ <AppInput+ :model-value="draft ?? state.name"+ size="sm"+ tone="panel"+ :aria-label="messages.name"+ @update:model-value="draft = String($event)"+ @change="commitName"+ @enter="commitName"+ />+ <IconButton+ :label="messages.deleteStatus"+ :disabled="states.length < 2"+ @click="emit('remove')"+ >+ <icon-lucide-minus class="size-3.5" />+ </IconButton>+ <p v-if="figma" :class="ui.hint()">{{ figma }}</p>+ </div>+</template>diff --git a/src/components/statuses/StatusesDialog.vue b/src/components/statuses/StatusesDialog.vuenew file mode 100644index 000000000..e9de5206b--- /dev/null+++ b/src/components/statuses/StatusesDialog.vue@@ -0,0 +1,260 @@+<script setup lang="ts">+import { computed, nextTick, ref, useTemplateRef, watch, type ComponentPublicInstance } from 'vue'++import type { StatusWorkflowPreset } from '@open-pencil/scene-graph'+import { useCommonMessages, useFlatReorderDrag, useStatusMessages } from '@open-pencil/vue'++import { useEditorStore } from '@/app/editor/active-store'+import { useStatusWorkflowDraft } from '@/app/editor/statuses/workflow'+import { useDocumentShortcuts } from '@/app/shell/keyboard/document'+import StatusDot from '@/components/statuses/StatusDot.vue'+import StatusStateRow from '@/components/statuses/StatusStateRow.vue'+import AppButton from '@/components/ui/button/AppButton.vue'+import IconButton from '@/components/ui/button/IconButton.vue'+import { AppConfirmationDialog } from '@/components/ui/dialog'+import AppDialog from '@/components/ui/dialog/AppDialog.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppInput from '@/components/ui/input/AppInput.vue'+import AppSelect from '@/components/ui/select/AppSelect.vue'+import { statusRows } from '@/theme/statuses'++/**+ * The document's statuses: their order, colors, names, categories, and what editing does to each.+ * Changes stay a draft that says what it would do to the layers with statuses until Apply, which+ * is one undo step; undo works from inside the dialog.+ */+const store = useEditorStore()+const messages = useStatusMessages()+const common = useCommonMessages()+const onKeydown = useDocumentShortcuts()+const editor = useStatusWorkflowDraft()+const rows = statusRows()+const { draft, preset, usage, dirty, removed, removals, unresolved, impact } = editor+const newName = ref('')+const confirmingDiscard = ref(false)++const open = computed({+ get: () => store.state.statusesOpen,+ set: (value: boolean) => {+ if (!value && dirty.value) {+ confirmingDiscard.value = true+ return+ }+ store.state.statusesOpen = value+ }+})++// A draft opens on the document's statuses as they are now, unless it holds edits not applied.+watch(open, (value) => {+ if (value && !dirty.value) editor.reset()+})++/** The preset menu's value while the statuses match no preset. */+const CUSTOM = 'custom'+/** A replacement menu's value for clearing the layers' status; state ids never take it. */+const NO_STATUS = 'none'++const PRESET_LABELS = {+ handoff: 'presetHandoff',+ simple: 'presetSimple',+ review: 'presetReview'+} as const satisfies Record<StatusWorkflowPreset, keyof typeof messages.value>+const PRESETS = Object.keys(PRESET_LABELS) as StatusWorkflowPreset[]++const presetOptions = computed(() => [+ { value: CUSTOM, label: messages.value.custom, disabled: true },+ ...PRESETS.map((value) => ({ value, label: messages.value[PRESET_LABELS[value]] }))+])+const replacementOptions = computed(() => [+ { value: NO_STATUS, label: messages.value.noStatus },+ ...draft.value.map((state) => ({ value: state.id, label: state.name }))+])++const drag = useFlatReorderDrag({+ items: () => draft.value,+ onMove: (id, index) => editor.reorder(id, index)+})++function setupRow(element: Element | ComponentPublicInstance | null, id: string) {+ drag.setupItem(element instanceof HTMLElement ? element : null, () => ({ id }))+}++const list = useTemplateRef<HTMLElement>('list')++/**+ * Deleting a row or applying, which disables Apply, drops the focus they held; the list takes it+ * back so undo and redo still reach the dialog.+ */+function keepFocus() {+ void nextTick(() => list.value?.focus())+}++function removeState(id: string) {+ editor.remove(id)+ keepFocus()+}++function apply() {+ if (editor.apply()) keepFocus()+}++function addState() {+ const name = newName.value.trim()+ if (!name) return+ editor.add(name)+ newName.value = ''+}++function replacementValue(id: string) {+ const target = removals.value[id]+ return target === null ? NO_STATUS : (target ?? '')+}++function choosePreset(value: string) {+ const match = PRESETS.find((candidate) => candidate === value)+ if (match) editor.applyPreset(match)+}++function discard() {+ editor.reset()+ store.state.statusesOpen = false+}+</script>++<template>+ <AppDialog+ v-model:open="open"+ :heading="messages.statuses"+ :close-label="common.close"+ size="md"+ :ui="{ footer: 'justify-end' }"+ data-test-id="statuses-dialog"+ @keydown="onKeydown"+ >+ <div ref="list" tabindex="-1" class="flex flex-col gap-2 outline-none">+ <div+ v-for="state in draft"+ :key="state.id"+ :ref="(element) => setupRow(element, state.id)"+ class="relative"+ :data-dragging="drag.draggingId.value === state.id || undefined"+ >+ <div+ v-if="drag.instructionTargetId.value === state.id"+ class="pointer-events-none absolute inset-x-1 z-10 h-0.5 rounded-full bg-accent"+ :class="drag.instruction.value?.operation === 'reorder-before' ? '-top-1' : '-bottom-1'"+ />+ <StatusStateRow+ :state="state"+ :states="draft"+ @rename="editor.rename(state.id, $event)"+ @color="editor.setColor(state.id, $event)"+ @remove="removeState(state.id)"+ />+ </div>+ <div :class="rows.row()">+ <span aria-hidden="true" />+ <span :class="rows.marker()"><icon-lucide-plus class="size-3.5" aria-hidden="true" /></span>+ <AppInput+ v-model="newName"+ size="sm"+ tone="panel"+ :class="rows.field()"+ :placeholder="messages.newStatus"+ :aria-label="messages.newStatus"+ data-test-id="status-new"+ @enter="addState"+ />+ </div>++ <div+ v-for="state in removed"+ :key="state.id"+ :class="[rows.row(), 'text-[11px] text-muted']"+ data-test-id="status-removed-row"+ :data-state-id="state.id"+ >+ <span aria-hidden="true" />+ <span :class="rows.marker()"><StatusDot :color="state.color" /></span>+ <span class="flex min-w-0 items-center gap-2">+ <span class="truncate">+ <span class="line-through">{{ state.name }}</span>+ {{+ messages.inUse({+ layers: messages.layerCount(usage.get(state.id) ?? 0),+ state: state.name+ })+ }}+ </span>+ <AppSelect+ :model-value="replacementValue(state.id)"+ :options="replacementOptions"+ :label="messages.moveTo"+ :placeholder="messages.moveTo"+ :ui="{ trigger: 'w-40 shrink-0' }"+ @update:model-value="+ editor.chooseReplacement(state.id, $event === NO_STATUS ? null : String($event))+ "+ />+ </span>+ <IconButton :label="messages.restore" @click="editor.restore(state.id)">+ <icon-lucide-undo-2 class="size-3.5" />+ </IconButton>+ </div>++ <AppAlert+ v-if="unresolved.length > 0"+ tone="warning"+ :heading="messages.chooseWhere"+ data-test-id="statuses-unresolved"+ />+ <AppAlert+ v-if="impact.length > 0"+ tone="info"+ :heading="messages.impactHeading"+ data-test-id="statuses-impact"+ >+ <ul class="flex flex-col gap-1">+ <li v-for="(change, index) in impact" :key="index" class="flex items-center gap-1.5">+ <span class="tabular-nums">{{ messages.layerCount(change.count) }}</span>+ <span>{{ change.from }}</span>+ <icon-lucide-arrow-right class="size-3" aria-hidden="true" />+ <span>{{ change.to ?? messages.noStatus }}</span>+ </li>+ </ul>+ </AppAlert>+ </div>++ <template #footer>+ <AppSelect+ :model-value="preset ?? CUSTOM"+ :options="presetOptions"+ :label="messages.preset"+ :ui="{ trigger: 'w-40' }"+ class="mr-auto"+ @update:model-value="choosePreset(String($event))"+ />+ <AppButton variant="ghost" :disabled="!dirty" @click="editor.reset()">+ {{ common.cancel }}+ </AppButton>+ <AppButton+ color="primary"+ variant="solid"+ :disabled="!dirty || unresolved.length > 0"+ data-test-id="statuses-apply"+ @click="apply"+ >+ {{ common.apply }}+ </AppButton>+ </template>+ </AppDialog>+ <AppConfirmationDialog+ v-model:open="confirmingDiscard"+ :heading="messages.discardTitle"+ :description="messages.discardDescription"+ :cancel-label="common.cancel"+ :confirm-label="messages.discard"+ tone="danger"+ @confirm="discard"+ />+</template>diff --git a/src/components/ui/select/AppSelect.vue b/src/components/ui/select/AppSelect.vueindex 448d8a5e6..20d49a688 100644--- a/src/components/ui/select/AppSelect.vue+++ b/src/components/ui/select/AppSelect.vue@@ -8,7 +8,7 @@ import {SelectValue} from 'reka-ui'import { tv } from 'tailwind-variants'-import { computed, useSlots } from 'vue'+import { computed, ref, useSlots, watch } from 'vue'import { useRetainedPopup } from '@open-pencil/vue'@@ -56,9 +56,21 @@ const selectedLabel = computed(.flatMap((group) => group.options).find((option) => option.value === modelValue.value)?.label)-const contentPlacement = computed(+const livePlacement = computed(() => placement ?? (slots.trigger || selectedLabel.value === undefined ? 'below' : 'over'))+/**+ * The menu keeps the placement it opened with: choosing the first option on a placeholder would+ * switch it while the menu closes, and Reka then skips restoring what it hid from assistive tech.+ */+const contentPlacement = ref(livePlacement.value)+watch(+ popupOpen,+ (open) => {+ if (open) contentPlacement.value = livePlacement.value+ },+ { flush: 'sync' }+)const contentUI = computed(() => ({content: ui?.content,viewport: ui?.viewport,@@ -97,7 +109,7 @@ const itemUI = computed(() => ({ item: ui?.item, indicator: ui?.indicator })):disabled="option.disabled":ui="itemUI">- {{ option.label }}+ <slot name="option" :option="option">{{ option.label }}</slot><template #end><slot name="option-end" :option="option" /></template></AppSelectItem></SelectGroup>diff --git a/src/theme/statuses.ts b/src/theme/statuses.tsnew file mode 100644index 000000000..6fcbb9e98--- /dev/null+++ b/src/theme/statuses.ts@@ -0,0 +1,15 @@+import { tv } from 'tailwind-variants'++/**+ * The Statuses dialog's rows: a drag handle, the color, the name, and delete, on one grid so the+ * new-status field and each row's hint line up with the names.+ */+export const statusRows = tv({+ slots: {+ row: 'grid grid-cols-[0.875rem_1.5rem_minmax(0,1fr)_1.5rem] items-center gap-x-1.5 gap-y-1',+ handle: 'size-3.5 cursor-grab text-muted',+ marker: 'flex size-6 items-center justify-center text-muted',+ hint: 'col-start-3 text-[11px] text-muted',+ field: 'col-start-3'+ }+})diff --git a/tests/e2e/canvas/status-labels.spec.ts b/tests/e2e/canvas/status-labels.spec.tsnew file mode 100644index 000000000..767db901f--- /dev/null+++ b/tests/e2e/canvas/status-labels.spec.ts@@ -0,0 +1,87 @@+import { expect, test, useEditorSetupWithClear } from '#tests/e2e/fixtures'++const editor = useEditorSetupWithClear('/?test&no-chrome&no-rulers')++test('status pills beside section titles and dots after frame names, cut short when narrow', async () => {+ await editor.page.evaluate(() => {+ const store = window.openPencil?.getStore?.()+ if (!store) throw new Error('OpenPencil store not initialized')+ const pageId = store.state.currentPageId+ const solid = (r: number, g: number, b: number) => [+ { type: 'SOLID' as const, color: { r, g, b, a: 1 }, visible: true, opacity: 1 }+ ]+ const section = store.graph.createNode('SECTION', pageId, {+ name: 'Checkout',+ x: 40,+ y: 60,+ width: 420,+ height: 220,+ fills: solid(0.96, 0.96, 0.96)+ })+ store.graph.createNode('FRAME', section.id, {+ name: 'Cart',+ x: 40,+ y: 60,+ width: 160,+ height: 120,+ fills: solid(1, 1, 1)+ })+ const changed = store.graph.createNode('SECTION', pageId, {+ name: 'Profile',+ x: 500,+ y: 60,+ width: 320,+ height: 220,+ fills: solid(0.26, 0.26, 0.26)+ })+ store.graph.createNode('FRAME', changed.id, {+ name: 'Avatar',+ x: 40,+ y: 60,+ width: 120,+ height: 120,+ fills: solid(1, 1, 1)+ })+ const ready = store.graph.createNode('FRAME', pageId, {+ name: 'Onboarding',+ x: 40,+ y: 360,+ width: 200,+ height: 140,+ fills: solid(1, 1, 1)+ })+ const edited = store.graph.createNode('FRAME', pageId, {+ name: 'Settings',+ x: 300,+ y: 360,+ width: 200,+ height: 140,+ fills: solid(1, 1, 1)+ })+ // Too narrow for the state's name: the title is cut short and the pill keeps only its dot.+ const narrow = store.graph.createNode('SECTION', pageId, {+ name: 'A narrow section',+ x: 600,+ y: 360,+ width: 150,+ height: 140,+ fills: solid(0.26, 0.26, 0.26)+ })+ const tight = store.graph.createNode('FRAME', pageId, {+ name: 'A frame named longer than it is wide',+ x: 600,+ y: 560,+ width: 120,+ height: 60,+ fills: solid(1, 1, 1)+ })+ store.setStatus([changed.id, ready.id, edited.id, narrow.id, tight.id], 'ready-for-dev')+ store.setStatus([section.id], 'completed')+ store.clearSelection()+ store.requestRender()+ })+ await editor.canvas.waitForRender()+ editor.canvas.assertNoErrors()+ const buffer = await editor.canvas.screenshotCanvasRegion()+ expect(buffer).toMatchSnapshot('status-labels.png', { maxDiffPixelRatio: 0, threshold: 0 })+})diff --git a/tests/e2e/canvas/status-labels.spec.ts-snapshots/status-labels-openpencil-darwin.png b/tests/e2e/canvas/status-labels.spec.ts-snapshots/status-labels-openpencil-darwin.pngnew file mode 100644index 000000000..e197241eeBinary files /dev/null and b/tests/e2e/canvas/status-labels.spec.ts-snapshots/status-labels-openpencil-darwin.png differdiff --git a/tests/e2e/properties/statuses.spec.ts b/tests/e2e/properties/statuses.spec.tsnew file mode 100644index 000000000..134fb5795--- /dev/null+++ b/tests/e2e/properties/statuses.spec.ts@@ -0,0 +1,127 @@+import { expect, test, useEditorSetupWithClear } from '#tests/e2e/fixtures'+import { propertySection } from '#tests/helpers/properties'++const editor = useEditorSetupWithClear('/?test')++/** Builds a section and selects it, returning its id. */+async function createSection() {+ return editor.page.evaluate(() => {+ const store = window.openPencil?.getStore?.()+ if (!store) throw new Error('OpenPencil store not initialized')+ const section = store.graph.createNode('SECTION', store.state.currentPageId, {+ name: 'Checkout',+ x: 120,+ y: 160,+ width: 400,+ height: 260,+ fills: [+ { type: 'SOLID', color: { r: 0.95, g: 0.95, b: 0.95, a: 1 }, visible: true, opacity: 1 }+ ]+ })+ store.graph.createNode('FRAME', section.id, {+ name: 'Cart',+ x: 40,+ y: 60,+ width: 160,+ height: 120+ })+ store.select([section.id])+ store.requestRender()+ return section.id+ })+}++function statusOf(id: string) {+ return editor.page.evaluate((nodeId) => {+ const store = window.openPencil?.getStore?.()+ if (!store) throw new Error('OpenPencil store not initialized')+ return store.graph.getNode(nodeId)?.status ?? null+ }, id)+}++test('sets a status from the Status section and from the label on the canvas', async () => {+ const id = await createSection()+ await editor.canvas.waitForRender()+ const section = propertySection(editor.page, 'Status')+ await section.getByRole('combobox', { name: 'Add status' }).click()+ await editor.page.getByRole('option', { name: 'Ready for dev' }).click()+ expect(await statusOf(id)).toBe('ready-for-dev')++ await editor.canvas.waitForRender()+ const pill = await editor.page.evaluate((nodeId) => {+ const store = window.openPencil?.getStore?.()+ const label = store?.renderer?.statusLabels.find((entry) => entry.nodeId === nodeId)+ if (!label) throw new Error('Status label not drawn')+ return { x: label.rect.x + label.rect.width / 2, y: label.rect.y + label.rect.height / 2 }+ }, id)+ await editor.page.evaluate(() => {+ const store = window.openPencil?.getStore?.()+ store?.clearSelection()+ })+ await editor.canvas.click(pill.x, pill.y)+ const menu = editor.page.getByTestId('status-label-menu')+ await expect(menu).toBeVisible()+ await menu.getByRole('button', { name: 'Completed' }).click()+ expect(await statusOf(id)).toBe('completed')+ await expect(menu).toBeHidden()+})++test('dialog edits stay a draft that says what it changes until Apply, one undo step', async () => {+ const id = await createSection()+ await editor.page.evaluate((nodeId) => {+ const store = window.openPencil?.getStore?.()+ store?.setStatus([nodeId], 'ready-for-dev')+ }, id)+ await propertySection(editor.page, 'Status')+ .getByRole('button', { name: 'Edit statuses…' })+ .click()+ const dialog = editor.page.getByTestId('statuses-dialog')+ const apply = dialog.getByRole('button', { name: 'Apply' })+ await expect(apply).toBeDisabled()++ await dialog+ .locator('[data-state-id="ready-for-dev"]')+ .getByRole('button', { name: 'Delete status' })+ .click()+ await expect(dialog.getByTestId('statuses-unresolved')).toBeVisible()+ await expect(apply).toBeDisabled()+ expect(await statusOf(id)).toBe('ready-for-dev')++ await dialog.getByTestId('status-removed-row').getByRole('combobox', { name: 'Move to' }).click()+ await editor.page.getByRole('option', { name: 'Completed' }).click()+ await expect(dialog.getByRole('listitem')).toHaveCount(1)+ expect(await statusOf(id)).toBe('ready-for-dev')++ await apply.click()+ expect(await statusOf(id)).toBe('completed')+ await expect(dialog.locator('[data-state-id="ready-for-dev"]')).toHaveCount(0)++ await editor.page.keyboard.press('ControlOrMeta+z')+ expect(await statusOf(id)).toBe('ready-for-dev')+ await expect(dialog.locator('[data-state-id="ready-for-dev"]')).toHaveCount(1)+ await editor.page.keyboard.press('ControlOrMeta+Shift+z')+ expect(await statusOf(id)).toBe('completed')+})++test('closing the dialog with edits not applied asks before discarding them', async () => {+ await createSection()+ await propertySection(editor.page, 'Status')+ .getByRole('button', { name: 'Edit statuses…' })+ .click()+ const dialog = editor.page.getByTestId('statuses-dialog')+ const name = dialog.getByRole('textbox', { name: 'Name' }).first()+ await name.fill('Renamed')+ await name.press('Enter')+ await dialog.getByRole('button', { name: 'Close' }).click()+ const confirm = editor.page.getByRole('alertdialog')+ await expect(confirm).toBeVisible()+ await confirm.getByRole('button', { name: 'Discard' }).click()+ await expect(dialog).toBeHidden()+ const names = await editor.page.evaluate(() =>+ window.openPencil+ ?.getStore?.()+ .statusWorkflow()+ .states.map((state) => state.name)+ )+ expect(names).not.toContain('Renamed')+})diff --git a/tests/engine/io/fig/import/raw-field-coverage.test.ts b/tests/engine/io/fig/import/raw-field-coverage.test.tsindex 17bfb9c68..299d27453 100644--- a/tests/engine/io/fig/import/raw-field-coverage.test.ts+++ b/tests/engine/io/fig/import/raw-field-coverage.test.ts@@ -68,6 +68,7 @@ const RAW_FIELD_COVERAGE = {'fontSize','letterSpacing','lineHeight',+ 'sectionStatusInfo','strokeJoin','strokePaints','strokeWeight',@@ -106,7 +107,6 @@ const RAW_FIELD_COVERAGE = {'prototypeInteractions','prototypeStartNodeID','scatterStrokeSettings',- 'sectionStatusInfo','slideThemeMap','sortPosition','sourceLibraryKey',diff --git a/tools/checks/i18n/mixed-script-baseline.txt b/tools/checks/i18n/mixed-script-baseline.txtindex 0800a7ad1..b025f3c61 100644--- a/tools/checks/i18n/mixed-script-baseline.txt+++ b/tools/checks/i18n/mixed-script-baseline.txt@@ -436,8 +436,12 @@ ja:storage.cloudDescriptionja:storage.waitlistJoinedDetailja:storage.waitlistOpenWebsiteja:storage.waitlistUnavailable+ja:statuses.figmaShows+ja:statuses.presetHandoffzh-cn:panels.gridSummaryGridzh-cn:storage.cloudDescriptionzh-cn:storage.waitlistJoinedDetailzh-cn:storage.waitlistOpenWebsitezh-cn:storage.waitlistUnavailable+zh-cn:statuses.figmaShows+zh-cn:statuses.presetHandoffdiff --git a/tools/checks/i18n/translation-baseline.txt b/tools/checks/i18n/translation-baseline.txtindex 27d21366f..e1b43d526 100644--- a/tools/checks/i18n/translation-baseline.txt+++ b/tools/checks/i18n/translation-baseline.txt@@ -359,13 +359,18 @@ fr:menu.variablesfr:variables.collectionsde:panels.gridAutode:storage.cloudTitle+de:statuses.name+de:statuses.statuses:panels.gridColores:panels.gridAutoes:storage.cloudTitle+es:statuses.colorfr:panels.gridTypefr:panels.gridAutofr:storage.cloudTitle+fr:statuses.presetSimpleit:panels.gridAutoit:storage.cloudTitlepl:panels.gridAutopl:storage.cloudTitle+pl:statuses.status