Commit Graph

21153 Commits

Author SHA1 Message Date
Belén Albeza
f6b8117fe9 Explicitly call free_gpu_resources on RenderState drop 2026-04-08 12:03:12 +02:00
Elena Torro
6d5b97a7e9 🔧 Fix text bounds 2026-04-08 11:16:09 +02:00
Aitor Moreno
d190655e64 Merge pull request #8841 from penpot/ladybenko-13861-modal-webgl-not-available
🎉 Show modal when WebGL is not available
2026-04-08 10:12:47 +02:00
Belén Albeza
619bc5833d 🔧 Remove VS Code settings 2026-04-08 09:59:44 +02:00
Andrey Antukh
61d319eaac ⬆️ Update dependencies (#8867)
* ⬆️ Update deps

* ⬆️ Update storybook dependencies

* ⬆️ Update dependencies

* 🐛 Fix invalid var() usage on SCSS variable in numeric_input

* ⬆️ Update deps
2026-04-07 21:35:00 +02:00
Andrey Antukh
a27ef26279 Merge remote-tracking branch 'origin/main' into staging 2026-04-07 19:23:37 +02:00
Andrey Antukh
f8c04949e1 🐛 Fix nil path content crash by exposing safe public API (#8806)
* 🐛 Fix nil path content crash by exposing safe public API

Move nil-safety for path segment helpers to the public API layer
(app.common.types.path) rather than the low-level segment namespace.
Add nil-safe wrappers for get-handlers, opposite-index, get-handler-point,
get-handler, handler->node, point-indices, handler-indices, next-node,
append-segment, points->content, closest-point, make-corner-point,
make-curve-point, split-segments, remove-nodes, merge-nodes, join-nodes,
and separate-nodes. Update all frontend callers to use path/ instead of
path.segment/ for these functions, removing the path.segment require
from helpers, drawing, edition, tools, curve, editor and debug.

Replace ad-hoc nil checks with impl/path-data coercion in all public
wrapper functions in app.common.types.path. The path-data helper
already handles nil by returning an empty PathData instance, which
provides uniform nil-safety across all content-accepting functions.

Update the path-get-points-nil-safe test to expect empty collection
instead of nil, matching the new coercion behavior.

* ♻️ Clean up path segment dead code and add missing tests

Remove dead code from segment.cljc: opposite-handler (duplicate of
calculate-opposite-handler) and path-closest-point-accuracy (unused
constant). Make update-handler and calculate-extremities private as
they are only used internally within segment.cljc.

Add missing tests for path/handler-indices, path/closest-point,
path/make-curve-point and path/merge-nodes. Update extremities tests
to use the local reference implementation instead of the now-private
calculate-extremities. Remove tests for deleted/privatized functions.

Add empty-content guard in path/closest-point wrapper to prevent
ArityException when reducing over zero segments.
2026-04-07 18:54:14 +02:00
Andrey Antukh
e10bd6a8d3 🐛 Fix infinite recursion in get-frame-ids for thumbnail extraction (#8807)
The get-frame-ids function could enter infinite recursion when:
1. There's a circular reference in the frame hierarchy
2. A shape's frame-id points to itself (corrupt data)

The fix uses the cached version (get-frame-ids-cached) in recursive calls
and adds a guard to prevent self-referencing.
2026-04-07 16:34:08 +02:00
Andrey Antukh
52f28a1eee 🐛 Fix stale-asset detector missing protocol-dispatch errors
The stale-asset-error? predicate only matched keyword-constant
cross-build mismatches ($cljs$cst$). Protocol dispatch failures
($cljs$core$I prefix, e.g. IFn/ISeq) and V8's 'Cannot read
properties of undefined' phrasing were not covered, so the handler
fell through to a generic toast instead of triggering a hard reload.

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
2026-04-07 16:33:40 +02:00
Andrey Antukh
9a0ae32488 ⬆️ Update opencode dependency on repo root 2026-04-07 16:33:40 +02:00
Andrey Antukh
1e4ff4aa47 🐛 Ignore Zone.js toString TypeError in uncaught error handler (#8804)
Zone.js (injected by browser extensions such as Angular DevTools) patches
addEventListener by wrapping it and assigning a custom .toString to the
wrapper via Object.defineProperty with writable:false.  When the same
element is processed a second time, the plain assignment in strict mode
(libs.js is built with a "use strict" banner) throws a native TypeError:
"Cannot assign to read only property 'toString' of function '...'".

This error escapes the React tree through the window error/unhandledrejection
events and was surfacing the exception page to users even though Penpot itself
is unaffected.

The fix:
- Extract the private ignorable-exception? helpers from the letfn block into
  top-level defn/defn- forms so the predicate can be reused elsewhere.
- Add the Zone.js toString TypeError to the ignorable-exception? predicate so
  the global uncaught-error handler silently suppresses it.
- The React error boundary is intentionally left unchanged: anything that
  reaches it has executed inside React's reconciler and must not be ignored.
2026-04-07 16:25:57 +02:00
Andrey Antukh
b99157a246 🐛 Prevent thumbnail frame recursion overflow (#8763)
Cache in-progress frame traversals before following parent frame links so thumbnail updates stop recursing forever on cyclic or transiently inconsistent shape graphs.

Add a regression test that covers cyclic frame-id chains and keeps the expected frame/component extraction behavior intact.

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
2026-04-07 15:09:54 +02:00
Belén Albeza
0558bab092 🎉 Show modal when WebGL is not available 2026-04-07 14:55:57 +02:00
Luis de Dios
e99b6ec213 🐛 Fix MCP active tab switching (#8856) 2026-04-07 10:58:04 +02:00
Eva Marco
67734c5835 🐛 Fix hover on layers (#8885) 2026-04-07 10:57:27 +02:00
Alonso Torres
11d9c09a2e 🐛 Fix problem with dashboard thumbnails (#8862) 2026-04-07 10:10:08 +02:00
Aitor Moreno
0f389fe3ad Merge pull request #8881 from penpot/azazeln28-fix-text-editor-v2-tests
🐛 Fix text-editor v2 waitForIdle not having a timeout
2026-04-06 13:13:05 +02:00
Aitor Moreno
9aa2abff2e 🐛 Fix text-editor v2 waitForIdle not having a timeout 2026-04-06 12:37:57 +02:00
Aitor Moreno
4205e283ea Merge pull request #8835 from penpot/superalex-fix-text-editor-mixed-selection-styles
🐛 Fix spurious mixed text styles on multi-span selection
2026-04-06 09:33:29 +02:00
Elena Torro
68760c8e26 🎉 Improve text inner stroke rendering 2026-04-02 12:00:08 +02:00
alonso.torres
cbe3a3f33e 🐛 Fix problem when changing grow-type 2026-04-02 11:44:41 +02:00
Andrey Antukh
2ca7acfca6 Add tests for app.common.geom and descendant namespaces (#8768)
* 🎉 Add tests for app.common.geom.bounds-map

* 🎉 Add tests for app.common.geom and descendant namespaces

* 📎 Fix linting issues

---------

Co-authored-by: Luis de Dios <luis.dedios@kaleidos.net>
2026-04-02 09:50:34 +02:00
Andrey Antukh
d2a3b67053 🎉 Add additional tests for app.common.types.shape.interactions (#8765)
*  Expand interaction helper test coverage

Add coverage for interaction destination and flow helpers,
including nil handling and removal helpers. Document the
intent of the new assertions so future interaction changes
keep the helper contract explicit.

*  Cover interaction validation edge cases

Exercise the remaining interaction guards and overlay
positioning edge cases, including invalid state
transitions and nested manual offsets. Keep the test
comments focused on why each branch matters for editor
 behavior.
2026-04-02 09:50:08 +02:00
Andrey Antukh
3ff1acfb6a 🐛 Fix vector index out of bounds in viewer zoom-to-fit/fill (#8834)
Clamp the frame index to the valid range in zoom-to-fit and
zoom-to-fill events before accessing the frames vector. When the
URL query parameter :index exceeds the number of frames on the
page (e.g. index=1 with a single frame), nth would throw
"No item 1 in vector of length 1". Also adds unit tests covering
the boundary condition.
2026-04-02 09:49:33 +02:00
Andrey Antukh
81b1b253f1 Add unique email domains to telemetry report (#8819)
Extend the telemetry payload with a sorted list of unique email domains
extracted from all registered profile email addresses. The new
:email-domains field is populated via a single SQL query using
split_part and DISTINCT, and is included in the stats sent when
telemetry is enabled.

Also update the tasks-telemetry-test to assert the new field is present
and contains the expected domain values.
2026-04-01 11:49:50 +02:00
Andrey Antukh
0337607a1b 🐛 Guard delete undo against missing sibling order (#8858)
Return nil from get-prev-sibling when the shape is no longer present in
the parent ordering so delete undo generation falls back to index-based
restore instead of crashing on invalid vector access.
2026-04-01 11:49:17 +02:00
Andrey Antukh
f7e1bcf87f 🐛 Handle plugin errors gracefully without crashing the UI (#8810)
* 🐛 Handle plugin errors gracefully without crashing the UI

Plugin errors (like 'Set is not a constructor') were propagating to the
global error handler and showing the exception page. This fix:

- Uses a WeakMap to track plugin errors (works in SES hardened environment)
- Wraps setTimeout/setInterval handlers to mark errors and re-throw them
- Frontend global handler checks isPluginError and logs to console

Plugin errors are now logged to console with 'Plugin Error' prefix but
don't crash the main application or show the exception page.

Signed-off-by: AI Agent <agent@penpot.app>

*  Improved handling of plugin errors on initialization

*  Fix test and linter

---------

Signed-off-by: AI Agent <agent@penpot.app>
Co-authored-by: alonso.torres <alonso.torres@kaleidos.net>
2026-04-01 11:37:27 +02:00
Andrey Antukh
8fcbfadd49 Merge remote-tracking branch 'origin/main' into staging 2026-04-01 11:30:21 +02:00
Belén Albeza
8c1cf3623b 🔧 Update action checkout to v6 (#8861) 2026-04-01 11:29:55 +02:00
Andrey Antukh
d3ac824912 🐛 Fix ICounted error on numeric-input token dropdown keyboard nav (#8803)
The options stored in options-ref is a delay (lazy value). In
on-token-key-down, it was passed raw to next-focus-index without being
dereferenced first, causing count to be called on a JS object that does
not implement ICounted.

Fix: dereference the delay in on-token-key-down (matching the existing
pattern in on-key-down), and make next-focus-index itself also handle
delays defensively. Add unit tests covering the delay case.
2026-04-01 11:21:01 +02:00
Andrey Antukh
350cc01b72 🐛 Fix frontend test script 2026-04-01 11:10:28 +02:00
Andrey Antukh
8289120ea4 Replace pnpx with pnpm exec in render-wasm build script
The pnpx tries to fetch esbuild instead of using the already installed
version.
2026-04-01 11:10:28 +02:00
Andrey Antukh
103af0e31a 📎 Fix inconsistencies on error report context data 2026-04-01 10:26:04 +02:00
Andrey Antukh
a04dd6cbfd Merge remote-tracking branch 'origin/main' into staging 2026-04-01 09:22:52 +02:00
Andrey Antukh
0ad5baa5d9 🐛 Fix mcp build script 2026-03-31 19:59:32 +02:00
Andrey Antukh
d3c77130bc Merge pull request #8852 from penpot/niwinz-staging-handle-bad-token-sets
🐛 Allow read/decode token-sets with bad names
2026-03-31 18:11:14 +02:00
Andrey Antukh
c200dc4040 🐛 Normalize token set name on creating token-set instance 2026-03-31 17:40:39 +02:00
Alonso Torres
04f98d7acd Change caddy config (#8849) 2026-03-31 17:24:02 +02:00
Dominik Jain
ad1e598efe Add wait time in exportImage to account for async updates #8836
This is a temporary workaround for penpot/penpot-mcp#27.
It adds a wait time before exports via the export_shape tool to account
for asynchronous updates in Penpot, increasing the likelihood of exporting
the fully updated state.
2026-03-31 17:20:02 +02:00
Dominik Jain
2e24f1e2de 🐛 Fix lock file not being included in npm package
The root lock file not being present causes issues, because
the sub-project dependencies are managed by it.

The lack of inclusion of pnpm-lock.yaml was the root cause of #8829.
A dependency was updated incompatibly, breaking the release.

Since npm pack has a hard exclusion rule for pnpm-lock.yaml,
we include it under a different name and restore it at runtime.
2026-03-31 17:19:04 +02:00
Dominik Jain
94215447c9 🔥 Remove redundant lock file in server package
Lock file in mcp/ base package should be single source of truth.
2026-03-31 17:19:04 +02:00
Yamila Moreno
084ca401fd 📚 Improve recommended settings for self-host (#8846) 2026-03-31 15:11:58 +02:00
Andrey Antukh
e6ab57f719 📎 Add minor cosmetic reoriganization on tokens-lib 2026-03-31 15:05:54 +02:00
Andrey Antukh
667a995e66 Make update-token- noop if token is not modified 2026-03-31 15:04:26 +02:00
Andrey Antukh
9d703439bd Add helper for define clock in millis precision 2026-03-31 15:03:27 +02:00
Andrey Antukh
d6dc0fe1a7 🐛 Fix raw file data download on dbg pannel (#8847) 2026-03-31 14:36:43 +02:00
Dominik Jain
8ce860cf0c 📚 Update MCP git branch information 2026-03-31 12:15:12 +02:00
Dominik Jain
f3cc6d0d72 🎉 Add MCP version mismatch detection
If the MCP version (as given in mcp/package.json) does not match
the Penpot version (as given by penpot.version), display a warning
message in the plugin UI.

This is important for users running the local MCP server, as it
is a common failure mode to combine the MCP server with an
incompatible Penpot version.
2026-03-31 12:15:12 +02:00
Dominik Jain
905f4fa5dd Provide root package version as PENPOT_MCP_VERSION in plugin
Update current root package version using set-version script
2026-03-31 12:15:12 +02:00
Alejandro Alonso
0122eaa391 Merge pull request #8843 from penpot/alotor-viewer-thumbnails
🐛 Fix problem with thumbnails
2026-03-31 11:29:32 +02:00