AI-native design editor. Open-source Figma alternative.
Sync specs and docs with master: live sync, effects panel, independent corners, CI
Anton A Sc03f605a221d
diff --git a/docs/development/roadmap.md b/docs/development/roadmap.mdindex 03d5bb21e..8705846dd 100644--- a/docs/development/roadmap.md+++ b/docs/development/roadmap.md@@ -59,7 +59,8 @@ Components, instances, overrides, variants, variables, collections, modes/themes**Delivered:**- Component creation from frame/group or multi-selection (⌥⌘K)- Component sets from multiple components (⇧⌘K) with dashed purple border-- Instance creation from components with child cloning+- Instance creation from components with child cloning and componentId mapping+- Live component-instance sync with override preservation- Detach instance back to frame (⌥⌘B)- Go to main component (cross-page navigation)- Always-visible purple component/instance labels with diamond icon@@ -69,9 +70,11 @@ Components, instances, overrides, variants, variables, collections, modes/themes- Toggle visibility (⇧⌘H) and lock (⇧⌘L)- Move nodes between pages via context menu- Viewport culling, Paint reuse, RAF render coalescing+- Effects panel UI (drop shadow, inner shadow, layer/background/foreground blur)+- Independent corner radius controls (per-corner toggle in Appearance section)+- GitHub Actions CI/CD for Windows (x64, arm64) and macOS (x64, arm64) builds**Planned:**-- Override propagation- Variant switching- Variable collections with modes (light/dark)- Variable binding to node properties@@ -93,7 +96,7 @@ Prototyping, comments, desktop distribution, documentation, public launch.**Planned:**- Prototyping (frame connections, transitions)- Comments (pin, threads, resolve)-- Cross-platform Tauri builds (macOS, Windows, Linux)+- Linux Tauri builds (macOS and Windows already covered by CI)- PWA support- Documentation site (VitePress) ← this is being built now- Performance optimization (Lighthouse > 90)diff --git a/docs/guide/features.md b/docs/guide/features.mdindex c4cf49151..373287fc3 100644--- a/docs/guide/features.md+++ b/docs/guide/features.md@@ -53,9 +53,10 @@ 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+- **Appearance** — opacity, corner radius (uniform or per-corner with independent toggle), visibility- **Fill** — solid/gradient/image type picker, gradient stop editor, hex input, opacity- **Stroke** — color, weight, opacity, cap, join, dash pattern+- **Effects** — add/remove effects, type picker (drop shadow, inner shadow, layer blur, background blur, foreground blur), inline expanded controls (offset, blur, spread, color for shadows; blur radius for blurs), per-effect visibility toggle- **Typography** — font family, weight, size, alignment- **Layout** — auto-layout controls when enabled- **Position** — alignment buttons, rotation, flip@@ -92,7 +93,11 @@ The CanvasKit renderer supports full Tier 1 visual features for Figma rendering## Components & Instances-Create reusable components from frames or selections (<kbd>⌥</kbd><kbd>⌘</kbd><kbd>K</kbd>). A single frame converts in-place to a COMPONENT; multiple nodes wrap in a new component. Combine multiple components into a COMPONENT_SET (<kbd>⇧</kbd><kbd>⌘</kbd><kbd>K</kbd>) with a dashed purple border. Create instances from components via context menu — instances copy the component's visual properties and children. Detach an instance back to a frame with <kbd>⌥</kbd><kbd>⌘</kbd><kbd>B</kbd>. "Go to main component" navigates to and selects the source component, switching pages if needed.+Create reusable components from frames or selections (<kbd>⌥</kbd><kbd>⌘</kbd><kbd>K</kbd>). A single frame converts in-place to a COMPONENT; multiple nodes wrap in a new component. Combine multiple components into a COMPONENT_SET (<kbd>⇧</kbd><kbd>⌘</kbd><kbd>K</kbd>) with a dashed purple border. Create instances from components via context menu — instances copy the component's visual properties and deep-clone children with `componentId` mapping. Detach an instance back to a frame with <kbd>⌥</kbd><kbd>⌘</kbd><kbd>B</kbd>. "Go to main component" navigates to and selects the source component, switching pages if needed.++**Live sync:** Editing a main component propagates changes to all its instances automatically. The store triggers sync after property updates, moves, and resizes. Synced properties include size, fills, strokes, effects, opacity, corner radii, layout, and clipsContent. Instance children are matched to component children via `componentId`.++**Override support:** Instances maintain an overrides record. Properties marked as overridden are preserved during sync — if you customize an instance child's text, it won't be overwritten when the component changes. New children added to a component appear in all existing instances.Components and instances display always-visible purple labels with a diamond icon showing the node name. They act as opaque containers for selection — clicking selects the component itself, double-clicking enters it to select children.@@ -120,3 +125,7 @@ Tauri v2 shell (~5MB vs Electron's ~100MB). Native menu bar with File/Edit/View/## ScrubInputAll numeric inputs in the properties panel use a drag-to-scrub interaction — drag horizontally to adjust the value, or click to type directly. Supports suffix display (°, px, %).++## CI/CD Builds++GitHub Actions workflow builds native Tauri desktop apps on version tags. The build matrix covers Windows (x64, arm64) and macOS (x64, arm64). Builds use `tauri-apps/tauri-action` and produce draft GitHub releases with platform-specific binaries.diff --git a/docs/guide/figma-comparison.md b/docs/guide/figma-comparison.mdindex ccabd171e..0c39a2053 100644--- a/docs/guide/figma-comparison.md+++ b/docs/guide/figma-comparison.md@@ -6,7 +6,7 @@ Feature-by-feature comparison of Figma Design capabilities with Open Pencil's cu✅ Supported — feature works end-to-end · 🟡 Partial — core behavior exists, some sub-features missing · 🔲 Not yet implemented:::-**Coverage:** ~50 of ~90 Figma Design feature areas addressed (56%). Last updated: 2026-02-28.+**Coverage:** ~51 of ~90 Figma Design feature areas addressed (57%). Last updated: 2026-02-28.## Interface & Navigation@@ -128,7 +128,7 @@ Feature-by-feature comparison of Figma Design capabilities with Open Pencil's cu| Stroke cap (round, square, arrow) | ✅ | NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL || Stroke join (miter, bevel, round) | ✅ | All three join types || Dash patterns | ✅ | Dash-on/dash-off stroke pattern |-| Corner radius | ✅ | Uniform and per-corner radius |+| Corner radius | ✅ | Uniform and per-corner radius with independent toggle in properties panel || Corner smoothing (iOS-style) | 🔲 | Figma's continuous corner rounding || Multiple fills/strokes per layer | 🔲 | Figma allows stacking fills and strokes |@@ -155,10 +155,10 @@ Feature-by-feature comparison of Figma Design capabilities with Open Pencil's cu|---------|--------|-------|| Create components | 🟡 | ⌥⌘K creates from frame/group or wraps selection; no component properties UI yet || Component sets | 🟡 | ⇧⌘K combines components; dashed purple border; no variant property editing |-| Component instances | 🟡 | Create instance from context menu with child cloning; no override editing UI |+| Component instances | 🟡 | Create instance from context menu with child cloning and componentId mapping; live sync from component; no override editing UI || Variants | 🔲 | Variant switching and property-based selection || Component properties | 🔲 | Boolean, text, instance swap properties |-| Override propagation | 🔲 | Changes to main component do not propagate to instances yet |+| Override propagation | ✅ | Changes to main component propagate to all instances; overrides preserved || Variables (color, number, string, boolean) | 🔲 | Planned for Phase 4 || Variable collections & modes | 🔲 | Light/dark themes via variable modes || Styles (color, text, effect, layout) | 🔲 | Reusable named style presets |diff --git a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/.openspec.yaml b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/.openspec.yamlnew file mode 100644index 000000000..b51d4740b--- /dev/null+++ b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/.openspec.yaml@@ -0,0 +1 @@+type: changediff --git a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/design.md b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/design.mdnew file mode 100644index 000000000..99fbd93a6--- /dev/null+++ b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/design.md@@ -0,0 +1,11 @@+# Design: Sync Master Features into Specs & Docs++Documentation-only change — no source code modifications. Update specs and docs to match already-implemented features from master.++## Delta-Specs++- **components** — live sync, override preservation, child propagation, componentId mapping+- **scene-graph** — syncInstances, synced property list, child clone-with-mapping, independent corners+- **editor-ui** — Effects section, independent corner radius toggle, remove Create Instance button+- **desktop-app** — GitHub Actions CI/CD workflow+- **testing** — component-instance sync unit testsdiff --git a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/proposal.md b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/proposal.mdnew file mode 100644index 000000000..23ac7f9cb--- /dev/null+++ b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/proposal.md@@ -0,0 +1,14 @@+# Proposal: Sync Master Features into Specs & Docs++## Context++10 commits merged from master since last docs/specs sync (68425a0..af3db9f). These introduce significant new features that are not yet reflected in OpenSpec specs, VitePress docs, or the Figma comparison matrix.++## New Features to Document++1. **Live component-instance sync** — editing a main component propagates changes to all instances. Instance children mapped via `componentId`. Override record preserves instance-level customizations.+2. **Independent corner radius controls** — per-corner radius UI in Appearance section with toggle for uniform/independent mode.+3. **Effects section in properties panel** — full effects panel: add/remove effects, type picker, inline controls.+4. **GitHub Actions CI/CD** — build workflow for Windows + macOS.+5. **Mac shortcut fixes** — ⌥⌘K/⌥⌘B/⇧⌘K/⇧⌘H/⇧⌘L.+6. **Instance tests** — unit tests for sync lifecycle.diff --git a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/tasks.md b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/tasks.mdnew file mode 100644index 000000000..88fb5aaa6--- /dev/null+++ b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/tasks.md@@ -0,0 +1,21 @@+# Tasks: Sync Master Features into Specs & Docs++All tasks completed.++## 1. Merge Delta-Specs into Main Specs++- [x] 1.1 Merge components delta-spec — live sync, overrides, child propagation, componentId mapping+- [x] 1.2 Merge scene-graph delta-spec — syncInstances, synced props, clone-with-mapping, independent corners+- [x] 1.3 Merge editor-ui delta-spec — Effects section, independent corners toggle, update sections list+- [x] 1.4 Merge desktop-app delta-spec — GitHub Actions CI/CD workflow+- [x] 1.5 Merge testing delta-spec — component-instance sync unit tests++## 2. Update VitePress Docs++- [x] 2.1 Update features.md — Components sync, Effects section, CI/CD Builds+- [x] 2.2 Update figma-comparison.md — Override propagation ✅, corner radius notes, coverage ~51/90+- [x] 2.3 Update roadmap.md — Phase 4 Delivered + Phase 6 cleanup++## 3. Verify++- [x] 3.1 VitePress docs build passesdiff --git a/openspec/specs/components/spec.md b/openspec/specs/components/spec.mdindex 77db2c12a..4cc7501c9 100644--- a/openspec/specs/components/spec.md+++ b/openspec/specs/components/spec.md@@ -23,12 +23,16 @@ The editor SHALL combine multiple selected COMPONENT nodes into a COMPONENT_SET- **THEN** a COMPONENT_SET wraps them with dashed purple border### Requirement: Create instance from component-The editor SHALL create an INSTANCE node from a COMPONENT, copying its visual properties and children. The instance is placed 40px to the right of the source component.+The editor SHALL create an INSTANCE node from a COMPONENT via context menu, copying its visual properties and deep-cloning children with `componentId` mapping. The instance is placed 40px to the right of the source component. Instance creation is available only through the context menu (no button in properties panel).#### Scenario: Create instance via context menu- **WHEN** user right-clicks a component and selects "Create instance"- **THEN** an INSTANCE appears to the right, visually identical to the component+#### Scenario: Instance children have componentId mapping+- **WHEN** an instance is created from a component with children [A, B]+- **THEN** instance children have `componentId` pointing to A and B respectively+### Requirement: Detach instanceThe editor SHALL convert an INSTANCE back to a regular FRAME, clearing its componentId and overrides (⌥⌘B).@@ -67,3 +71,35 @@ COMPONENT and INSTANCE nodes SHALL behave as opaque containers for hit testing#### Scenario: Double-click into component- **WHEN** user double-clicks a child inside a component- **THEN** the child is selected (deep selection)++### Requirement: Live component-instance sync+The scene graph SHALL propagate property changes from a COMPONENT to all its INSTANCE nodes. Synced properties include: width, height, fills, strokes, effects, opacity, corner radii, layout properties, and clipsContent. The store SHALL auto-trigger sync after `updateNode`, `commitMove`, and `commitResize` when the edited node is inside a COMPONENT.++#### Scenario: Edit component updates instances+- **WHEN** user changes the fill color of a main component+- **THEN** all instances of that component update to the new fill color++#### Scenario: Resize component syncs to instances+- **WHEN** user resizes a main component+- **THEN** all instances resize to match++### Requirement: Override preservation during sync+Instances SHALL maintain an `overrides` record. When syncing, properties marked in overrides are skipped. Child-level overrides use `${childId}:${propertyKey}` keys. Overridable child properties include name, text, fontSize, fontWeight, fontFamily, plus all synced visual/layout properties.++#### Scenario: Override preserved during sync+- **WHEN** an instance child has text overridden to "Custom" and the component child text changes to "New Default"+- **THEN** the instance child's text remains "Custom" while non-overridden properties sync++### Requirement: New children propagate to instances+When a new child is added to a COMPONENT, sync SHALL clone the new child into all existing instances.++#### Scenario: Add child to component+- **WHEN** user adds a new rectangle inside a component that has two instances+- **THEN** both instances gain a cloned copy of the new rectangle++### Requirement: Instance child order matches component+After sync, instance children SHALL be reordered to match the component's child order.++#### Scenario: Reorder component children+- **WHEN** component children are reordered from [A, B] to [B, A]+- **THEN** after sync, instance children reflect the new orderdiff --git a/openspec/specs/desktop-app/spec.md b/openspec/specs/desktop-app/spec.mdindex 604d47580..a0d3b229e 100644--- a/openspec/specs/desktop-app/spec.md+++ b/openspec/specs/desktop-app/spec.md@@ -90,3 +90,18 @@ The Tauri backend SHALL expose a Rust command for Zstd compression/decompression- **WHEN** the frontend requests Zstd compression of a buffer- **THEN** the Rust backend compresses it and returns the result via Tauri IPC+### Requirement: GitHub Actions CI/CD build workflow+The project SHALL include a GitHub Actions workflow (`.github/workflows/build.yml`) that builds Tauri desktop apps for Windows (x64, arm64) and macOS (x64, arm64). The workflow triggers on version tags (`v*`) and `workflow_dispatch`. Build artifacts are uploaded as draft GitHub releases via `tauri-apps/tauri-action`.++#### Scenario: Tag-triggered build+- **WHEN** a tag matching `v*` is pushed+- **THEN** GitHub Actions builds Windows and macOS binaries and creates a draft release++#### Scenario: Manual build trigger+- **WHEN** a maintainer triggers `workflow_dispatch`+- **THEN** the build runs for all platform/architecture combinations++#### Scenario: Build matrix+- **WHEN** the workflow runs+- **THEN** it builds for: windows-x64 (x86_64-pc-windows-msvc), windows-arm64 (aarch64-pc-windows-msvc), macos-arm64 (aarch64-apple-darwin), macos-x64 (x86_64-apple-darwin)+diff --git a/openspec/specs/editor-ui/spec.md b/openspec/specs/editor-ui/spec.mdindex 7ccfbb87b..6b4dfb6e1 100644--- a/openspec/specs/editor-ui/spec.md+++ b/openspec/specs/editor-ui/spec.md@@ -37,7 +37,7 @@ The layers panel SHALL display a tree view of the document hierarchy using Reka- **THEN** the node is hidden/shown on canvas### Requirement: Properties panel with sections-The properties panel SHALL be split into sections: Appearance (size, position, rotation, opacity, corner radius, visibility), Fill, Stroke, Typography, Layout, Position.+The properties panel SHALL be split into sections: Appearance (opacity, corner radius with independent mode, visibility toggle), Fill, Stroke, Effects, Typography, Layout, Position.#### Scenario: Properties panel shows fill section- **WHEN** user selects a rectangle with a blue fill@@ -136,3 +136,37 @@ The editor SHALL support ⇧⌘H (toggle visibility) and ⇧⌘L (toggle lock) k#### Scenario: Toggle visibility shortcut- **WHEN** user selects a node and presses ⇧⌘H- **THEN** the node's visibility toggles++### Requirement: Effects section in properties panel+The properties panel SHALL include an Effects section showing all effects on the selected node. Each effect displays as a collapsible row with: color swatch (shadows) or blur icon (blurs), type dropdown (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR, FOREGROUND_BLUR), visibility toggle, and remove button. Clicking a row expands inline controls.++#### Scenario: Add drop shadow effect+- **WHEN** user clicks the + button in the Effects section+- **THEN** a DROP_SHADOW effect is added with default values (offset 0,4; radius 4; spread 0; color rgba(0,0,0,0.25))++#### Scenario: Switch effect type+- **WHEN** user changes the type dropdown from DROP_SHADOW to LAYER_BLUR+- **THEN** the effect type updates and offset/spread fields are hidden (only blur radius shown)++#### Scenario: Inline shadow controls+- **WHEN** user expands a shadow effect row+- **THEN** X/Y offset, blur radius, spread, color picker, hex input, and opacity controls appear inline++#### Scenario: Toggle effect visibility+- **WHEN** user clicks the eye icon on an effect row+- **THEN** the effect's `visible` property toggles and the canvas re-renders++#### Scenario: Remove effect+- **WHEN** user clicks the − button on an effect row+- **THEN** the effect is removed from the node++### Requirement: Independent corner radius toggle in Appearance section+The Appearance section SHALL show a corner radius toggle button for RECTANGLE, ROUNDED_RECTANGLE, FRAME, COMPONENT, and INSTANCE nodes. When toggled to independent mode, a 2×2 grid of per-corner radius inputs (top-left, top-right, bottom-left, bottom-right) replaces the single radius input. Each corner has a distinct icon. Toggling back to uniform sets all corners to the top-left value.++#### Scenario: Toggle to independent corners+- **WHEN** user clicks the independent corners button+- **THEN** four separate corner radius inputs appear in a grid layout++#### Scenario: Toggle back to uniform+- **WHEN** user clicks the independent corners button while in independent mode+- **THEN** a single corner radius input appears, set to the top-left valuediff --git a/openspec/specs/scene-graph/spec.md b/openspec/specs/scene-graph/spec.mdindex 3eeb852d6..18af8d2f8 100644--- a/openspec/specs/scene-graph/spec.md+++ b/openspec/specs/scene-graph/spec.md@@ -157,3 +157,31 @@ The scene graph SHALL support `hitTestDeep(px, py)` that traverses into COMPONEN#### Scenario: Deep hit test enters component- **WHEN** `hitTestDeep` is called at a position inside a component's child- **THEN** the child is returned, not the component++### Requirement: Instance sync method+The SceneGraph SHALL expose a method to synchronize all INSTANCE nodes linked to a given COMPONENT, copying synced properties (width, height, fills, strokes, effects, opacity, cornerRadius, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius, independentCorners, layoutMode, layoutWrap, primaryAxisAlign, counterAxisAlign, primaryAxisSizing, counterAxisSizing, itemSpacing, counterAxisSpacing, paddingTop, paddingRight, paddingBottom, paddingLeft, clipsContent). Array properties are shallow-copied. Override-marked properties are skipped.++#### Scenario: Sync propagates fills+- **WHEN** a component's fill is changed and sync is triggered+- **THEN** all instances of that component receive the new fill (unless overridden)++### Requirement: Clone children with mapping+The SceneGraph SHALL support recursively cloning children from a source parent to a destination parent, setting each clone's `componentId` to the source child's ID. This enables sync matching between component and instance children.++#### Scenario: Clone with mapping+- **WHEN** a component with nested frames is cloned to an instance+- **THEN** each cloned child (recursively) has `componentId` pointing to the original++### Requirement: Child sync+The SceneGraph SHALL support syncing instance children to component children by matching via `componentId`. Synced child properties include the standard synced property list plus name, text, fontSize, fontWeight, fontFamily. New children from the component are cloned into the instance. Instance children are reordered to match component child order.++#### Scenario: Sync matches children by componentId+- **WHEN** a component has children [A, B] and an instance has cloned children with `componentId` pointing to A and B+- **THEN** sync updates each instance child's non-overridden properties from the corresponding component child++### Requirement: Independent corner radius fields+SceneNode SHALL include `independentCorners` (boolean), `topLeftRadius`, `topRightRadius`, `bottomRightRadius`, `bottomLeftRadius` (numbers). When `independentCorners` is true, each corner radius is controlled independently.++#### Scenario: Independent corners+- **WHEN** a rectangle has `independentCorners: true` with topLeftRadius=8 and topRightRadius=0+- **THEN** the rectangle renders with rounded top-left and sharp top-rightdiff --git a/openspec/specs/testing/spec.md b/openspec/specs/testing/spec.mdindex 4e7aeba9c..99d631f39 100644--- a/openspec/specs/testing/spec.md+++ b/openspec/specs/testing/spec.md@@ -66,3 +66,26 @@ E2E tests SHALL verify the layers panel: node visibility in tree, expand/collaps- **WHEN** the layers panel E2E tests run- **THEN** all tests pass verifying tree structure, visibility toggles, and selection sync+### Requirement: Component-instance sync unit tests+Unit tests SHALL cover the component-instance sync lifecycle: instance creation with `componentId` mapping on children, sync propagation of property changes, override preservation during sync, new child addition to instances, and detach breaking the link.++#### Scenario: Instance child mapping test+- **WHEN** `bun test ./tests/engine/scene-graph.test.ts` runs+- **THEN** the test verifies instance children have `componentId` pointing to component children++#### Scenario: Sync propagation test+- **WHEN** a component's text child changes and sync is triggered+- **THEN** the test verifies instance children receive the updated text and fontSize++#### Scenario: Override preservation test+- **WHEN** an instance child has an overridden text value+- **THEN** the test verifies the override is preserved while non-overridden properties sync++#### Scenario: New child addition test+- **WHEN** a new child is added to a component and sync runs+- **THEN** the test verifies existing instances gain the new child++#### Scenario: Detach test+- **WHEN** an instance is detached+- **THEN** the test verifies type becomes FRAME, componentId is null, and the component's instance list no longer includes it+