Commit graph

1259 commits

Author SHA1 Message Date
Danila Poyarkov c2afb8ddca chore(lint): enforce type safety in scripts
- Fix non-null assertions in visual-compare script
- Fix missing radix parameter
- Replace ImageMagick rgba() color with hex notation
- Remove no-non-null-assertion, no-hand-rolled-color, and radix script overrides
- Keep only no-console override for CLI scripts
2026-05-06 16:41:40 +03:00
Danila Poyarkov 541c9bd13c test: move tauri helpers into domain folder
- Move tests/helpers/tauri-mocks.ts → tests/helpers/tauri/mocks.ts
- Move tests/helpers/tauri-fig-export-fixture.ts → tests/helpers/tauri/fig-export-fixture.ts
- Update all imports
2026-05-06 16:16:08 +03:00
Danila Poyarkov 738d199e8a refactor: remove ugly type intersection casts
- Add optional nodeEditState, cursorCanvas, and pen resume fields to core EditorState
- Add parent field to LintNode instead of repeated intersection casts
- Use typed LintPathNode for node path traversal
- Replace autosave useDebounceFn cancel hack with watchDebounced
- Simplify AppEditorState to extend EditorState without Omit+intersection
- Remove PenState intersection type alias
- Use in-operator check for optional setViewportSize
2026-05-06 16:08:36 +03:00
Danila Poyarkov 7dce333200 docs: document event bus and wire app consumers
- Update CHANGELOG.md with event bus, test restructuring, and lint hardening
- Document EditorEvents table and conventions in AGENTS.md
- Wire collab graph sync to editor event bus instead of SceneGraph.onNodeEvents
- Wire collab awareness zoom to viewport:changed instead of Vue watcher
- Wire collab selection broadcasting to selection:changed instead of Vue watcher
2026-05-06 15:38:45 +03:00
Danila Poyarkov 1835903e56 feat(editor): add event bus for editor lifecycle events
Wire nanoevents-based event bus to the editor core:

- EditorEvents type with render, graph, selection, tool, page, viewport events
- All node mutations (create/update/delete/reparent/reorder) forwarded from SceneGraph
- Selection changes routed through setSelectedIds() with diff detection
- Tool changes routed through setActiveTool() with change detection
- Page switches emit page:changed
- Viewport pan/zoom/fit/zoomTo emit viewport:changed
- Graph replacement emits graph:replaced
- Typed onEditorEvent() subscription on the Editor return object
- useEditorEvent() Vue composable with automatic scope cleanup
- Replace all direct state.selectedIds/state.activeTool mutations in core, app, and SDK
2026-05-06 15:25:27 +03:00
Danila Poyarkov dfa9505805 chore(lint): enforce domain prefix folders project-wide
- Generalize sibling domain prefix linting beyond tests
- Move create icon tools under the existing create domain folder
- Keep create.ts exporting the icon tools through the domain folder
2026-05-06 14:33:17 +03:00
Danila Poyarkov aad26b535e test: move prefixed splits into domain folders
- Move newly split tests under explicit domain subfolders
- Update nested helper imports after the moves
- Add a lint guard against repeating existing sibling domains as filename prefixes
2026-05-06 14:27:21 +03:00
Danila Poyarkov b9da0dcb76 chore(lint): enforce test complexity limits
- Extract color picker fill comparison helpers
- Guard derived text assertions without optional chains
- Split resize math into smaller helper functions
- Remove the remaining complexity test exceptions
2026-05-06 14:18:29 +03:00
Danila Poyarkov 13a3475026 test(layout): split auto-layout coverage
- Move auto-layout tests into focused files by layout behavior
- Preserve sizing, wrapping, text measurement, and positioning coverage
- Remove the last max-lines test exception
2026-05-06 14:10:20 +03:00
Danila Poyarkov 5e7c042352 test(scene-graph): split basic coverage
- Move scene graph behavior tests into focused files
- Share basic scene graph helper builders from basic/helpers.ts
- Remove scene graph basic from max-lines exceptions
2026-05-06 14:05:58 +03:00
Danila Poyarkov c589818a71 test(clipboard): split node import coverage
- Move clipboard node import tests into focused files by behavior
- Preserve filtering, hierarchy, styling, component, and undo coverage
- Remove import-nodes from max-lines exceptions
2026-05-06 14:01:18 +03:00
Danila Poyarkov 9ebc61d78f test(figma): split API coverage
- Move FigmaAPI tests into focused files by feature area
- Share API construction from figma/api/helpers.ts
- Remove FigmaAPI coverage from max-lines exceptions
2026-05-06 13:37:15 +03:00
Danila Poyarkov 54ccc35e3e test(fig): split legacy import coverage
- Move legacy fig import tests into focused domain files
- Share NodeChange fixture builders from legacy/helpers.ts
- Remove legacy import from max-lines exceptions
2026-05-06 13:33:42 +03:00
Danila Poyarkov 42d346ba47 test(kiwi): split serialization regression coverage
- Move Kiwi serialization fix tests into one file per regression area
- Share codec setup and Kiwi helpers from serialize-fixes/helpers.ts
- Remove serialize fixes from max-lines exceptions
2026-05-06 13:12:53 +03:00
Danila Poyarkov 24629610a4 test(render): split canvas effect coverage
- Move canvas effect renderer tests into focused files by behavior
- Share renderer and canvas mocks from effects/helpers.ts
- Remove canvas effects from max-lines exceptions
2026-05-06 13:05:51 +03:00
Danila Poyarkov 93d5370d7d test(svg): split SVG export coverage
- Move SVG builder, path, and render export tests into focused files
- Share SVG export helpers from tests/engine/svg/export/helpers.ts
- Remove svg export from max-lines exceptions
2026-05-06 12:57:54 +03:00
Danila Poyarkov 21a3337a96 chore(tests): enforce no-empty-function
- Replace remaining empty mock callbacks with explicit undefined returns
- Remove the last no-empty-function test exceptions
- Validate check and affected renderer/text tests
2026-05-06 12:40:42 +03:00
Danila Poyarkov 432f945da6 chore(tests): narrow no-empty-function exceptions
- Replace simple no-op test callbacks with explicit undefined returns
- Remove no-empty-function exceptions for autosave, stroke picker, font settings, pen, tauri, AI adapter, and undo helper tests
- Validate check plus affected engine and E2E tests
2026-05-06 12:32:54 +03:00
Danila Poyarkov bbf122a5c5 chore(tests): route store access through browser bridge
- Expose window.openPencil.getStore() instead of a direct store property
- Update E2E helpers and specs to use the bridge getter
- Add lint coverage preventing direct window.openPencil.store access
2026-05-06 12:19:39 +03:00
Danila Poyarkov 657188b097 chore(tests): enforce non-null assertion rule
- Remove remaining test non-null assertions and delete the broad test override
- Add explicit guards for canvas, design panel, auto-layout, SVG, Kiwi, hit-test, scene graph, text editor, and clipboard tests
- Validate check plus affected engine and E2E coverage
2026-05-06 11:44:18 +03:00
Danila Poyarkov 17857f912f chore(tests): guard render text and mutation lookups
- Replace non-null assertions in canvas text rendering and mutation undo tests
- Use expectDefined for CanvasKit handles and getNodeOrThrow for graph nodes
- Validate check and affected engine tests
2026-05-06 11:27:24 +03:00
Danila Poyarkov 1367ee3b35 chore(tests): guard modify tool assertions
- Replace non-null assertions in modify tool tests
- Use expectDefined and getNodeOrThrow for graph, proxy, and style-run lookups
- Validate check and affected modify tool tests
2026-05-06 11:20:49 +03:00
Danila Poyarkov 77aede6770 chore(tests): guard image test lookups
- Replace non-null assertions in image tool, clipboard, and fig roundtrip tests
- Use expectDefined for tool lookup, clipboard parse, and restored image bytes
- Validate check and affected image/undo tests
2026-05-06 11:18:03 +03:00
Danila Poyarkov 86cb3970ff chore(tests): guard component and cache assertions
- Remove non-null assertions from component, visibility, scene cache, and redo sequence tests
- Add explicit node, store, renderer, and canvas bounds guards
- Validate check plus affected engine and E2E coverage
2026-05-06 11:07:47 +03:00
Danila Poyarkov f7b20a8f38 chore(tests): namespace browser test hooks
- Move test-only write-count, mock-handle, and saved-open globals under window.openPencil.test
- Keep external Tauri and Vite injected globals separate from app-owned browser bridge hooks
- Validate check plus autosave and chat E2E coverage
2026-05-06 10:49:46 +03:00
Danila Poyarkov 8719274cc9 chore(app): clarify browser bridge naming
- Rename window-api to browser-bridge to describe the app-to-browser test hook boundary
- Rename the chat transport hook to exposeChatTransportOverride and window.openPencil.setChatTransport
2026-05-06 10:43:15 +03:00
Danila Poyarkov 8ec70330b4 chore(lint): centralize OpenPencil window API
- Route browser globals through src/app/window-api.ts instead of private __OPEN_PENCIL fields
- Move E2E tests to the public window.openPencil test API
- Add an oxlint rule banning direct window.__OPEN_PENCIL* access
2026-05-06 10:38:03 +03:00
Danila Poyarkov c7d2d0d0ad chore(tests): guard viewport and text assertions
- Remove non-null assertions from keyboard, text editing, viewport, and legacy fig import tests
- Add explicit canvas, store, page-node, and variable guards
- Validate check, legacy fig import, keyboard, and viewport E2E coverage
2026-05-06 10:16:24 +03:00
Danila Poyarkov eba56fbe38 chore(tests): guard text and keyboard lookups
- Replace non-null assertions in keyboard, text editing, and legacy fig import coverage
- Add explicit store guards and expectDefined for optional test data
- Validate check, legacy fig import, and keyboard E2E coverage
2026-05-06 10:10:54 +03:00
Danila Poyarkov ac5bb4add3 chore(tests): guard engine node assertions
- Replace non-null assertions in effects, Figma API, and individual stroke tests
- Use expectDefined and getNodeOrThrow for optional graph/proxy lookups
- Validate affected engine tests
2026-05-06 09:48:55 +03:00
Danila Poyarkov 3387b5bb6b chore(tests): guard more test lookups
- Remove non-null assertions from context menu, panels, perf, properties, MCP, SVG, undo, and instance override tests
- Add explicit store, renderer, node, and bounding-box guards
- Validate affected engine and E2E tests
2026-05-06 09:43:28 +03:00
Danila Poyarkov 017c55cbf5 chore(tests): clean more non-null assertions
- Replace clipboard, variable, centerline, layout, menu, and text formatting assertions with explicit guards
- Use expectDefined and getNodeOrThrow instead of postfix non-null assertions
- Validate affected engine and E2E tests
2026-05-06 03:28:25 +03:00
Danila Poyarkov 6ec18f1dfb chore(tests): remove targeted non-null assertions
- Replace low-count E2E non-null assertions with store guards and optional expectations
- Use expectDefined for tool adapter and XPath node lookups
- Validate affected engine and E2E tests
2026-05-06 03:13:58 +03:00
Danila Poyarkov 39675b2969 chore(tests): remove easy non-null assertions
- Replace browser store non-null assertions with explicit initialization guards
- Use expectDefined for optional test resources and tool results
- Clean low-count non-null assertions in font, icon, snap, OKHCL, and visual tests
2026-05-06 02:59:56 +03:00
Danila Poyarkov 9e4d7bee5d chore(lint): fix unused test code
- Remove stale imports and unused locals from split engine and e2e tests
- Drop the targeted no-unused-vars test allowances
- Keep check and affected test suites warning-free
2026-05-06 02:53:19 +03:00
Danila Poyarkov f2df82285a chore(lint): scope unused test allowances
- Remove the broad no-unused-vars test override
- Scope unused-variable allowances to existing legacy and fixture-heavy test files
- Keep new tests subject to unused variable warnings by default
2026-05-06 02:41:48 +03:00
Danila Poyarkov d88fd9a7ba chore(lint): narrow test mock exceptions
- Remove broad test exceptions for no-empty-function and complexity
- Scope no-op mock allowances to files that intentionally define fake APIs
- Scope complexity allowances to the remaining high-coverage integration-style tests
2026-05-06 02:39:26 +03:00
Danila Poyarkov 0af8cd271e chore(lint): enforce named core types in tests
- Remove the broad test exception for inline named type literals
- Replace duplicated Color, Vector, and Rect shapes with shared core types
- Keep affected engine tests passing
2026-05-06 02:38:27 +03:00
Danila Poyarkov a63ac93a3d chore(lint): enforce type imports in tests
- Remove the broad test exception for consistent type imports
- Mark test-only core and helper imports as type imports where appropriate
- Keep targeted validation for affected engine tests
2026-05-06 02:35:57 +03:00
Danila Poyarkov b665d9c99e chore(lint): narrow test output exceptions
- Replace broad test no-console and max-lines disables with file-specific overrides
- Keep empty-function disabled broadly for test mocks and no-op fixtures
- Preserve clean check output while reducing global test lint carve-outs
2026-05-06 02:33:31 +03:00
Danila Poyarkov 654aa421e9 chore(lint): reduce test rule exceptions
- Re-enable duplicate imports, radix, prefer-const, nested ternary, and silent catch checks in tests
- Drop the redundant spec-file override covered by the broader test override
- Fix the remaining test offenders surfaced by the stricter rules
2026-05-06 02:31:07 +03:00
Danila Poyarkov 554e9d5232 chore(lint): remove stale migration guard rules
- Drop custom rules that only protected deleted legacy app/test paths
- Keep permanent package boundary, alias, naming, and type-safety rules
- Reuse filename guard helper for the remaining file-layout rules
2026-05-06 02:26:59 +03:00
Danila Poyarkov dffe1f5646 refactor(lint): share import restriction rule helpers
- Add a common createImportSourceRule helper for custom oxlint import checks
- Collapse repeated ImportDeclaration visitor boilerplate across package, test, and barrel rules
- Preserve dynamic import/export coverage for rules that previously handled it
2026-05-06 02:24:14 +03:00
Danila Poyarkov c3f5189f8f style: tighten import grouping
- Configure oxfmt custom import groups for workspace, app, package, and test aliases
- Keep type imports grouped with their matching source category instead of one global tail group
- Expand the format script to cover formatter config, Vite files, and scripts
2026-05-06 02:22:08 +03:00
Danila Poyarkov ddb1db8175 style: format imports 2026-05-06 02:16:37 +03:00
Danila Poyarkov 792f0e87cf fix(app): use color parser for theme CSS colors
- Remove hand-rolled rgb/rgba parsing from shell theme handling
- Parse ruler CSS custom properties through the shared core color helper
2026-05-06 02:15:39 +03:00
Danila Poyarkov bef03e3804 fix(app): avoid pre-init theme warnings
- Add a nullable active editor store accessor for optional app-bound updates
- Skip canvas theme repainting until an editor store exists
- Guard FontPicker focus handling against non-element component refs
2026-05-06 02:14:33 +03:00
Danila Poyarkov 930cf39216 test: organize prefixed test files into folders
- Move top-level engine and e2e prefixed test files under domain folders
- Update fixture path helpers after moving render and pen tests
- Add lint coverage to prevent new top-level prefixed test files
- Refresh testing docs for the new fig and layout paths
2026-05-06 02:13:18 +03:00
Danila Poyarkov e42dffa003 chore(lint): consolidate oxlint config
- Merge structural lint rules into oxlint.json and remove the second config file
- Add #tests/* path aliases and rewrite deep test helper imports
- Ban new deep parent-relative imports through the shared lint config
2026-05-06 02:05:02 +03:00
Danila Poyarkov c31e7ae7d4 test(selection): split multi-selection coverage
- Move multi-selection.test.ts into focused flip, alignment, and property files
- Reuse scene and assertion helpers for selection tests
- Preserve all 22 multi-selection tests and enforce non-null assertion cleanup on the new folder
2026-05-06 01:56:27 +03:00