AI-native design editor. Open-source Figma alternative.
Update specs and docs for 39 new commits: sections, pages, .fig export, rendering
Anton A S65344b6300f9
diff --git a/docs/development/roadmap.md b/docs/development/roadmap.mdindex 24d87f775..1b0d9e38c 100644--- a/docs/development/roadmap.md+++ b/docs/development/roadmap.md@@ -29,18 +29,28 @@ Properties panel, layers panel, toolbar, Yoga layout integration, text editing.- System font loading via Local Font Access API- Canvas rulers with selection highlight-### Phase 3: File Format + Import ✅+### Phase 3: File Format + Import/Export ✅-.fig import, Kiwi codec, clipboard compatibility.+.fig import/export, Kiwi codec, clipboard, sections, pages, advanced rendering.**Delivered:**- .fig file import via Kiwi binary codec+- .fig file export with Kiwi encoding, Zstd compression, thumbnail generation+- Save (⌘S) and Save As (⇧⌘S) with native OS dialogs+- Zstd compression via Tauri Rust command (deflate fallback in browser)- Vendored kiwi-schema with ESM + sparse field ID patches- Figma-compatible clipboard (bidirectional fig-kiwi binary)- Pen tool with vector network model- vectorNetworkBlob binary encode/decode- Group/ungroup (⌘G/⇧⌘G)-- Tauri v2 desktop app with native macOS menu bar+- Tauri v2 desktop app with native menu bar (macOS/Windows/Linux)+- Sections (S key) with title pills, auto-adopt, luminance-adaptive text+- Multi-page documents with pages panel, per-page viewport+- Hover highlight with shape-aware outlines+- Tier 1 rendering: gradients, image fills, effects, strokes (cap/join/dash), arcs+- Fill type picker with solid/gradient/image tabs and gradient stop editing+- Canvas background color per page+- Fig-import unit tests, layout unit tests, layers-panel E2E tests### Phase 4: Components + Variables 🔲@@ -82,7 +92,7 @@ Prototyping, comments, desktop distribution, documentation, public launch.|-------|-------------------|--------|| Phase 1: Core Engine | 3 months | ✅ Complete || Phase 2: Editor UI + Layout | 3 months | ✅ Complete |-| Phase 3: File Format + Import | 2 months | ✅ Complete |+| Phase 3: File Format + Import/Export | 2 months | ✅ Complete || Phase 4: Components + Variables | 2 months | 🔲 Planned || Phase 5: AI Integration | 2 months | 🔲 Planned || Phase 6: Polish + Distribution | 2 months | 🔲 Planned |diff --git a/docs/development/testing.md b/docs/development/testing.mdindex f74b32b19..151dd019c 100644--- a/docs/development/testing.md+++ b/docs/development/testing.md@@ -49,10 +49,9 @@ bun run test:unit```Tests cover:-- Scene graph CRUD operations-- Parent-child relationships-- Z-ordering-- Hit testing+- Scene graph CRUD operations, parent-child relationships, z-ordering, hit testing+- **Fig-import pipeline** — node type mapping, transforms, fills/strokes/effects, gradients, images, arcs, nested hierarchies (`tests/engine/fig-import.test.ts`, 356 lines)+- **Layout computation** — Yoga auto-layout: direction, gap, padding, justify, align, child sizing (fixed/fill/hug), cross-axis sizing, wrap, nested layouts (`tests/engine/layout.test.ts`, 888 lines)### Writing Unit Tests@@ -69,6 +68,13 @@ describe('SceneGraph', () => {})```+## E2E Test Coverage++| Test file | Scope |+|-----------|-------|+| `tests/e2e/layers-panel.spec.ts` | Layers panel tree structure, visibility toggles, selection sync |+| `tests/e2e/visual.spec.ts` | Visual regression screenshots for shapes and rendering |+## Test Helpers| File | Purpose |diff --git a/docs/guide/architecture.md b/docs/guide/architecture.mdindex 9e6578d7a..57172b817 100644--- a/docs/guide/architecture.md+++ b/docs/guide/architecture.md@@ -25,7 +25,7 @@│ │ │ ││ │ ┌──────────────────────────────────────────────────────┐ │ ││ │ │ File Format Layer │ │ │-│ │ │ .openpencil (Kiwi) ── .fig import ── .svg export │ │ │+│ │ │ .fig import/export ── Kiwi codec ── .svg (planned) │ │ ││ │ └──────────────────────────────────────────────────────┘ │ ││ └────────────────────────────────────────────────────────────┘ ││ │@@ -37,10 +37,10 @@The UI follows Figma's UI3 layout — toolbar at the bottom, navigation on the left, properties on the right:-- **Navigation panel (left)** — Layers tree, asset library (planned), page tabs (planned)+- **Navigation panel (left)** — Layers tree, pages panel, asset library (planned)- **Canvas (center)** — Infinite canvas with CanvasKit rendering, zoom/pan- **Properties panel (right)** — Context-sensitive sections: Appearance, Fill, Stroke, Typography, Layout, Position-- **Toolbar (bottom)** — Tool selection: Select, Frame, Rectangle, Ellipse, Line, Text, Pen, Hand+- **Toolbar (bottom)** — Tool selection: Select, Frame, Section, Rectangle, Ellipse, Line, Text, Pen, Hand## Components@@ -75,7 +75,7 @@ Meta's Yoga provides CSS flexbox layout computation. A thin adapter maps Figma p### File Format (Kiwi Binary)-Reuses Figma's proven Kiwi binary codec with 194 message/enum/struct definitions. The `.fig` import pipeline: parse header → Zstd decompress → Kiwi decode → NodeChange[] → scene graph.+Reuses Figma's proven Kiwi binary codec with 194 message/enum/struct definitions. The `.fig` import pipeline: parse header → Zstd decompress → Kiwi decode → NodeChange[] → scene graph. The export pipeline reverses the process: scene graph → NodeChange[] → Kiwi encode → Zstd compress → ZIP with thumbnail.See [File Format Reference](/reference/file-format) for details.diff --git a/docs/guide/features.md b/docs/guide/features.mdindex 507c6150d..66f5557a2 100644--- a/docs/guide/features.md+++ b/docs/guide/features.md@@ -1,8 +1,8 @@# Features-## Figma .fig File Import+## Figma .fig File Import & Export-Open native Figma files directly. The Kiwi binary codec decodes the full 194-definition schema including NodeChange messages with ~390 fields. The pipeline: parse header → decompress Zstd → decode Kiwi schema → extract NodeChange[] → build scene graph.+Open and save native Figma files directly. Import decodes the full 194-definition Kiwi schema including NodeChange messages with ~390 fields. Export encodes the scene graph back to Kiwi binary with Zstd compression and thumbnail generation. Save (<kbd>⌘</kbd><kbd>S</kbd>) and Save As (<kbd>⇧</kbd><kbd>⌘</kbd><kbd>S</kbd>) use native OS dialogs on the desktop app. The import/export pipeline supports round-trip fidelity.## Figma Clipboard@@ -41,9 +41,9 @@ Edge and center snapping with red guide lines when nodes align. Rotation-awareRulers at the top and left edges show coordinate scales. When you select a node, rulers highlight its position with a translucent band and show coordinate badges at the start/end points.-## Color Picker+## Color Picker & Fill Types-HSV color selection with hue slider, alpha slider, hex input, and opacity control. Connected to fill and stroke sections in the properties panel.+HSV color selection with hue slider, alpha slider, hex input, and opacity control. The fill type picker supports solid colors, gradients (linear, radial, angular, diamond) with editable gradient stops, and image fills. Gradient transforms position the gradient within the shape. Connected to fill and stroke sections in the properties panel.## Layers Panel@@ -54,19 +54,42 @@ Tree view of the document hierarchy using Reka UI Tree component. Expand/collapsContext-sensitive panel with sections:- **Appearance** — size, position, rotation, opacity, corner radius, visibility-- **Fill** — color with hex input, opacity, visibility toggle-- **Stroke** — color, weight, opacity+- **Fill** — solid/gradient/image type picker, gradient stop editor, hex input, opacity+- **Stroke** — color, weight, opacity, cap, join, dash pattern- **Typography** — font family, weight, size, alignment- **Layout** — auto-layout controls when enabled- **Position** — alignment buttons, rotation, flip+- **Page** — canvas background color (shown when no nodes selected)## Group/Ungroup⌘G groups selected nodes. ⇧⌘G ungroups. Nodes are sorted by visual position when grouping to preserve reading order.+## Sections++Sections (<kbd>S</kbd>) are top-level organizational containers on the canvas. Each section displays a title pill with the section name. Title text color automatically inverts based on the pill's background luminance for readability. Creating a section auto-adopts overlapping sibling nodes. Frame name labels are shown for direct children of sections.++## Multi-Page Documents++Documents support multiple pages like Figma. The pages panel lets you add, delete, and rename pages. Each page maintains independent viewport state (pan, zoom, background color). Double-click a page name to rename inline.++## Hover Highlight++Nodes highlight on hover with a shape-aware outline that follows the actual geometry — ellipses get elliptical outlines, rounded rectangles get rounded outlines, vectors get path outlines. This provides visual feedback before clicking to select.++## Advanced Rendering++The CanvasKit renderer supports full tier 1 visual features:++- **Gradient fills** — linear, radial, angular, diamond with gradient stops and transforms+- **Image fills** — decoded from blob data with scale modes (fill, fit, crop, tile)+- **Effects** — drop shadow, inner shadow, layer blur, background blur, foreground blur+- **Stroke properties** — cap (none, round, square, arrow), join (miter, bevel, round), dash patterns+- **Arc data** — partial ellipses with start/end angle and inner radius (donuts)+## Desktop App-Tauri v2 shell (~5MB vs Electron's ~100MB). Native macOS menu bar with File/Edit/View/Window menus. Menu events are wired to the Vue frontend. Developer Tools accessible via ⌘⌥I.+Tauri v2 shell (~5MB vs Electron's ~100MB). Native menu bar with File/Edit/View/Object/Window/Help menus on all platforms. macOS gets an app-level submenu. Native Save/Open dialogs via Tauri plugin-dialog. Zstd compression offloaded to Rust for .fig export performance. Developer Tools accessible via <kbd>⌘</kbd><kbd>⌥</kbd><kbd>I</kbd>.## ScrubInputdiff --git a/docs/index.md b/docs/index.mdindex 64acb719a..2ec7620f0 100644--- a/docs/index.md+++ b/docs/index.md@@ -1,6 +1,6 @@---layout: home-description: Open-source, AI-native design editor. Figma alternative with .fig import, auto-layout, and 117 MCP tools.+description: Open-source, AI-native design editor. Figma alternative with .fig import/export, auto-layout, gradients, effects, sections, pages, and 117 MCP tools.hero:name: OpenPencil@@ -16,14 +16,14 @@ hero:features:- icon: 📂- title: Figma .fig Import- details: Open native Figma files directly via Kiwi binary codec with full NodeChange support.- - icon: 📋- title: Figma Clipboard- details: Copy/paste between OpenPencil and Figma. Bidirectional fig-kiwi binary encoding.- - icon: ✏️- title: Pen Tool & Vectors- details: Vector network model with bezier curves, open/closed paths, and tangent handles.+ title: Figma .fig Import & Export+ details: Open and save native Figma files. Kiwi codec, Zstd compression, round-trip fidelity.+ - icon: 🎨+ title: Advanced Rendering+ details: Gradients, image fills, effects (shadows, blurs), stroke styles, arcs — full tier 1 parity.+ - icon: 📄+ title: Pages & Sections+ details: Multi-page documents with per-page viewport. Sections for canvas organization with auto-adopt.- icon: 📐title: Auto-Layoutdetails: Yoga WASM flexbox engine. Direction, gap, padding, justify, align, child sizing.@@ -32,5 +32,5 @@ features:details: 117 MCP tools expose the entire editor API to AI agents. Design with conversation.- icon: 🖥️title: Desktop App- details: Tauri v2 shell — ~5MB native app with macOS menu bar, not 100MB Electron.+ details: Tauri v2 shell — ~5MB native app with native menus and file dialogs on all platforms.---diff --git a/docs/reference/file-format.md b/docs/reference/file-format.mdindex 5bd044e66..64ff5415a 100644--- a/docs/reference/file-format.md+++ b/docs/reference/file-format.md@@ -22,6 +22,16 @@→ Resolve blob refs → Render on canvas```+## Export Pipeline++```+SceneGraph → NodeChange[] → Kiwi encode → Compress (Zstd/deflate)+ → Build ZIP (header + schema + message + thumbnail.png)+ → Write .fig file+```++Export uses <kbd>⌘</kbd><kbd>S</kbd> (Save) and <kbd>⇧</kbd><kbd>⌘</kbd><kbd>S</kbd> (Save As) with native OS dialogs on the desktop app. The exported file includes a `thumbnail.png` required by Figma for file preview. Compression uses Zstd via Tauri Rust command on desktop, with deflate fallback in the browser. The ZIP archive is assembled in Rust on desktop for correct Zstd frame headers (content size included).+## Kiwi Binary CodecThe codec handles Figma's 194-definition Kiwi schema with NodeChange as the central type (~390 fields). Key components:@@ -37,13 +47,13 @@ Figma's schema uses non-contiguous field IDs (e.g., 1, 2, 5, 10 with gaps). The### Compression-.fig files use Zstd compression for both the schema and message payloads. The `fzstd` library handles decompression. For clipboard encoding, `fflate` provides lightweight compression.+.fig files use Zstd compression for both the schema and message payloads. Decompression uses the `fzstd` library. For export, Zstd compression is offloaded to a Tauri Rust command on the desktop app (better performance, correct frame headers). In the browser, deflate via `fflate` is used as a fallback. Clipboard encoding also uses `fflate`.## Supported Formats| Format | Import | Export ||--------|--------|--------|-| .fig (Figma) | ✅ | — |+| .fig (Figma) | ✅ | ✅ || .svg | Planned | Planned || .png | Planned | Planned || .pdf | — | Planned |diff --git a/docs/reference/keyboard-shortcuts.md b/docs/reference/keyboard-shortcuts.mdindex d52809c93..369fa6adf 100644--- a/docs/reference/keyboard-shortcuts.md+++ b/docs/reference/keyboard-shortcuts.md@@ -14,7 +14,7 @@ Full Figma-compatible shortcut map. ✅ = implemented.| <kbd>K</kbd> | Scale | || <kbd>H</kbd> | Hand | ✅ || <kbd>F</kbd> | Frame | ✅ |-| <kbd>S</kbd> | Section / Slice | |+| <kbd>S</kbd> | Section | ✅ || <kbd>R</kbd> | Rectangle | ✅ || <kbd>O</kbd> | Ellipse | ✅ || <kbd>L</kbd> | Line | ✅ |@@ -32,7 +32,8 @@ Full Figma-compatible shortcut map. ✅ = implemented.| <kbd>⌘</kbd><kbd>N</kbd> | New Window | || <kbd>⌘</kbd><kbd>O</kbd> | Open File | ✅ || <kbd>⌘</kbd><kbd>W</kbd> | Close Tab | |-| <kbd>⌘</kbd><kbd>S</kbd> | Save | |+| <kbd>⌘</kbd><kbd>S</kbd> | Save | ✅ |+| <kbd>⇧</kbd><kbd>⌘</kbd><kbd>S</kbd> | Save As | ✅ || <kbd>⇧</kbd><kbd>⌘</kbd><kbd>E</kbd> | Export… | |## Editdiff --git a/docs/reference/node-types.md b/docs/reference/node-types.mdindex cbae5cbac..02b52513f 100644--- a/docs/reference/node-types.md+++ b/docs/reference/node-types.md@@ -1,59 +1,81 @@# Node Types-The scene graph uses Figma's Kiwi schema with 28 node types. Each node is identified by a GUID (`sessionID:localID`) and has a parent reference via `parentIndex`.+The scene graph supports 28 node types from Figma's Kiwi schema. Each node is identified by a GUID (`sessionID:localID`) and has a parent reference via `parentIndex`. The OpenPencil engine's `NodeType` union currently uses 17 of these types.## Type Table-| Type | ID | Description |-|------|----|-------------|-| DOCUMENT | 1 | Root node, one per file |-| CANVAS | 2 | Page |-| GROUP | 3 | Group container |-| FRAME | 4 | Primary container (artboard), supports auto-layout |-| BOOLEAN_OPERATION | 5 | Union/subtract/intersect/exclude result |-| VECTOR | 6 | Freeform vector path |-| STAR | 7 | Star shape |-| LINE | 8 | Line |-| ELLIPSE | 9 | Ellipse/circle, supports arc data |-| RECTANGLE | 10 | Rectangle |-| REGULAR_POLYGON | 11 | Regular polygon (3–12 sides) |-| ROUNDED_RECTANGLE | 12 | Rectangle with smooth corners |-| TEXT | 13 | Text with rich formatting |-| SLICE | 14 | Export region |-| SYMBOL | 15 | Component (main) |-| INSTANCE | 16 | Component instance |-| STICKY | 17 | FigJam sticky note |-| SHAPE_WITH_TEXT | 18 | FigJam shape |-| CONNECTOR | 19 | Connector line between nodes |-| CODE_BLOCK | 20 | FigJam code block |-| WIDGET | 21 | Plugin widget |-| STAMP | 22 | FigJam stamp |-| MEDIA | 23 | Video/GIF |-| HIGHLIGHT | 24 | FigJam highlight |-| SECTION | 25 | Canvas section (organizational) |-| SECTION_OVERLAY | 26 | Section overlay |-| WASHI_TAPE | 27 | FigJam washi tape |-| VARIABLE | 28 | Variable definition node |+All 28 Figma schema types. Types marked ✅ are in the engine's `NodeType` union and actively handled (16 mapped from Kiwi + `COMPONENT_SET` as a synthetic type = 17 total).++| Type | ID | Description | Engine |+|------|----|-------------|--------|+| DOCUMENT | 1 | Root node, one per file | — |+| CANVAS | 2 | Page | ✅ |+| GROUP | 3 | Group container | ✅ |+| FRAME | 4 | Primary container (artboard), supports auto-layout | ✅ |+| BOOLEAN_OPERATION | 5 | Union/subtract/intersect/exclude result | |+| VECTOR | 6 | Freeform vector path | ✅ |+| STAR | 7 | Star shape | ✅ |+| LINE | 8 | Line | ✅ |+| ELLIPSE | 9 | Ellipse/circle, supports arc data | ✅ |+| RECTANGLE | 10 | Rectangle | ✅ |+| REGULAR_POLYGON | 11 | Regular polygon (3–12 sides, engine uses `POLYGON`) | ✅ |+| ROUNDED_RECTANGLE | 12 | Rectangle with smooth corners | ✅ |+| TEXT | 13 | Text with rich formatting | ✅ |+| SLICE | 14 | Export region | |+| SYMBOL | 15 | Component (main, engine uses `COMPONENT`) | ✅ |+| INSTANCE | 16 | Component instance | ✅ |+| STICKY | 17 | FigJam sticky note | |+| SHAPE_WITH_TEXT | 18 | FigJam shape | ✅ |+| CONNECTOR | 19 | Connector line between nodes | ✅ |+| CODE_BLOCK | 20 | FigJam code block | |+| WIDGET | 21 | Plugin widget | |+| STAMP | 22 | FigJam stamp | |+| MEDIA | 23 | Video/GIF | |+| HIGHLIGHT | 24 | FigJam highlight | |+| SECTION | 25 | Canvas section (organizational, top-level only) | ✅ |+| SECTION_OVERLAY | 26 | Section overlay | |+| WASHI_TAPE | 27 | FigJam washi tape | |+| VARIABLE | 28 | Variable definition node | |++### Engine NodeType Union (17 types)++The engine's `NodeType` uses simplified names. Some differ from the Kiwi schema:+- `COMPONENT` → Kiwi `SYMBOL` (ID 15)+- `COMPONENT_SET` → variant group container (no dedicated Kiwi ID, mapped from SYMBOL with variants)+- `POLYGON` → Kiwi `REGULAR_POLYGON` (ID 11)++```typescript+type NodeType =+ | 'CANVAS' | 'FRAME' | 'RECTANGLE' | 'ROUNDED_RECTANGLE'+ | 'ELLIPSE' | 'TEXT' | 'LINE' | 'STAR' | 'POLYGON'+ | 'VECTOR' | 'GROUP' | 'SECTION'+ | 'COMPONENT' | 'COMPONENT_SET' | 'INSTANCE'+ | 'CONNECTOR' | 'SHAPE_WITH_TEXT'+```## Node Hierarchy```Document-└── Canvas (page)- ├── Frame- │ ├── Rectangle- │ ├── Text- │ └── Frame (nested)- │ ├── Ellipse- │ └── Instance (→ references Component)- ├── Component- │ └── ...children- ├── Section- │ └── Frame- ├── Group- │ └── ...children- └── BooleanOperation- └── ...operand shapes+├── Canvas (Page 1)+│ ├── Section (top-level only, title pill, auto-adopts siblings)+│ │ ├── Frame+│ │ │ └── ...children+│ │ └── Rectangle+│ ├── Frame+│ │ ├── Rectangle+│ │ ├── Text+│ │ └── Frame (nested)+│ │ ├── Ellipse+│ │ └── Instance (→ references Component)+│ ├── Component+│ │ └── ...children+│ ├── Group+│ │ └── ...children+│ └── BooleanOperation+│ └── ...operand shapes+└── Canvas (Page 2)+ └── ...```## Core Properties@@ -125,28 +147,47 @@ Every node carries these fields (subset of NodeChange):## Paint-```-Paint {- type: SOLID | GRADIENT_LINEAR | GRADIENT_RADIAL |- GRADIENT_ANGULAR | GRADIENT_DIAMOND | IMAGE- color: {r, g, b, a} (0–1 floats)- opacity: 0–1- visible: boolean- blendMode: BlendMode- stops: ColorStop[] (for gradients)- transform: Matrix (for gradient/image positioning)+```typescript+interface Fill {+ type: 'SOLID' | 'GRADIENT_LINEAR' | 'GRADIENT_RADIAL' |+ 'GRADIENT_ANGULAR' | 'GRADIENT_DIAMOND' | 'IMAGE'+ color: Color // {r, g, b, a} 0–1 floats+ opacity: number // 0–1+ visible: boolean+ blendMode?: BlendMode+ gradientStops?: GradientStop[] // for gradients+ gradientTransform?: GradientTransform // 2×3 matrix+ imageHash?: string // for image fills+ imageScaleMode?: 'FILL' | 'FIT' | 'CROP' | 'TILE'+ imageTransform?: GradientTransform}```## Effect+```typescript+interface Effect {+ type: 'DROP_SHADOW' | 'INNER_SHADOW' | 'LAYER_BLUR' |+ 'BACKGROUND_BLUR' | 'FOREGROUND_BLUR'+ color: Color+ offset: { x: number; y: number }+ radius: number+ spread: number+ visible: boolean+}```-Effect {- type: INNER_SHADOW | DROP_SHADOW | FOREGROUND_BLUR | BACKGROUND_BLUR- color: {r, g, b, a}- offset: {x, y}- radius: float- spread: float- visible: boolean++## Stroke++```typescript+interface Stroke {+ color: Color+ weight: number+ opacity: number+ visible: boolean+ align: 'INSIDE' | 'CENTER' | 'OUTSIDE'+ cap?: 'NONE' | 'ROUND' | 'SQUARE' | 'ARROW_LINES' | 'ARROW_EQUILATERAL'+ join?: 'MITER' | 'BEVEL' | 'ROUND'+ dashPattern?: number[]}```diff --git a/docs/reference/scene-graph.md b/docs/reference/scene-graph.mdindex c1b371823..2c60c9b51 100644--- a/docs/reference/scene-graph.md+++ b/docs/reference/scene-graph.md@@ -12,11 +12,15 @@ interface SceneGraph {getNode(id: string): NodegetChildren(id: string): Node[]getParent(id: string): Node | null+ getPages(): Node[]createNode(type: NodeType, parent: string, props: Partial<NodeChange>): NodeupdateNode(id: string, changes: Partial<NodeChange>): voiddeleteNode(id: string): voidmoveNode(id: string, newParent: string, position: string): void+ addPage(name: string): Node+ deletePage(id: string): void+ renamePage(id: string, name: string): voidfindByType(type: NodeType): Node[]findByName(pattern: string): Node[]@@ -25,6 +29,18 @@ interface SceneGraph {}```+## Pages++Documents support multiple pages (CANVAS nodes as direct children of the DOCUMENT root). Each page has its own child tree and independent viewport state (panX, panY, zoom, pageColor). The editor tracks `currentPageId` and renders only the active page's children.++## Sections++SECTION nodes are top-level organizational containers (direct children of CANVAS only). They cannot nest inside frames or groups. Creating a section auto-adopts overlapping siblings. Sections display a title pill with luminance-adaptive text color.++## Hover State++The editor state tracks `hoveredNodeId` — the node currently under the cursor. The renderer draws a shape-aware hover outline (following actual geometry for ellipses, rounded rects, vectors) for visual feedback before selection.+## Undo/RedoThe system uses Figma's **inverse command** pattern. Each undo entry contains the forward changes and their automatically-computed inverse:@@ -68,6 +84,14 @@ Given a point in canvas coordinates, the scene graph returns the topmost visibleFor marquee selection, `getNodesInRect` returns all nodes whose bounds intersect the given rectangle.+## Extended Fill Types++Fills support six types: SOLID, GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, GRADIENT_DIAMOND, and IMAGE. Gradient fills carry `gradientStops` (color + position pairs) and a `gradientTransform` (2×3 matrix). Image fills reference blob data via `imageHash` with scale modes (FILL, FIT, CROP, TILE).++## Extended Stroke Properties++Strokes support `cap` (NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL), `join` (MITER, BEVEL, ROUND), and `dashPattern` (array of dash/gap lengths) in addition to the base color, weight, opacity, visible, and align properties.+## Coordinate SystemNodes store position and size relative to their parent. To get absolute (canvas) coordinates, walk up the parent chain applying transforms. The renderer uses this to draw nested frames with correct positioning.diff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/.openspec.yaml b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/.openspec.yamlnew file mode 100644index 000000000..34b5b2315--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/.openspec.yaml@@ -0,0 +1,2 @@+schema: spec-driven+created: 2026-02-28diff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/design.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/design.mdnew file mode 100644index 000000000..e03cd5865--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/design.md@@ -0,0 +1,45 @@+## Context++39 commits landed since the baseline specs and VitePress docs were created. The specs in `openspec/specs/` and docs in `docs/` are now behind the actual implementation. This is a documentation-only catchup change.++## Goals / Non-Goals++**Goals:**+- Add requirements/scenarios to 9 existing specs covering all new functionality+- Update all affected VitePress doc pages with accurate feature descriptions+- Keep specs and docs as the source of truth for the current state++**Non-Goals:**+- No source code changes+- No new specs — all new features map to existing capability domains+- No new doc pages — updates to existing ones++## Decisions++### Delta-spec approach for all 9 modified capabilities+Each modified spec gets a delta-spec in `specs/<name>/spec.md` that adds new requirements. On archive, these merge into the baseline specs.++### Docs updates derived from spec changes+Each spec update implies a corresponding docs update. The mapping:+- `scene-graph` → node-types.md, scene-graph.md+- `canvas-rendering` → features.md, architecture.md+- `editor-ui` → features.md, keyboard-shortcuts.md+- `fig-import` → file-format.md, features.md, keyboard-shortcuts.md+- `desktop-app` → features.md+- `testing` → testing.md+- `vitepress-docs` → roadmap.md++### Feature categorization+Group new features by commit clusters:+1. Sections (cadbd13..55c3ea3): SECTION node type, title pills, auto-adopt+2. Pages (1d79473..fd2e38e): multi-page, PagesPanel, viewport per page+3. Hover highlight (b10d427, adc95c7): shape-aware outlines+4. .fig export (086fb7d..edf6da6): Save/SaveAs, Kiwi encode, Zstd Rust, thumbnail+5. Rendering tier 1 (e2e0e75): gradients, images, effects, strokes, arcs+6. Fill picker (cf454a8): solid/gradient/image tabs, gradient stops+7. Tests (07f0f55, 27f83c7, layers-panel E2E): fig-import, layout, E2E++## Risks / Trade-offs++- [Spec count accuracy] Some features (like new NodeType variants) only need a mention in existing requirements rather than separate requirements → Keep granularity consistent with baseline+- [Docs staleness] Future commits will continue to drift → This is expected; periodic catchup changes are the workflowdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/proposal.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/proposal.mdnew file mode 100644index 000000000..b951e5873--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/proposal.md@@ -0,0 +1,33 @@+## Why++39 new commits landed on master after the initial baseline specs and VitePress docs were created. These commits introduce sections, multi-page documents, hover highlight, .fig export, tier 1 rendering (gradients/images/effects), fill type picker, new node types, and extensive new tests. The OpenSpec specs and VitePress docs are now stale and need to reflect the current state.++## What Changes++- Update existing OpenSpec specs with new capabilities: sections, pages, hover highlight, .fig export, advanced rendering, fill picker, native dialogs, new node types, new tests+- Update VitePress docs to reflect new features: features page, keyboard shortcuts (section tool ✅), file-format (export support), architecture, roadmap, node-types, scene-graph+- No source code changes — specs and docs only++## Capabilities++### New Capabilities++(none — all functionality maps to existing spec domains)++### Modified Capabilities++- `scene-graph`: new node types (CANVAS, ROUNDED_RECTANGLE, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT), pages support, sections, hover state+- `canvas-rendering`: tier 1 rendering (gradients, images, effects, stroke cap/join/dash, arcs), hover highlight outline+- `editor-ui`: pages panel, fill type picker (solid/gradient/image tabs, gradient stops), section tool, hover highlight, canvas background color+- `fig-import`: .fig export (Save/Save As), Zstd compression via Tauri Rust, thumbnail generation, browser deflate fallback+- `desktop-app`: Tauri native Save/Open dialogs (plugin-dialog + plugin-fs)+- `selection-manipulation`: section creation with auto-adopt siblings+- `testing`: fig-import unit tests, layout unit tests, layers-panel E2E tests+- `kiwi-codec`: .fig export encoding path+- `vitepress-docs`: update all docs pages to reflect new features++## Impact++- `openspec/specs/` — 9 spec files updated with new requirements/scenarios+- `docs/` — 8+ docs pages updated with new content+- No source code, dependencies, or API changesdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/canvas-rendering/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/canvas-rendering/spec.mdnew file mode 100644index 000000000..202bdb025--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/canvas-rendering/spec.md@@ -0,0 +1,61 @@+## ADDED Requirements++### Requirement: Gradient rendering+The renderer SHALL draw gradient fills: GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, and GRADIENT_DIAMOND using CanvasKit shaders with gradient stops and transform matrices.++#### Scenario: Linear gradient on rectangle+- **WHEN** a rectangle has a GRADIENT_LINEAR fill with stops at 0% (#FF0000) and 100% (#0000FF)+- **THEN** the rectangle renders with a smooth red-to-blue linear gradient++### Requirement: Image fill rendering+The renderer SHALL draw IMAGE fills using CanvasKit image decoding. Image transforms (scale, position) and scale modes (FILL, FIT, CROP, TILE) SHALL be applied.++#### Scenario: Image fill on frame+- **WHEN** a frame has an IMAGE fill with imageHash referencing a blob+- **THEN** the image is decoded and rendered within the frame bounds++### Requirement: Effect rendering+The renderer SHALL draw effects: DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR, and FOREGROUND_BLUR using CanvasKit filters.++#### Scenario: Drop shadow on rectangle+- **WHEN** a rectangle has a DROP_SHADOW effect with offset (4, 4), radius 8, color rgba(0,0,0,0.25)+- **THEN** a shadow is rendered below the rectangle with the specified offset, blur, and color++### Requirement: Stroke cap, join, and dash rendering+The renderer SHALL apply stroke cap (NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL), join (MITER, BEVEL, ROUND), and dash pattern to strokes.++#### Scenario: Round cap dashed stroke+- **WHEN** a line has strokeCap ROUND and dashPattern [10, 5]+- **THEN** the line renders with rounded dash ends and 10px-on/5px-off pattern++### Requirement: Arc rendering+The renderer SHALL draw ellipses with arcData (startAngle, endAngle, innerRadius) as partial arcs or donuts.++#### Scenario: Semi-circle arc+- **WHEN** an ellipse has arcData with startAngle 0 and endAngle π+- **THEN** only the top half of the ellipse is rendered++### Requirement: Hover highlight rendering+The renderer SHALL draw a shape-aware hover outline for the node under the cursor. The outline follows the actual shape geometry (ellipses, rounded rects, vectors), not just the bounding box.++#### Scenario: Hover over ellipse+- **WHEN** the cursor hovers over an ellipse+- **THEN** a thin outline matching the ellipse shape is drawn++### Requirement: Section rendering+The renderer SHALL draw SECTION nodes with a title pill showing the section name. Title text color inverts based on pill background luminance. Frame name labels are shown for direct children of sections.++#### Scenario: Section with title+- **WHEN** a section named "Desktop" exists on the canvas+- **THEN** a title pill reading "Desktop" is rendered above the section bounds++#### Scenario: Section title luminance inversion+- **WHEN** a section has a dark fill color+- **THEN** the title text renders in white for readability++### Requirement: Canvas background color+The renderer SHALL fill the canvas background with the current page's `pageColor` property.++#### Scenario: Custom canvas background+- **WHEN** the user sets the page background color to dark gray+- **THEN** the canvas renders with a dark gray background instead of the defaultdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/desktop-app/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/desktop-app/spec.mdnew file mode 100644index 000000000..759bc4b46--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/desktop-app/spec.md@@ -0,0 +1,19 @@+## ADDED Requirements++### Requirement: Tauri native Save/Open dialogs+The desktop app SHALL use Tauri plugin-dialog and plugin-fs for native file dialogs and filesystem access. Open dialog filters for .fig files. Save dialog defaults to "Untitled.fig".++#### Scenario: Open file via native dialog+- **WHEN** user presses ⌘O in the desktop app+- **THEN** the native OS file picker opens and the selected .fig file is imported++#### Scenario: Save As via native dialog+- **WHEN** user selects File → Save As+- **THEN** a native OS save dialog opens and the file is written to the chosen path++### Requirement: Zstd compression via Rust command+The Tauri backend SHALL expose a Rust command for Zstd compression/decompression, used by .fig export for better performance than JavaScript alternatives.++#### Scenario: Zstd compress via IPC+- **WHEN** the frontend requests Zstd compression of a buffer+- **THEN** the Rust backend compresses it and returns the result via Tauri IPCdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/editor-ui/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/editor-ui/spec.mdnew file mode 100644index 000000000..ed2d4ffab--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/editor-ui/spec.md@@ -0,0 +1,61 @@+## ADDED Requirements++### Requirement: Pages panel+The editor SHALL display a PagesPanel component showing all pages in the document. Users can switch pages, add pages, delete pages, and rename pages inline (blur commits, Enter/Escape just blur).++#### Scenario: Switch page+- **WHEN** user clicks a page tab in the pages panel+- **THEN** the canvas switches to that page and viewport state is restored++#### Scenario: Add page+- **WHEN** user clicks the add page button+- **THEN** a new page is created and becomes active++#### Scenario: Inline page rename+- **WHEN** user double-clicks a page name+- **THEN** an inline text input appears, blur commits the rename++### Requirement: Section tool+The toolbar SHALL include a Section tool (shortcut <kbd>S</kbd>) in the Frame flyout. Drawing on canvas creates a SECTION node.++#### Scenario: Section tool activation+- **WHEN** user presses S+- **THEN** the section tool activates and the toolbar shows Section as selected++### Requirement: Fill type picker with gradient and image support+The fill section in the properties panel SHALL provide a type picker with tabs: Solid, Gradient (Linear, Radial, Angular, Diamond), and Image. Gradient fills show editable gradient stops. Image fills show image selection.++#### Scenario: Switch fill to linear gradient+- **WHEN** user selects "Linear Gradient" from the fill type picker+- **THEN** the selected node's fill changes to GRADIENT_LINEAR with default stops and the gradient stop editor appears++#### Scenario: Edit gradient stop+- **WHEN** user drags a gradient stop to position 50%+- **THEN** the stop position updates and the node re-renders with the adjusted gradient++### Requirement: Page background color+The properties panel SHALL show a page section with canvas background color picker when no nodes are selected.++#### Scenario: Change canvas background+- **WHEN** user selects no nodes and changes the page color+- **THEN** the canvas background updates to the chosen color++### Requirement: Hover highlight in canvas+The editor SHALL highlight nodes on hover with a shape-aware outline (follows actual geometry, not just bounding box).++#### Scenario: Hover feedback+- **WHEN** user moves cursor over a node without clicking+- **THEN** a highlight outline appears around the node shape++## MODIFIED Requirements++### Requirement: Bottom toolbar+The toolbar SHALL be positioned at the bottom of the screen (Figma UI3 style) with tool selection: Select (V), Frame (F), Section (S, in Frame flyout), Rectangle (R), Ellipse (O), Line (L), Text (T), Hand (H), Pen (P).++#### Scenario: Tool selection via keyboard+- **WHEN** user presses R+- **THEN** the rectangle tool is activated and the toolbar shows R as selected++#### Scenario: Frame flyout includes Section+- **WHEN** user opens the Frame tool flyout+- **THEN** both Frame and Section tools are availablediff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/fig-import/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/fig-import/spec.mdnew file mode 100644index 000000000..562e1b09d--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/fig-import/spec.md@@ -0,0 +1,55 @@+## ADDED Requirements++### Requirement: .fig file export+The editor SHALL export documents as .fig files. The pipeline: scene graph → Kiwi encode NodeChange[] → compress → write ZIP with fig-kiwi header, schema, message, and thumbnail.++#### Scenario: Save As .fig+- **WHEN** user selects File → Save As+- **THEN** a save dialog appears and the document is written as a valid .fig file++#### Scenario: Save existing file+- **WHEN** user selects File → Save (⌘S) with a previously opened file+- **THEN** the file is overwritten in place without a dialog++### Requirement: Thumbnail generation for .fig export+Exported .fig files SHALL include a thumbnail.png in the ZIP archive, as required by Figma for file preview.++#### Scenario: Thumbnail in exported file+- **WHEN** a .fig file is exported+- **THEN** the ZIP archive contains a thumbnail.png++### Requirement: Zstd compression via Tauri Rust+On the desktop app, .fig export SHALL use Zstd compression via a Tauri Rust command for performance. In the browser, deflate fallback via fflate SHALL be used.++#### Scenario: Desktop export uses Zstd+- **WHEN** a .fig file is exported in the Tauri desktop app+- **THEN** the payload is compressed with Zstd via the Rust backend++#### Scenario: Browser export uses deflate+- **WHEN** a .fig file is exported in the browser+- **THEN** the payload is compressed with deflate as a fallback++### Requirement: Tauri native file dialogs+File Open and Save dialogs SHALL use Tauri's plugin-dialog for native OS dialogs on the desktop app. Save filters for .fig files.++#### Scenario: Native open dialog+- **WHEN** user presses ⌘O in the desktop app+- **THEN** the native OS file picker opens filtered for .fig files++#### Scenario: Native save dialog+- **WHEN** user selects Save As in the desktop app+- **THEN** the native OS save dialog opens with default filename "Untitled.fig"++### Requirement: Tier 1 rendering parity for import+The .fig import pipeline SHALL correctly import and render gradient fills, image fills, effects (shadows, blurs), stroke properties (cap, join, dash), and arc data.++#### Scenario: Import file with gradients+- **WHEN** a .fig file containing nodes with gradient fills is imported+- **THEN** all gradient types (linear, radial, angular, diamond) render correctly with their stops and transforms++### Requirement: .fig import/export round-trip+A .fig file imported and then exported SHALL produce a file that Figma can open with the same visual result.++#### Scenario: Round-trip fidelity+- **WHEN** a .fig file is imported into OpenPencil and re-exported+- **THEN** the exported file opens in Figma with matching visual outputdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/kiwi-codec/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/kiwi-codec/spec.mdnew file mode 100644index 000000000..87016aeca--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/kiwi-codec/spec.md@@ -0,0 +1,15 @@+## ADDED Requirements++### Requirement: Kiwi encoding for .fig export+The Kiwi codec SHALL support encoding NodeChange[] back to Kiwi binary format for .fig export. The encoding path mirrors the decoding path: scene graph → NodeChange[] → Kiwi encode → compress → ZIP with header.++#### Scenario: Encode scene graph to Kiwi binary+- **WHEN** the editor exports a document+- **THEN** all nodes are encoded as NodeChange messages using the Kiwi schema and the binary output is a valid fig-kiwi payload++### Requirement: .fig ZIP built in Rust+On the desktop app, the .fig ZIP archive SHALL be assembled in Rust instead of JavaScript (fflate) for better performance and correct Zstd framing (content size in header).++#### Scenario: Rust ZIP assembly+- **WHEN** a .fig file is exported on the desktop app+- **THEN** the ZIP is assembled by the Rust backend with correct Zstd frame headersdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/scene-graph/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/scene-graph/spec.mdnew file mode 100644index 000000000..83f54c9de--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/scene-graph/spec.md@@ -0,0 +1,66 @@+## ADDED Requirements++### Requirement: Multi-page document support+The scene graph SHALL support multiple CANVAS (page) nodes as children of the DOCUMENT root. Each page has its own child tree. Pages can be added, deleted, and renamed.++#### Scenario: Add a new page+- **WHEN** user adds a page+- **THEN** a new CANVAS node is created as a child of the DOCUMENT root and becomes the active page++#### Scenario: Delete a page+- **WHEN** user deletes a page and at least two pages exist+- **THEN** the page is removed and the adjacent page becomes active++#### Scenario: Rename a page+- **WHEN** user renames a page+- **THEN** the CANVAS node's name property updates++### Requirement: Section node type+The scene graph SHALL support SECTION nodes. Sections are top-level only (direct children of CANVAS), cannot nest inside frames or groups. Sections auto-adopt overlapping siblings on creation.++#### Scenario: Create section+- **WHEN** user draws a section on the canvas+- **THEN** a SECTION node is created as a direct child of the current page++#### Scenario: Section auto-adopt+- **WHEN** a section is created overlapping existing nodes+- **THEN** overlapping sibling nodes are reparented into the section++#### Scenario: Section nesting restriction+- **WHEN** user attempts to move a section inside a frame or group+- **THEN** the section remains at top-level (direct child of CANVAS)++### Requirement: Extended node type union+The NodeType union SHALL include: CANVAS, FRAME, RECTANGLE, ROUNDED_RECTANGLE, ELLIPSE, TEXT, LINE, STAR, POLYGON, VECTOR, GROUP, SECTION, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT.++#### Scenario: NodeType covers all Figma types used in import+- **WHEN** a .fig file containing ROUNDED_RECTANGLE, COMPONENT, INSTANCE, CONNECTOR, or SHAPE_WITH_TEXT nodes is imported+- **THEN** each node is created with its correct type in the scene graph++### Requirement: Hover state tracking+The scene graph state SHALL track a `hoveredNodeId` for the node currently under the cursor.++#### Scenario: Hover a node+- **WHEN** user moves the cursor over a node+- **THEN** `hoveredNodeId` updates to that node's ID and a render is requested++### Requirement: Extended fill types+The Fill interface SHALL support types: SOLID, GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, GRADIENT_DIAMOND, IMAGE. Gradient fills include `gradientStops` and `gradientTransform`. Image fills include `imageHash`, `imageScaleMode`, and `imageTransform`.++#### Scenario: Gradient fill on a node+- **WHEN** a node has a GRADIENT_LINEAR fill with two stops+- **THEN** the fill stores both gradient stops with position and color, plus a 2×3 gradient transform++### Requirement: Extended stroke properties+The Stroke interface SHALL support `cap` (NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL), `join` (MITER, BEVEL, ROUND), and `dashPattern` (array of dash/gap lengths).++#### Scenario: Dashed stroke+- **WHEN** a node has a stroke with dashPattern [10, 5]+- **THEN** the stroke renders as a dashed line with 10px dashes and 5px gaps++### Requirement: Per-page viewport state+Each page SHALL maintain independent viewport state (panX, panY, zoom, pageColor). Switching pages restores the viewport.++#### Scenario: Switch page restores viewport+- **WHEN** user switches from Page 1 (zoomed to 200%) to Page 2 and back+- **THEN** Page 1's viewport returns to 200% zoom at the previous pan positiondiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/selection-manipulation/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/selection-manipulation/spec.mdnew file mode 100644index 000000000..30c290275--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/selection-manipulation/spec.md@@ -0,0 +1,8 @@+## ADDED Requirements++### Requirement: Section creation with auto-adopt+Creating a section on the canvas SHALL automatically reparent overlapping sibling nodes into the section. Only nodes fully or partially within the section bounds are adopted.++#### Scenario: Draw section over existing nodes+- **WHEN** user draws a section that overlaps two rectangles+- **THEN** the two rectangles become children of the new sectiondiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/testing/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/testing/spec.mdnew file mode 100644index 000000000..3ee8e2ffd--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/testing/spec.md@@ -0,0 +1,22 @@+## ADDED Requirements++### Requirement: Fig-import unit tests+Unit tests SHALL verify the .fig import pipeline: node type mapping, transform extraction, fill/stroke/effect import, gradient stops, image fills, arc data, stroke properties, and nested frame hierarchies.++#### Scenario: Run fig-import tests+- **WHEN** `bun test ./tests/engine/fig-import.test.ts` is executed+- **THEN** all import pipeline tests pass covering tier 1 rendering features++### Requirement: Layout unit tests+Unit tests SHALL verify Yoga auto-layout computation: direction, gap, padding, justify, align, child sizing (fixed/fill/hug), cross-axis sizing, wrap, and nested layouts.++#### Scenario: Run layout tests+- **WHEN** `bun test ./tests/engine/layout.test.ts` is executed+- **THEN** all layout computation tests pass++### Requirement: Layers panel E2E tests+E2E tests SHALL verify the layers panel: node visibility in tree, expand/collapse frames, selection sync between canvas and layers panel.++#### Scenario: Run layers panel E2E+- **WHEN** the layers panel E2E tests run+- **THEN** all tests pass verifying tree structure, visibility toggles, and selection syncdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/vitepress-docs/spec.mdnew file mode 100644index 000000000..e9fe7379e--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/vitepress-docs/spec.md@@ -0,0 +1,50 @@+## ADDED Requirements++### Requirement: Docs reflect sections feature+The features page SHALL document sections: SECTION node type, title pills, auto-adopt siblings, top-level-only constraint.++#### Scenario: Sections described in features+- **WHEN** user reads the features page+- **THEN** sections are documented with their behavior++### Requirement: Docs reflect multi-page support+The features page SHALL document multi-page documents: add/delete/rename pages, per-page viewport, pages panel.++#### Scenario: Pages described in features+- **WHEN** user reads the features page+- **THEN** multi-page support is documented++### Requirement: Docs reflect .fig export+The file-format page SHALL document .fig export: Save/Save As, Kiwi encoding, Zstd compression, thumbnail generation. The features page SHALL list .fig export as a capability.++#### Scenario: Export documented in file-format+- **WHEN** user reads the file-format reference+- **THEN** the export pipeline and supported formats table shows .fig export ✅++### Requirement: Docs reflect advanced rendering+The features page SHALL document tier 1 rendering: gradients, image fills, effects (shadows, blurs), stroke properties (cap, join, dash), arcs.++#### Scenario: Rendering features documented+- **WHEN** user reads the features page+- **THEN** gradient fills, image fills, effects, and stroke properties are described++### Requirement: Docs reflect updated keyboard shortcuts+The keyboard shortcuts page SHALL mark Section tool (S) as implemented (✅) and add Save (⌘S) and Save As (⇧⌘S) as implemented.++#### Scenario: New shortcuts marked+- **WHEN** user reads the keyboard shortcuts page+- **THEN** S (Section), ⌘S (Save), ⇧⌘S (Save As) show ✅ status++### Requirement: Docs reflect updated node types+The node-types reference SHALL list the current 17 types in the NodeType union used by the scene graph.++#### Scenario: Node types are current+- **WHEN** user reads the node types page+- **THEN** CANVAS, ROUNDED_RECTANGLE, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT are all listed++### Requirement: Roadmap reflects current progress+The roadmap page SHALL reflect that .fig export, sections, pages, hover highlight, and advanced rendering are now delivered.++#### Scenario: Roadmap is current+- **WHEN** user reads the roadmap page+- **THEN** Phase 3 lists .fig export and sections and pages as delivereddiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/tasks.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/tasks.mdnew file mode 100644index 000000000..4575eb159--- /dev/null+++ b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/tasks.md@@ -0,0 +1,29 @@+## 1. Update VitePress docs — Features page++- [x] 1.1 Add Sections feature to features.md (SECTION node, title pills, auto-adopt, top-level-only)+- [x] 1.2 Add Multi-page support to features.md (pages panel, add/delete/rename, per-page viewport)+- [x] 1.3 Add .fig Export to features.md (Save/Save As, Kiwi encode, Zstd, thumbnail)+- [x] 1.4 Add Hover Highlight to features.md (shape-aware outlines)+- [x] 1.5 Update existing features with advanced rendering (gradients, image fills, effects, stroke cap/join/dash, arcs)++## 2. Update VitePress docs — Reference pages++- [x] 2.1 Update node-types.md: change NodeType union to 17 types, update type table to match actual scene graph+- [x] 2.2 Update file-format.md: add .fig export section, update formats table (.fig export ✅)+- [x] 2.3 Update keyboard-shortcuts.md: mark S (Section) ✅, add ⌘S (Save) ✅ and ⇧⌘S (Save As) ✅ to File section+- [x] 2.4 Update scene-graph.md: add pages, sections, hover state, extended fill/stroke types++## 3. Update VitePress docs — Other pages++- [x] 3.1 Update architecture.md: add .fig export to file format layer, remove .openpencil reference, add pages panel to navigation+- [x] 3.2 Update roadmap.md: move sections, pages, hover, .fig export, advanced rendering to delivered+- [x] 3.3 Update testing.md: add fig-import unit tests, layout unit tests, layers-panel E2E tests++## 4. Update landing page++- [x] 4.1 Update index.md hero features to reflect new capabilities (sections, pages, .fig export, advanced rendering)++## 5. Verify++- [x] 5.1 Run docs:build and verify no broken links or build errors+- [x] 5.2 Validate task completion — all docs pages reflect current implementation statediff --git a/openspec/specs/canvas-rendering/spec.md b/openspec/specs/canvas-rendering/spec.mdindex 5e3af4430..e48e767e3 100644--- a/openspec/specs/canvas-rendering/spec.md+++ b/openspec/specs/canvas-rendering/spec.md@@ -52,3 +52,63 @@ The renderer SHALL detect and report rendering errors instead of silently failin- **WHEN** a rendering operation encounters an error- **THEN** the error is detected and reported rather than silently producing a blank canvas+### Requirement: Gradient rendering+The renderer SHALL draw gradient fills: GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, and GRADIENT_DIAMOND using CanvasKit shaders with gradient stops and transform matrices.++#### Scenario: Linear gradient on rectangle+- **WHEN** a rectangle has a GRADIENT_LINEAR fill with stops at 0% (#FF0000) and 100% (#0000FF)+- **THEN** the rectangle renders with a smooth red-to-blue linear gradient++### Requirement: Image fill rendering+The renderer SHALL draw IMAGE fills using CanvasKit image decoding. Image transforms (scale, position) and scale modes (FILL, FIT, CROP, TILE) SHALL be applied.++#### Scenario: Image fill on frame+- **WHEN** a frame has an IMAGE fill with imageHash referencing a blob+- **THEN** the image is decoded and rendered within the frame bounds++### Requirement: Effect rendering+The renderer SHALL draw effects: DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR, and FOREGROUND_BLUR using CanvasKit filters.++#### Scenario: Drop shadow on rectangle+- **WHEN** a rectangle has a DROP_SHADOW effect with offset (4, 4), radius 8, color rgba(0,0,0,0.25)+- **THEN** a shadow is rendered below the rectangle with the specified offset, blur, and color++### Requirement: Stroke cap, join, and dash rendering+The renderer SHALL apply stroke cap (NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL), join (MITER, BEVEL, ROUND), and dash pattern to strokes.++#### Scenario: Round cap dashed stroke+- **WHEN** a line has strokeCap ROUND and dashPattern [10, 5]+- **THEN** the line renders with rounded dash ends and 10px-on/5px-off pattern++### Requirement: Arc rendering+The renderer SHALL draw ellipses with arcData (startAngle, endAngle, innerRadius) as partial arcs or donuts.++#### Scenario: Semi-circle arc+- **WHEN** an ellipse has arcData with startAngle 0 and endAngle π+- **THEN** only the top half of the ellipse is rendered++### Requirement: Hover highlight rendering+The renderer SHALL draw a shape-aware hover outline for the node under the cursor. The outline follows the actual shape geometry (ellipses, rounded rects, vectors), not just the bounding box.++#### Scenario: Hover over ellipse+- **WHEN** the cursor hovers over an ellipse+- **THEN** a thin outline matching the ellipse shape is drawn++### Requirement: Section rendering+The renderer SHALL draw SECTION nodes with a title pill showing the section name. Title text color inverts based on pill background luminance. Frame name labels are shown for direct children of sections.++#### Scenario: Section with title+- **WHEN** a section named "Desktop" exists on the canvas+- **THEN** a title pill reading "Desktop" is rendered above the section bounds++#### Scenario: Section title luminance inversion+- **WHEN** a section has a dark fill color+- **THEN** the title text renders in white for readability++### Requirement: Canvas background color+The renderer SHALL fill the canvas background with the current page's `pageColor` property.++#### Scenario: Custom canvas background+- **WHEN** the user sets the page background color to dark gray+- **THEN** the canvas renders with a dark gray background instead of the default+diff --git a/openspec/specs/desktop-app/spec.md b/openspec/specs/desktop-app/spec.mdindex af0943585..604d47580 100644--- a/openspec/specs/desktop-app/spec.md+++ b/openspec/specs/desktop-app/spec.md@@ -72,3 +72,21 @@ The README SHALL document platform-specific prerequisites for building the deskt- **WHEN** a developer reads the README on Linux- **THEN** they find instructions for installing required system libraries (webkit2gtk, etc.)+### Requirement: Tauri native Save/Open dialogs+The desktop app SHALL use Tauri plugin-dialog and plugin-fs for native file dialogs and filesystem access. Open dialog filters for .fig files. Save dialog defaults to "Untitled.fig".++#### Scenario: Open file via native dialog+- **WHEN** user presses ⌘O in the desktop app+- **THEN** the native OS file picker opens and the selected .fig file is imported++#### Scenario: Save As via native dialog+- **WHEN** user selects File → Save As+- **THEN** a native OS save dialog opens and the file is written to the chosen path++### Requirement: Zstd compression via Rust command+The Tauri backend SHALL expose a Rust command for Zstd compression/decompression, used by .fig export for better performance than JavaScript alternatives.++#### Scenario: Zstd compress via IPC+- **WHEN** the frontend requests Zstd compression of a buffer+- **THEN** the Rust backend compresses it and returns the result via Tauri IPC+diff --git a/openspec/specs/editor-ui/spec.md b/openspec/specs/editor-ui/spec.mdindex 034be67b8..e4ceefb9a 100644--- a/openspec/specs/editor-ui/spec.md+++ b/openspec/specs/editor-ui/spec.md@@ -11,12 +11,16 @@ The editor UI SHALL be built with Vue 3, VueUse composables, and Reka UI headles- **THEN** the Vue 3 application renders with canvas, toolbar, layers panel, and properties panel### Requirement: Bottom toolbar-The toolbar SHALL be positioned at the bottom of the screen (Figma UI3 style) with tool selection: Select (V), Frame (F), Rectangle (R), Ellipse (O), Line (L), Text (T), Hand (H), Pen (P).+The toolbar SHALL be positioned at the bottom of the screen (Figma UI3 style) with tool selection: Select (V), Frame (F), Section (S, in Frame flyout), Rectangle (R), Ellipse (O), Line (L), Text (T), Hand (H), Pen (P).#### Scenario: Tool selection via keyboard- **WHEN** user presses R- **THEN** the rectangle tool is activated and the toolbar shows R as selected+#### Scenario: Frame flyout includes Section+- **WHEN** user opens the Frame tool flyout+- **THEN** both Frame and Section tools are available+### Requirement: Layers panel with tree viewThe layers panel SHALL display a tree view of the document hierarchy using Reka UI Tree with expand/collapse and drag reordering.@@ -64,3 +68,50 @@ The editor SHALL use Tailwind CSS 4 for all styling.- **WHEN** the editor renders- **THEN** the UI uses a dark theme styled with Tailwind CSS 4 utility classes+### Requirement: Pages panel+The editor SHALL display a PagesPanel component showing all pages in the document. Users can switch pages, add pages, delete pages, and rename pages inline (blur commits, Enter/Escape just blur).++#### Scenario: Switch page+- **WHEN** user clicks a page tab in the pages panel+- **THEN** the canvas switches to that page and viewport state is restored++#### Scenario: Add page+- **WHEN** user clicks the add page button+- **THEN** a new page is created and becomes active++#### Scenario: Inline page rename+- **WHEN** user double-clicks a page name+- **THEN** an inline text input appears, blur commits the rename++### Requirement: Section tool+The toolbar SHALL include a Section tool (shortcut <kbd>S</kbd>) in the Frame flyout. Drawing on canvas creates a SECTION node.++#### Scenario: Section tool activation+- **WHEN** user presses S+- **THEN** the section tool activates and the toolbar shows Section as selected++### Requirement: Fill type picker with gradient and image support+The fill section in the properties panel SHALL provide a type picker with tabs: Solid, Gradient (Linear, Radial, Angular, Diamond), and Image. Gradient fills show editable gradient stops. Image fills show image selection.++#### Scenario: Switch fill to linear gradient+- **WHEN** user selects "Linear Gradient" from the fill type picker+- **THEN** the selected node's fill changes to GRADIENT_LINEAR with default stops and the gradient stop editor appears++#### Scenario: Edit gradient stop+- **WHEN** user drags a gradient stop to position 50%+- **THEN** the stop position updates and the node re-renders with the adjusted gradient++### Requirement: Page background color+The properties panel SHALL show a page section with canvas background color picker when no nodes are selected.++#### Scenario: Change canvas background+- **WHEN** user selects no nodes and changes the page color+- **THEN** the canvas background updates to the chosen color++### Requirement: Hover highlight in canvas+The editor SHALL highlight nodes on hover with a shape-aware outline (follows actual geometry, not just bounding box).++#### Scenario: Hover feedback+- **WHEN** user moves cursor over a node without clicking+- **THEN** a highlight outline appears around the node shape+diff --git a/openspec/specs/fig-import/spec.md b/openspec/specs/fig-import/spec.mdindex ce697ecc1..8fbfb9ab9 100644--- a/openspec/specs/fig-import/spec.md+++ b/openspec/specs/fig-import/spec.md@@ -24,3 +24,57 @@ The import pipeline SHALL resolve blob references (images, vector networks, font- **WHEN** a .fig file containing vector nodes with vectorNetworkBlob data is imported- **THEN** the vector paths are correctly decoded and renderable+### Requirement: .fig file export+The editor SHALL export documents as .fig files. The pipeline: scene graph → Kiwi encode NodeChange[] → compress → write ZIP with fig-kiwi header, schema, message, and thumbnail.++#### Scenario: Save As .fig+- **WHEN** user selects File → Save As+- **THEN** a save dialog appears and the document is written as a valid .fig file++#### Scenario: Save existing file+- **WHEN** user selects File → Save (⌘S) with a previously opened file+- **THEN** the file is overwritten in place without a dialog++### Requirement: Thumbnail generation for .fig export+Exported .fig files SHALL include a thumbnail.png in the ZIP archive, as required by Figma for file preview.++#### Scenario: Thumbnail in exported file+- **WHEN** a .fig file is exported+- **THEN** the ZIP archive contains a thumbnail.png++### Requirement: Zstd compression via Tauri Rust+On the desktop app, .fig export SHALL use Zstd compression via a Tauri Rust command for performance. In the browser, deflate fallback via fflate SHALL be used.++#### Scenario: Desktop export uses Zstd+- **WHEN** a .fig file is exported in the Tauri desktop app+- **THEN** the payload is compressed with Zstd via the Rust backend++#### Scenario: Browser export uses deflate+- **WHEN** a .fig file is exported in the browser+- **THEN** the payload is compressed with deflate as a fallback++### Requirement: Tauri native file dialogs+File Open and Save dialogs SHALL use Tauri's plugin-dialog for native OS dialogs on the desktop app. Save filters for .fig files.++#### Scenario: Native open dialog+- **WHEN** user presses ⌘O in the desktop app+- **THEN** the native OS file picker opens filtered for .fig files++#### Scenario: Native save dialog+- **WHEN** user selects Save As in the desktop app+- **THEN** the native OS save dialog opens with default filename "Untitled.fig"++### Requirement: Tier 1 rendering parity for import+The .fig import pipeline SHALL correctly import and render gradient fills, image fills, effects (shadows, blurs), stroke properties (cap, join, dash), and arc data.++#### Scenario: Import file with gradients+- **WHEN** a .fig file containing nodes with gradient fills is imported+- **THEN** all gradient types (linear, radial, angular, diamond) render correctly with their stops and transforms++### Requirement: .fig import/export round-trip+A .fig file imported and then exported SHALL produce a file that Figma can open with the same visual result.++#### Scenario: Round-trip fidelity+- **WHEN** a .fig file is imported into OpenPencil and re-exported+- **THEN** the exported file opens in Figma with matching visual output+diff --git a/openspec/specs/kiwi-codec/spec.md b/openspec/specs/kiwi-codec/spec.mdindex f84afb5fe..052aa70d5 100644--- a/openspec/specs/kiwi-codec/spec.md+++ b/openspec/specs/kiwi-codec/spec.md@@ -35,3 +35,17 @@ The codec layer SHALL support Zstd decompression for .fig file payloads and comp- **WHEN** a Zstd-compressed Kiwi payload is encountered in a .fig file- **THEN** it is decompressed before Kiwi decoding+### Requirement: Kiwi encoding for .fig export+The Kiwi codec SHALL support encoding NodeChange[] back to Kiwi binary format for .fig export. The encoding path mirrors the decoding path: scene graph → NodeChange[] → Kiwi encode → compress → ZIP with header.++#### Scenario: Encode scene graph to Kiwi binary+- **WHEN** the editor exports a document+- **THEN** all nodes are encoded as NodeChange messages using the Kiwi schema and the binary output is a valid fig-kiwi payload++### Requirement: .fig ZIP built in Rust+On the desktop app, the .fig ZIP archive SHALL be assembled in Rust instead of JavaScript (fflate) for better performance and correct Zstd framing (content size in header).++#### Scenario: Rust ZIP assembly+- **WHEN** a .fig file is exported on the desktop app+- **THEN** the ZIP is assembled by the Rust backend with correct Zstd frame headers+diff --git a/openspec/specs/scene-graph/spec.md b/openspec/specs/scene-graph/spec.mdindex 65ff0da09..d74bff371 100644--- a/openspec/specs/scene-graph/spec.md+++ b/openspec/specs/scene-graph/spec.md@@ -53,3 +53,68 @@ The scene graph SHALL have bun:test unit tests covering CRUD, parent-child, z-or- **WHEN** `bun test ./tests/engine` is run- **THEN** all scene graph unit tests pass in <50ms+### Requirement: Multi-page document support+The scene graph SHALL support multiple CANVAS (page) nodes as children of the DOCUMENT root. Each page has its own child tree. Pages can be added, deleted, and renamed.++#### Scenario: Add a new page+- **WHEN** user adds a page+- **THEN** a new CANVAS node is created as a child of the DOCUMENT root and becomes the active page++#### Scenario: Delete a page+- **WHEN** user deletes a page and at least two pages exist+- **THEN** the page is removed and the adjacent page becomes active++#### Scenario: Rename a page+- **WHEN** user renames a page+- **THEN** the CANVAS node's name property updates++### Requirement: Section node type+The scene graph SHALL support SECTION nodes. Sections are top-level only (direct children of CANVAS), cannot nest inside frames or groups. Sections auto-adopt overlapping siblings on creation.++#### Scenario: Create section+- **WHEN** user draws a section on the canvas+- **THEN** a SECTION node is created as a direct child of the current page++#### Scenario: Section auto-adopt+- **WHEN** a section is created overlapping existing nodes+- **THEN** overlapping sibling nodes are reparented into the section++#### Scenario: Section nesting restriction+- **WHEN** user attempts to move a section inside a frame or group+- **THEN** the section remains at top-level (direct child of CANVAS)++### Requirement: Extended node type union+The NodeType union SHALL include: CANVAS, FRAME, RECTANGLE, ROUNDED_RECTANGLE, ELLIPSE, TEXT, LINE, STAR, POLYGON, VECTOR, GROUP, SECTION, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT.++#### Scenario: NodeType covers all Figma types used in import+- **WHEN** a .fig file containing ROUNDED_RECTANGLE, COMPONENT, INSTANCE, CONNECTOR, or SHAPE_WITH_TEXT nodes is imported+- **THEN** each node is created with its correct type in the scene graph++### Requirement: Hover state tracking+The scene graph state SHALL track a `hoveredNodeId` for the node currently under the cursor.++#### Scenario: Hover a node+- **WHEN** user moves the cursor over a node+- **THEN** `hoveredNodeId` updates to that node's ID and a render is requested++### Requirement: Extended fill types+The Fill interface SHALL support types: SOLID, GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, GRADIENT_DIAMOND, IMAGE. Gradient fills include `gradientStops` and `gradientTransform`. Image fills include `imageHash`, `imageScaleMode`, and `imageTransform`.++#### Scenario: Gradient fill on a node+- **WHEN** a node has a GRADIENT_LINEAR fill with two stops+- **THEN** the fill stores both gradient stops with position and color, plus a 2×3 gradient transform++### Requirement: Extended stroke properties+The Stroke interface SHALL support `cap` (NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL), `join` (MITER, BEVEL, ROUND), and `dashPattern` (array of dash/gap lengths).++#### Scenario: Dashed stroke+- **WHEN** a node has a stroke with dashPattern [10, 5]+- **THEN** the stroke renders as a dashed line with 10px dashes and 5px gaps++### Requirement: Per-page viewport state+Each page SHALL maintain independent viewport state (panX, panY, zoom, pageColor). Switching pages restores the viewport.++#### Scenario: Switch page restores viewport+- **WHEN** user switches from Page 1 (zoomed to 200%) to Page 2 and back+- **THEN** Page 1's viewport returns to 200% zoom at the previous pan position+diff --git a/openspec/specs/selection-manipulation/spec.md b/openspec/specs/selection-manipulation/spec.mdindex eb621ce15..f3541d91e 100644--- a/openspec/specs/selection-manipulation/spec.md+++ b/openspec/specs/selection-manipulation/spec.md@@ -80,3 +80,10 @@ Backspace/Delete SHALL remove all selected nodes.- **WHEN** user presses ⌘A- **THEN** all nodes on the canvas are selected+### Requirement: Section creation with auto-adopt+Creating a section on the canvas SHALL automatically reparent overlapping sibling nodes into the section. Only nodes fully or partially within the section bounds are adopted.++#### Scenario: Draw section over existing nodes+- **WHEN** user draws a section that overlaps two rectangles+- **THEN** the two rectangles become children of the new section+diff --git a/openspec/specs/testing/spec.md b/openspec/specs/testing/spec.mdindex 9d6a291f7..4e7aeba9c 100644--- a/openspec/specs/testing/spec.md+++ b/openspec/specs/testing/spec.md@@ -45,3 +45,24 @@ Engine unit tests SHALL use bun:test and complete in <50ms.- **WHEN** `bun test ./tests/engine` is run- **THEN** all unit tests pass in under 50ms+### Requirement: Fig-import unit tests+Unit tests SHALL verify the .fig import pipeline: node type mapping, transform extraction, fill/stroke/effect import, gradient stops, image fills, arc data, stroke properties, and nested frame hierarchies.++#### Scenario: Run fig-import tests+- **WHEN** `bun test ./tests/engine/fig-import.test.ts` is executed+- **THEN** all import pipeline tests pass covering tier 1 rendering features++### Requirement: Layout unit tests+Unit tests SHALL verify Yoga auto-layout computation: direction, gap, padding, justify, align, child sizing (fixed/fill/hug), cross-axis sizing, wrap, and nested layouts.++#### Scenario: Run layout tests+- **WHEN** `bun test ./tests/engine/layout.test.ts` is executed+- **THEN** all layout computation tests pass++### Requirement: Layers panel E2E tests+E2E tests SHALL verify the layers panel: node visibility in tree, expand/collapse frames, selection sync between canvas and layers panel.++#### Scenario: Run layers panel E2E+- **WHEN** the layers panel E2E tests run+- **THEN** all tests pass verifying tree structure, visibility toggles, and selection sync+diff --git a/openspec/specs/vitepress-docs/spec.md b/openspec/specs/vitepress-docs/spec.mdindex 8c14ab944..b6fbadbd4 100644--- a/openspec/specs/vitepress-docs/spec.md+++ b/openspec/specs/vitepress-docs/spec.md@@ -71,3 +71,52 @@ The docs site SHALL use dark appearance to match the editor's dark aesthetic.- **WHEN** `bun run docs:build` creates output in `docs/.vitepress/dist/`- **THEN** the output directory is not tracked by git+### Requirement: Docs reflect sections feature+The features page SHALL document sections: SECTION node type, title pills, auto-adopt siblings, top-level-only constraint.++#### Scenario: Sections described in features+- **WHEN** user reads the features page+- **THEN** sections are documented with their behavior++### Requirement: Docs reflect multi-page support+The features page SHALL document multi-page documents: add/delete/rename pages, per-page viewport, pages panel.++#### Scenario: Pages described in features+- **WHEN** user reads the features page+- **THEN** multi-page support is documented++### Requirement: Docs reflect .fig export+The file-format page SHALL document .fig export: Save/Save As, Kiwi encoding, Zstd compression, thumbnail generation. The features page SHALL list .fig export as a capability.++#### Scenario: Export documented in file-format+- **WHEN** user reads the file-format reference+- **THEN** the export pipeline and supported formats table shows .fig export ✅++### Requirement: Docs reflect advanced rendering+The features page SHALL document tier 1 rendering: gradients, image fills, effects (shadows, blurs), stroke properties (cap, join, dash), arcs.++#### Scenario: Rendering features documented+- **WHEN** user reads the features page+- **THEN** gradient fills, image fills, effects, and stroke properties are described++### Requirement: Docs reflect updated keyboard shortcuts+The keyboard shortcuts page SHALL mark Section tool (S) as implemented (✅) and add Save (⌘S) and Save As (⇧⌘S) as implemented.++#### Scenario: New shortcuts marked+- **WHEN** user reads the keyboard shortcuts page+- **THEN** S (Section), ⌘S (Save), ⇧⌘S (Save As) show ✅ status++### Requirement: Docs reflect updated node types+The node-types reference SHALL list the current 17 types in the NodeType union used by the scene graph.++#### Scenario: Node types are current+- **WHEN** user reads the node types page+- **THEN** CANVAS, ROUNDED_RECTANGLE, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT are all listed++### Requirement: Roadmap reflects current progress+The roadmap page SHALL reflect that .fig export, sections, pages, hover highlight, and advanced rendering are now delivered.++#### Scenario: Roadmap is current+- **WHEN** user reads the roadmap page+- **THEN** Phase 3 lists .fig export and sections and pages as delivered+