Commit graph

52 commits

Author SHA1 Message Date
Danila Poyarkov 2d4e2a7b10 Release v0.13.1 2026-05-30 01:12:58 +03:00
Danila Poyarkov 227ee97448 ci: share Bun setup across workflows 2026-05-24 12:33:58 +03:00
Danila Poyarkov abd795bd9a chore: format codebase 2026-05-24 12:15:29 +03:00
Danila Poyarkov c1b2678533 ci: make heavy fig tests manual 2026-05-05 21:25:23 +03:00
Danila Poyarkov 92265a56c1 ci: add scheduled heavy fig tests 2026-05-05 21:21:41 +03:00
Danila Poyarkov 25ea361fd7
feat(app): cache downloaded fonts
- Add a downloaded font cache hook to FontManager
- Store Tauri font downloads under AppLocalData with manifest validation
- Prefer cached downloads before system font lookup on desktop
- Skip opt-in heavy .fig parsing tests in PR CI
2026-05-05 21:14:38 +03:00
Danila Poyarkov b248e0c53a feat(tauri): add signed updater 2026-05-01 13:00:50 +03:00
Danila Poyarkov 35f3bb7f54 ci: create GitHub releases as drafts
Auto-generated release notes from CHANGELOG.md are often wrong.
Create as draft so the changelog section can be reviewed and
pasted manually before publishing.
2026-04-23 17:16:58 +03:00
Danila Poyarkov 2c3191cf96 Release v0.11.5 2026-04-08 21:38:44 +03:00
Danila Poyarkov e18c8660e3 Stabilize npm publishing workflow 2026-03-30 18:36:46 +03:00
Danila Poyarkov 36bc879421 Fix package publishing pipeline 2026-03-30 17:21:20 +03:00
Danila Poyarkov 79357f3afe Add Vue package publishing in CI 2026-03-30 16:21:57 +03:00
Danila Poyarkov 9ad69f459d Fix Homebrew workflow: authenticated clone for tap push 2026-03-17 15:28:53 +03:00
Danila Poyarkov d1d0e9c513 Add workflow_dispatch trigger to Homebrew workflow 2026-03-17 15:12:06 +03:00
Danila Poyarkov 86d201b29e Split preview deploy into pull_request_target workflow
Fork PRs can't access repo secrets with pull_request trigger.
pull_request_target runs in the base repo context so Cloudflare
secrets are available for all PRs.
2026-03-14 18:18:35 +03:00
Anton Soldatov e939025f7d
Fix auto-layout overflow, grid layout, AI chat UX (#86)
* Fix auto-layout overflow: MeasureFunc, min/max, absolute positioning, text wrap

Layout engine (layout.ts):
- Use Yoga MeasureFunc for text nodes instead of static pre-measurement,
  so text wraps correctly when width is determined by flex layout
- Add min/max width/height constraint support (minWidth, maxWidth, etc.)
- Translate counterAxisAlignContent to Yoga setAlignContent for wrap layouts
- Extract configureFlexContainer to share between root and nested frames

JSX renderer (render/renderer.ts):
- Auto-set layoutPositioning ABSOLUTE for elements with x/y inside auto-layout
- Fix text auto-resize: set HEIGHT when text fills parent in auto-layout

Text measurer (renderer/renderer.ts):
- Accept optional maxWidth parameter for constraint-based measurement

* AI prompt: prefer describe over export_image for post-render verification

* Strip TS casts from AI-generated JSX before sucrase parse

AI models sometimes emit `as any`, `as const` etc. in JSX props.
Sucrase with jsx-only transform can't handle these, causing parse errors.

- Strip TypeScript cast expressions before passing to sucrase
- Add forbidden patterns to AI prompt: as any, template literals for
  sizes, Math.random()

* Cache text MeasureFunc results to avoid repeated buildParagraph calls

Yoga calls MeasureFunc multiple times per node during calculateLayout.
Each call was creating a full CanvasKit Paragraph — expensive for layouts
with many text nodes. Cache by rounded constraint width.

* AI chat: fix provider settings popover, add max output tokens, fix paste in chat input

- Fix ProviderSettings popover not visible (remove tooltip/popover trigger
  conflict, add collision-padding, isolate z-[51])
- Add configurable max output tokens (default 16384) in provider settings
- Pass maxOutputTokens to ToolLoopAgent to prevent truncated tool calls
- Add system prompt size limits: split render calls at ~40 elements
- Fix paste/copy/cut in chat input (stop event propagation to canvas handler)

* Fix 6 layout engine bugs: hidden size, FILL basis, SPACE_EVENLY, alignSelf range, grid stretch, absolute children

Layout engine (layout.ts):
- Guard applyYogaLayout to preserve hidden children dimensions
- Add setFlexBasis(0) for FILL sizing so children share space from zero
- Add SPACE_EVENLY to mapJustify via Justify.SpaceEvenly
- Replace hardcoded STRETCH checks with mapAlignSelf for full range
- Use setWidthStretch/setHeightStretch for grid children instead of flexGrow
- Insert absolute children in Yoga tree via configureAbsoluteChild with
  PositionType.Absolute, keeping manual x/y (no write-back)

Types (scene-graph.ts):
- Add SPACE_EVENLY to LayoutAlign union
- New LayoutAlignSelf type: AUTO | MIN | CENTER | MAX | STRETCH | BASELINE

Import (kiwi-convert.ts):
- Map SPACE_EVENLY correctly instead of collapsing to SPACE_BETWEEN
- New mapAlignSelf function for full StackCounterAlign range

Tools (modify.ts):
- Expand set_layout align enum with SPACE_EVENLY
- Expand set_layout_child align_self enum with MIN/CENTER/MAX/BASELINE

Tests: 86 pass (+13 new covering all 6 fixes)

* Grid layout support in JSX renderer, auto-height grids, flex children stretch in cells

Renderer:
- Parse grid/columns/rows/columnGap/rowGap/gap props
- Parse grid child positioning: colStart/col/rowStart/row/colSpan/rowSpan
- Grid prop takes precedence over padding-triggered auto-layout
- SPACE_EVENLY added to ALIGN_MAP
- Numeric columns shorthand (columns={3} → 3×1fr)
- Auto-height: grid without rows sets height=0 for Yoga auto-sizing
- fill sizing in grid children → layoutAlignSelf: STRETCH
- Component builders accept variadic children: Frame(props, ...children)

Layout:
- Grid auto-height: skip setHeight when no gridTemplateRows
- Write back computed height for auto-height grids
- Grid children with layoutMode stretch width to fill cell
- recomputeGridChild: re-run flex layout after grid assigns cell size
  (temporarily sets sizing to FIXED so HUG doesn't override grid width)

Export:
- Skip height export for auto-height grids (no rows template)

Tests: 18 new grid render tests covering all paths

* Auto-enable flex for justify/items props, discourage export_image in AI prompt

* Address review: use sucrase typescript transform, don't reset chat on maxOutputTokens change

* Fix lint errors: extract applyFrameSize, wrap nested ternary, remove unnecessary cast

* Remove SPACE_EVENLY — not a valid Figma layout value

* CI: debug LFS pull from R2

* Apply maxOutputTokens dynamically via prepareCall instead of at agent creation

* Fix heavy .fig parse: restore GUID/defID guards, fix optional types

Commit f3eac5a removed null guards from fig-import and
instance-overrides as 'unnecessary conditions', but Kiwi-decoded data
can have NodeChanges without GUIDs and ComponentPropAssignments/Refs
without defIDs. Made the types optional to match reality.

Also fix CI LFS: add git lfs install --force before pull (R2 endpoint
needs the filter registered first).

* Fix Google AI model IDs: gemini-3.1-pro → gemini-3.1-pro-preview

Closes #91

---------

Co-authored-by: Danila Poyarkov <dev@dannote.net>
2026-03-10 15:43:04 +03:00
Danila Poyarkov fa3d7b8a8f Enable type-aware linting with tsgo in oxlint
Add oxlint-tsgolint dependency and --type-aware --type-check flags.
This replaces the separate tsgo --noEmit step — oxlint now handles
both linting and type checking in a single pass.

Add typescript/no-floating-promises as a warning rule.
2026-03-08 23:02:25 +03:00
Danila Poyarkov e2e4a2543f Fix release notes: extract from CHANGELOG.md directly (drop ffurrer2 action) 2026-03-08 02:06:52 +03:00
Danila Poyarkov f2b70579e7 Fix npm publish: use OIDC trusted publisher, remove empty NPM_TOKEN override 2026-03-08 01:41:11 +03:00
Danila Poyarkov e6984629fd Fix MCP publish: pre-build then publish with --ignore-scripts 2026-03-08 01:07:32 +03:00
Danila Poyarkov a6ea74014a Fix publish: resolve workspace deps then npm publish with provenance 2026-03-08 00:54:22 +03:00
Danila Poyarkov 65e40a2570 Fix pnpm publish auth: write .npmrc in project root 2026-03-08 00:37:24 +03:00
Danila Poyarkov 5c68ab0dee Fix npm publish auth: write .npmrc for pnpm 2026-03-08 00:34:19 +03:00
Danila Poyarkov 9882375b4f Release v0.8.0 2026-03-08 00:20:47 +03:00
Danila Poyarkov df8e303498
Add Homebrew tap with auto-update workflow (#61) 2026-03-06 18:08:47 +03:00
Anton Soldatov 168c25c189
feat: mobile layout, PWA support (#27) (#27)
- Mobile-responsive editor with bottom drawer, ribbon nav, HUD overlay
- Touch support: single-finger tools, two-finger pinch-zoom
- PWA: manifest, service worker, installability
- Extract LayerTree from LayersPanel, shared utils (colorToCSS, initials, toolIcons)
- Constants moved to src/constants.ts, clipboard state to editor store
- reka-ui Popover/DropdownMenu in MobileHud

Co-authored-by: Danila Poyarkov <dev@dannote.net>
2026-03-05 19:51:51 +03:00
Danila Poyarkov e7f827c0e3 Fix npm publish: remove manual .npmrc that overwrote setup-node auth 2026-03-05 10:58:55 +03:00
Danila Poyarkov c67c60a42c Fix Windows build: add shell: bash to contributor step 2026-03-05 10:44:32 +03:00
Danila Poyarkov b7e5ea2d45 Fix effect ordering test, add contributors to release notes
Fix renderer-effects test: check drawStrokeWithAlign call site instead of
drawNodeStroke helper definition (stroke align refactor moved the method).

Add a step to build.yml that resolves git authors to GitHub usernames via
the compare API and appends a Contributors section to release notes.
2026-03-05 10:04:50 +03:00
Danila Poyarkov 0047a25cae Fix effect ordering test, add contributors to release notes
Fix renderer-effects test: check drawStrokeWithAlign call site instead of
drawNodeStroke helper definition (stroke align refactor moved the method).

Add a step to build.yml that resolves git authors to GitHub usernames via
the compare API and appends a Contributors section to release notes.
2026-03-05 09:56:13 +03:00
Danila Poyarkov 38e7fdd4ac Fix hit-testing: scope hover to current page, click-through empty containers
- Scope hover hit-test to current page (was searching all pages including
  internal component page, causing ghost hover outlines)
- Frames/sections without visible fills or strokes are click-through
- Groups are always click-through (only children are hittable)
- Clipping parents reject hits outside their bounds
- Instances/components check children before falling back to fill check
- Switch test fixtures from material3.fig (55MB) / nuxtui.fig (82MB) to
  gold-preview.fig (537KB) for fast dev runs, gate heavy fixtures behind
  BUN_HEAVY_TESTS env var (enabled in CI)
2026-03-05 08:56:35 +03:00
Danila Poyarkov 185e9e781b Fix CI: enable Git LFS checkout for test fixtures 2026-03-04 14:57:13 +03:00
Danila Poyarkov 0b56cc1e70 Set up Apple code signing and notarization 2026-03-04 01:40:19 +03:00
Danila Poyarkov 7e06969ab5 Multi-selection properties panel with tests
Show position, appearance, fill, stroke, and effects sections
when multiple nodes are selected. Shared values display normally,
differing values show 'Mixed'. Editing applies to all selected.

- Shared composable (use-multi-props) for isMulti, active, activeNode
- ScrubInput supports MIXED symbol as model-value
- Per-node previous values for correct undo on multi-edit
- Fix flip transform encoding (scale first column only)
- Fix npm publish auth for MCP package
- 22 new tests: flip, alignment, multi-node merging, kiwi roundtrip
2026-03-03 20:35:51 +03:00
Danila Poyarkov 264bc7fe2a Fix build workflow: only create releases and publish npm from version tags 2026-03-03 18:29:56 +03:00
Danila Poyarkov 2ad76108f0 Fix npm publish: run from repo root with dir argument 2026-03-03 18:13:52 +03:00
Danila Poyarkov 734612cab3 Fix npm auth: write .npmrc to home dir for subshell publish 2026-03-03 17:57:55 +03:00
Danila Poyarkov 90b92b4fb5 Fix npm publish: use npm instead of pnpm for auth compatibility 2026-03-03 17:44:19 +03:00
Danila Poyarkov 8e234d7bb5 Add CI for PRs, issue/PR templates, CONTRIBUTING and SECURITY docs 2026-03-03 17:24:45 +03:00
Danila Poyarkov fcb244f02a Cache Rust and Bun dependencies in CI 2026-03-03 17:11:33 +03:00
Danila Poyarkov 79eff7c0a8 Fix npm publish: run cd in subshell to preserve working directory 2026-03-03 16:55:36 +03:00
Danila Poyarkov b7a634f1ae Skip already-published versions in CI npm publish
Prevents re-run failures when a package was already published.
Real errors (auth, build) still fail the job.
2026-03-02 18:37:00 +03:00
Danila Poyarkov 877350a3af Auto-populate GitHub Releases from CHANGELOG.md
Use ffurrer2/extract-release-notes@v2 to extract the version section
and pass it as releaseBody to the Tauri action.

Switch changelog headings to Keep a Changelog format (## [X.Y.Z])
to match the action's expected pattern.
2026-03-02 18:12:36 +03:00
Danila Poyarkov e0c5820183 CI: publish releases as non-draft 2026-03-02 15:54:43 +03:00
Danila Poyarkov 10b4fc6c13 Add @open-pencil/mcp to npm publish workflow 2026-03-02 14:27:07 +03:00
Danila Poyarkov a9c096a69d Fix npm publish: pnpm for workspace resolution, update README, read CLI version from package.json 2026-03-01 22:44:56 +03:00
Danila Poyarkov 0acfd50a67 Add npm publish with trusted publishing to release workflow 2026-03-01 16:27:41 +03:00
Danila Poyarkov c4e6514ea2 Update repo references to open-pencil/open-pencil 2026-03-01 16:18:11 +03:00
Danila Poyarkov baee65e599 Add CHANGELOG.md, update build workflow for v0.1.0-alpha
- Add Linux x64 build target
- Add patchelf for Linux AppImage builds
- Release body links to CHANGELOG.md
- Release name includes 'OpenPencil' prefix
2026-03-01 16:09:25 +03:00
Danila Poyarkov 268c4029e9 Add CI workflow for app.openpencil.dev deploy 2026-03-01 16:00:19 +03:00