14748 Commits

Author SHA1 Message Date
Andrey Antukh
efd95dcf0c Merge remote-tracking branch 'origin/staging' into develop 2026-11-18 13:20:18 +01:00
Andrey Antukh
dad4479b9c Merge remote-tracking branch 'origin/staging' into staging 2026-11-18 13:15:27 +01:00
Andrey Antukh
2377ab0a16 Merge remote-tracking branch 'origin/staging-2.19.x' into staging 2026-11-18 13:15:10 +01:00
Eva Marco
28a4794d73
🔧 Test the direction of the move shortcuts (#13115)
#13068 fixed the move left and right shortcuts, which moved and showed
the opposite direction. Its test only checks the key binding. These
tests run each move shortcut, in the workspace and the path editor,
and check that it moves in its own direction, fast or by one unit, and
that its tooltip shows the matching arrow.

Without the fix of #13068, 8 assertions fail.

AI-assisted-by: claude-opus-5-5
2026-11-18 13:05:44 +01:00
Eva Marco
eb7860fcd7
🐛 Show the date of a restored autosaved version in the restore notice (#13120)
When a peer restored an autosaved version, the notice said "restored an
earlier version" instead of naming it by its date and time.

The modal wrapper passes the props map to the component without
camelCasing its keys, so the `created-at` prop reached the component as
"created-at" while it read `createdAt`, and the date was always nil.
Named versions were fine because `label` is one word. The prop is now
`date`, and a test renders the registered modal the way the wrapper
does.

Closes #13037

AI-assisted-by: claude-opus-5-5
2026-11-18 13:04:55 +01:00
Álvaro Tejero-Cantero
a84d76d397
🐛 Stop camelCase svg attributes from breaking files (#13132)
* 🐛 Validate the shapes of a page added by an update-file change

The backend validates every shape an `:add-obj` or a `:mod-obj` change
writes, but an `:add-page` change carries a whole page and its shapes
reached the file unchecked. Duplicate page and the undo of a page
deletion send that page as the client holds it, so a tab that loaded a
file before a migration ran could write the old format back into it.
A tab opened before #12006 deployed holds camelCase svg attr keys such
as `:fillRule`, and the closed `:svg-attrs` schema rejects them. The
file saves, and the next read that migrates it fails the file data
check, so the whole file stops opening (#13107).

`:add-page` now validates each shape of the page on the backend, as
`:add-obj` does for one.

AI-assisted-by: claude-opus-5-5

* 🐛 Rerun the svg attr normalization on files that recorded 0035

Files that recorded migration 0035 never run it again, so camelCase
svg attr keys written after it ran stay in the file. A tab that loaded
a file before 0035 ran could save such keys through an `:add-page`
change, and the closed `:svg-attrs` schema then rejects the whole file
on its next migrating read (#13107).

The svg attr normalization now runs under the id
`0037-fix-shape-svg-attrs-and-defs`, and the 0035 id leaves
`available-migrations`, as 0021 did when 0035 replaced it. Every file
that recorded 0035 migrates again. Kebab input passes through
unchanged, so the rerun touches only the keys written after 0035.

AI-assisted-by: claude-opus-5-5

* ♻️ Move the 0037 migration tests to their own namespace

The svg-attr migration was renamed to 0037, but its tests stayed in
the 0035 test namespace under migration-0035-* names. Move the whole
section to files_migrations_0037_test.cljc, register the new namespace
in the test runner, and rename its tests to match the migration id.

Replace the doseq over the two withdrawn ids with two self-contained
deftests, one for 0021 and one for 0035. No production code changes.

AI-assisted-by: hy4-flash-free

* 🐛 Keep the log watch installed until the rejection record arrives

The logger swaps the record on an executor thread, after the call that
logged it returns. The test removed the watch in the `finally` around
`update-file` and only then polled for the record, so under load the
record landed on nobody and the test read a nil `:attempts`.

AI-assisted-by: deepseek-v4.1-flash

* 🐛 Count only update-file calls in the save-test transport log

The mocked transport is installed with `set!` and outlives the fixture: a
timer another module left pending can still reach it mid-test, as a
`:delete-file-object-thumbnails` call did in CI. Filter to the only
command persistence sends, `update-file`, so a stray call neither fails
the emptiness assertion nor releases a `wait-for` on a save.

AI-assisted-by: deepseek-v4.1-flash

---------

Co-authored-by: Andrey Antukh <niwi@niwi.nz>
2026-11-18 11:39:32 +01:00
Luke Lau
d563444985
✨ Delay building schemas in check-fn in release builds (#12711)
* ✨ Delay building schemas in check-fn

check-fn eagerly builds its schemas which contributes to the startup time. But
we can delay this to when the check function is actually called, which seems to
be when an edit is made. On the Travel A2B - Locofy Sample project file this
reduced the time to the first viewport render by ~15%.

* ✨ Make schema resolution lazy only on production builds

Add a lazy-delay macro that defers the expression only on builds that
set the app.common.data.macros/lazy-delay? closure define, and use it
in check-fn to resolve the schema.

The previous change made the schema resolution unconditionally lazy,
which hid wrong schema definitions until the first check call. With
this change development builds, tests and storybook resolve the schema
when the namespace loads, so a bad definition fails early, and
production builds keep the deferred resolution and the startup win.

The define is enabled in the release builds of frontend (main and
worker), exporter and library. On the JVM the expression is always
evaluated immediately.

AI-assisted-by: deepseek-v4.1-flash

---------

Co-authored-by: Andrey Antukh <niwi@niwi.nz>
2026-11-18 11:36:33 +01:00
Andrey Antukh
3f6c69bb6a Merge remote-tracking branch 'origin/staging' into develop 2026-11-18 09:32:49 +01:00
Eva Marco
01ceba34ec
♻️ Give the team hero and recovery page links a real href (#12708)
* ♻️ Give the Team management link in the team hero a real href

"Team management" in the "Team up!" notice of a team's Projects page was
an <a> without href. It now links to the team Members page; a plain click
still runs the in-app navigation (prevent default), and Ctrl/Cmd-click
opens the link in a new tab.

New visual test "Shows the Team management link": 0 px of difference at
rest and on hover.

AI-assisted-by: claude-opus-5-5

* ♻️ Give the Go to login link of the recovery page a real href

"Go to login" on the password recovery page was an <a> without href. It
now links to the login page; a plain click still runs the in-app
navigation (prevent default), and Ctrl/Cmd-click opens the link in a new
tab.

New visual test "Shows the Go to login link": 0 px of difference at rest
and on hover.

AI-assisted-by: claude-opus-5-5
2026-11-18 09:22:07 +01:00
Eva Marco
1a355958a4
♻️ Give the team page section links a real href (#12705)
Members, Invitations, Webhooks and Settings in the team page header
were <a> elements without href: the keyboard could not reach them and
they could not open in a new tab. Each one now links to its section; a
plain click still runs the in-app navigation (prevent default), and
Ctrl/Cmd-click opens the link in a new tab. The current section gets
aria-current="page".

They keep their look: the "Team header menu" visual test gives 0 px of
difference at rest and on hover.

AI-assisted-by: claude-opus-5-5
2026-11-18 09:21:14 +01:00
Florian Schrödl
cdfbff7c53
🐛 Fix active themes in token export and the empty file import error (#13123)
* 🐛 Fix token export writing the wrong active themes

The export passed only the tokens library, so the active themes and
sets in `$metadata` were the ones of the imported file, kept in the
library, instead of the ones activated in the file. The multi-file
export now needs the file's status, so no caller falls back to them.

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>

* 🐛 Say no tokens were found when importing a file without tokens

Importing `{}`, or a JSON file without any token, said the token data
was invalid.

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>

---------

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
2026-11-18 09:19:55 +01:00
Pablo Alba
73e7815817
🐛 Make execute_code wait for save before success (#13027)
* 🐛 Make execute_code wait for save before success

* 🐛 Address review feedback on waitForSave

Reject with an Error carrying a `code`: save-timeout, rolled-back,
save-retrying, or the failure code (save-failed by default). Lower the
default timeout from 90s to 60s, leaving room for the 30s layout wait
and the code under the MCP tool timeout.

When persistence is already in error at the start of the wait, keep the
stored failure code, and tell a failure Penpot keeps retrying apart from
one that needs the file reopened.

Share timeout validation with waitForLayoutUpdate through
app.plugins.utils, and make reject-not-valid reject with an Error, which
also fixes the string rejections of connectLibrary, restore, remove,
pin, export, findVersions and saveVersion.

The MCP execute_code handler now waits for the save only when the
workspace is ready, like the layout wait, so dashboard calls no longer
fail on a save error from an earlier file.

Move the waitForSave tests to frontend-tests.plugins, add tests for the
error codes, the retrying state and a failure during the wait, and add
plugin API suite and MCP handler tests. Update the docs, CHANGELOG and
the generated API files.

AI-assisted-by: claude-opus-5-5
2026-11-17 22:35:37 +01:00
Elena Torró
14b9d77e9f
🐛 Fix duplicated suffix on single-file WASM exports (#13125) 2026-11-17 17:39:04 +01:00
Belén Albeza
dd83c668cc
🐛 Fix UX error handling (wasm) (#13100)
* 🐛 Show the error page for critical WASM errors

Since #8651 the :wasm-error handler showed the error page for :panic
only, so a :wasm-critical error (a WASM trap with no error code) fell
through to a toast and the user kept working on a broken renderer.

Only the codes in recoverable-wasm-codes now show a toast: :non-blocking
from Rust, plus :wasm-reload-context-failure and :viewer-canvas-failed,
raised by the frontend. Any other code shows the error page. This covers
errors from the render loop, event handlers, promises and store events;
errors thrown inside React effects still reach the error boundary.

The h/call docstring now describes what it does: it always throws.

Closes #12990

AI-assisted-by: claude-opus-5-5

* ✨ Add a guard for React effects that call WASM

React sends any error thrown in an effect, or in its cleanup, to the
error boundary at the app root, which replaces the whole workspace with
the error page. That holds even for recoverable WASM errors, which
should only show a toast.

errors/wrap-wasm-effect runs an effect fn and the cleanup fn it
returns. A recoverable WASM error goes to on-error (toast); any other
error is rethrown, so it still reaches the boundary. The macro
with-wasm-effect wraps mf/with-effect with it.

The macro lives in its own namespace, app.main.ui.hooks.wasm-effect:
app.main.ui.hooks cannot require app.main.errors, because the renderer
loads it and that makes a circular dependency.

AI-assisted-by: claude-opus-5-5

* 🐛 Show a toast for recoverable WASM errors in the viewport

A recoverable WASM error thrown inside a viewport effect reached the
React error boundary, which replaced the whole workspace with the
error page.

Every viewport effect that calls WASM in its body or cleanup now uses
with-wasm-effect, so a recoverable error shows a toast and the
workspace stays; panics and critical errors still show the error page.
Effects that call WASM only from a listener, ts/asap or ts/raf keep
mf/with-effect: those errors never reach React.

AI-assisted-by: claude-opus-5-5

* 🐛 Show a toast for recoverable WASM errors in the text editor

The WASM text editor calls WASM from two React effects: on mount (select
all, render) and in the first caret blink. A recoverable error there
reached the error boundary and replaced the workspace with the error
page.

Both effects now use with-wasm-effect. The mount effect also guards its
select-all and render step on its own: it opens an undo transaction
with no timeout first, and without that inner guard a recoverable error
would stop the effect before it returned the cleanup that commits the
transaction and disposes the WASM editor.

AI-assisted-by: claude-opus-5-5
2026-11-17 16:37:27 +01:00
Miguel de Benito Delgado
6043edb95a
♻️ Share WASM modifier bindings (#13016)
- Extract modifier encoding and FFI operations into common bindings
  for renderer benchmarks and application callers.
- Keep readiness checks and render scheduling in the frontend API.
- Release propagation output after decoding failures.
- Cover payload ownership, heap growth, snapping and interactive
  lifecycle behaviour with shared fixtures and integration tests.

AI-assisted-by: gpt-6.1-sol, deepseek-flash
2026-11-17 13:28:33 +01:00
Florian Schrödl
94b13d08fe
✨ Read and write token files with the tokenscript package (#12481)
Token import and export move to tokenscript.document.read and
tokenscript.document.write in the tokenscript-interpreter package
(penpot/tokenscript-interpreter#4).
tokens-lib keeps an adapter that maps its documents to a TokensLib and
back: penpot's token types, the keys of composite values and the
activation of themes and sets. About 600 lines of format detection,
legacy rewriting and tree walking go.

- Imports read DTCG 2025.10 files: {value, unit} dimensions, color
  objects in their color space (oklch(l, c, h)), the fontFamily and
  fontWeight type names, $root, $extends and $ref aliases. Legacy and
  DTCG nodes can be mixed in one file.
- What penpot does not store is dropped and listed in one warning
  toast: $extensions, $deprecated, group descriptions, values the
  reader cannot use (such as a Rec. 2020 color without hex), groups
  whose $extends fails and tokens of types penpot does not have.
- Sets a theme marks disabled are no longer part of the theme, and
  activating a theme deactivates the other themes of its group.
- Exports are unchanged by default. export-dtcg-json and
  export-dtcg-multi-file take {:profile :dtcg} for 2025.10 values and
  types. Such a file reads back with the DTCG types: spacing and
  sizing tokens come back as dimensions.
- The package moves from frontend/deps.edn to common/deps.edn, since
  the backend and the SDK read and write token files too.

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
2026-11-17 13:04:45 +01:00
Pablo Alba
e0832335c7
🐛 Keep text mounted until its measurement settles (#13097)
The text measurement in update-text-shape used ->> with p/catch. But
p/catch takes the promise first, so the handler was read as the promise.
The call then returned a promise that resolved to the handler function at
once. Measurement errors were never logged, and a failed measurement was
left as an unhandled rejection.

The caller ran p/finally right away, so the text left the pending set and
its :text-measure reflow task closed before it was measured. The text
could then unmount: the measurement read a detached node, got a zero rect
and skipped resize-text. waitForLayoutUpdate could also resolve before
the text was measured. This bug came in with #9898.

Use p/merr instead, which takes the function first. It logs the error and
resolves to nil, so the promise settles only when the measurement does.

Tests check that the promise stays pending until the measurement settles,
that the measurement then completes, and that a failed measurement
resolves to nil.

AI-assisted-by: claude-opus-5-5
2026-11-17 12:48:19 +01:00
Juan de la Cruz
81c2408470
✨ Add scale options panel to the right sidebar (#12453)
* ✨ Extend combobox icons and input handling

Allow a combobox to show a fallback icon when no option provides one.
Clear delivered input values so unmounting does not emit them again.

AI-assisted-by: gpt-6-luna

* ✨ Add scale options panel to the right sidebar

Add scale controls for selection dimensions, presets, and anchor points.
Scale shape content around the selected anchor and preview canvas resizes.
Reset scale state when selection changes, and exit scale mode with Escape.
Cover scaling and resize previews with frontend tests.

AI-assisted-by: gpt-6-luna

---------

Co-authored-by: Luis de Dios <luis.dedios@kaleidos.net>
2026-11-17 12:33:51 +01:00
Florian Schrödl
8b8def3b6e
🐛 Fix clicking a set in the theme editor (#13067)
Clicking a set's row in the theme editor threw an assertion error and
left the set as it was: the row passed the set's name to the toggle,
which looks the set up by id. The row now uses the checkbox's handler,
so the two can't drift apart again.

The editor's set and group toggles move into pure functions next to
it, with tests. A new spec clicks a set's name to tick and untick it.

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
2026-11-17 12:11:05 +01:00
Andrey Antukh
78cfe7fa58 Merge remote-tracking branch 'origin/staging' into develop 2026-11-17 10:53:02 +01:00
Marina López
e422de62d8
🐛 Fix create team inside organization (#13106) 2026-11-17 10:44:54 +01:00
Andrey Antukh
94155508e5 Merge branch 'staging-2.19.x' into staging 2026-11-17 10:16:51 +01:00
Roshan Ramani
32d488e162
🐛 Fix swapped Move left and Move right shortcuts (#13068)
The `move-unit-left` shortcut was bound to the Right arrow and moved the
selection right, and `move-unit-right` the reverse, in both the workspace
and the path editor. Arrow keys behaved correctly, but the shortcuts panel
and the shortcut settings showed "Move left" next to the Right arrow, and
customizing "Move left" rebound the rightward move.

AI-assisted-by: claude-opus-5-5

Signed-off-by: Roshan Ramani <roshanramani.dev@gmail.com>
2026-11-17 09:45:02 +01:00
Florian Schrödl
0ae02daae9
♻️ Extract and test how tokens are applied to shapes (#13034)
toggle-token and apply-token-from-input each worked out inside the
event which attributes a token goes on, and repeated most of it. The
decision now lives in pure helpers both events share: `toggle-action`
(remove the token or apply it), `apply-action` (on which attributes)
and `target-shapes` (a selected group stands for its children).
`action->event` turns the result into the event to run. Nothing
changes in behavior; apply-spacing-token-separated loses its `attr`
option, which every caller left empty.

Unit tests cover the decision, with the cases the store tests
lacked: a color token comes off the stroke too, a shape without the
token completes the others, and a spacing token on chosen attributes.
Store tests cover what had none: applying from the fill and stroke
rows, the opacity, position and size fields, the min width of a flex
child and the selection colors, choosing the token a shape already
has, and toggling a token on a group.

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
2026-11-17 09:31:47 +01:00
Elena Torró
1068421d0b
🐛 Keep the drop index when moving a child to the end of a flex layout (#13098)
Closes #12929

AI-assisted-by: claude-opus-5-5
2026-11-17 08:48:20 +01:00
Elena Torró
a050a21fae
🐛 Omit board fill on WASM export when Show in exports is off (#13073)
Send the flag to render-wasm and drop the root's fills while it renders.

Closes #12930

AI-assisted-by: claude-opus-5.5
2026-11-17 07:58:10 +01:00
Andrey Antukh
57b9b8463b
🐛 Keep app booting when SES bootstrap fails (#13085)
* 🐛 Keep app booting when SES bootstrap fails

Wrap repairIntrinsics in a guarded bootstrap so a SES Temporal check failure
no longer aborts bundle evaluation and blanks the whole app. When it fails,
plugins and MCP stay unavailable for that session, a telemetry event reports
the error, and trying to open a plugin shows an environment warning.

Add vitest coverage for both bootstrap paths and a CLJS regression test for
the runtime-unavailable toast.

Closes #12924

AI-assisted-by: hy4-flash-free

* 🐛 Fix CI format check and plugin test entry point

Wrap the long Prettier line in bootstrap.spec.ts so `pnpm run format:check`
passes again in the plugins module, and document that the duplicated SES
options are an intentional contract snapshot.

Switch the runtime-unavailable CLJS test to the public open-plugin! entry
point instead of the private load-plugin! function. The M2 test for
signal-runtime-ready was dropped: loading app.plugins in the Node test
runner needs packaging and DOM shim changes outside this fix.

Closes #12924

AI-assisted-by: hy4-flash-free
2026-11-16 17:52:55 +01:00
Andrey Antukh
d97972c81d
🐛 Build the SSO redirect target on the server (#12952)
* 🐛 Build the SSO redirect target on the server

The organization SSO flow took the destination URL from the client and
redirected to it after the identity provider round-trip, so any
authenticated profile could point that redirect at another domain: the
server never checked where the URL came from.

The RPC now takes the route token of the client (?screen=...&params)
and the server builds the destination out of it: the public URI plus
the query string, parsed and rendered back. The destination can no
longer leave the public URI, and the callback checks it again before
redirecting, which covers the state tokens minted before the change.

The state token also carries the profile that started the flow, so
only that session is granted the organization SSO entry: a state
prepared by someone else cannot mark the session of the one that
completes it. Whenever the RPC receives an organization id (it always
comes from the client), it also checks that the profile is a member of
the organization or its owner, instead of letting any profile start a
flow for an organization it does not belong to.

Tests cover the destination builder, a callback that ignores a
destination outside the public URI, a state that does not grant the SSO
entry to another session, and the organization access check.

AI-assisted-by: minimax-m3.1-flash

* 🐛 Check the SSO redirect target against the public URI

The callback compared the destination with a string prefix, so the two
bypasses the advisory documents (a userinfo prefix and a look-alike
host) were closed only by the trailing slash of the public URI. The
check now compares the parsed origin (scheme, host case-insensitive,
port with the default made explicit) and requires the path to be under
the base path of the public URI, so neither bypass passes.

The client sent `location.search`, the history token, whose leading `?`
is URL syntax and no part of a query string. It sends the query string
proper now (`screen=…&params`) through `rt/get-current-query-string`,
and `rt/token->query-string` is the single bridge between the two
shapes: every other consumer concatenates the token over the base path.
The server puts the separator back when it joins the destination, and
trims one that still arrives, so a browser holding the previous bundle
keeps its destination while the new one rolls out.

Building the destination can no longer break the flow: it catches its
own errors and lands on the public URI, which matters in the
deployments where the browser origin differs from the configured one.
A value that is not a route is ignored with a warning, decided by the
keys it parses into (a URL becomes a single key holding the whole URL),
and a route with no `screen`, like the root params of the application
(`template=…`), stays a usable destination.

The organization membership lookup is now shared by the check that
gates the SSO flow and the one that raises, so the two cannot drift
apart, and the docstring of the RPC lists `:no-organization-access`
next to `:no-team-access`.

`rt/nav-raw` returns its `:href`/`:uri` through `@event`, as its
sibling `rt/navigate` already did. Nothing in the app listens to
`::rt/nav-raw`, so the callers behave the same; the SSO test now reads
the destination from the event instead of intercepting the helper.

Tests cover the two bypasses and the base-path rule, the RPC with an
unusable destination, the value that is not a route, the request that
carries both ids, an organization that does not exist, the query string
the frontend sends, and the two router helpers.

AI-assisted-by: minimax-m3.1-flash

* ♻️ Deduplicate SSO destination URL building

The backend had an unreachable blank check and a one-line wrapper around
the URI helper in build-dest-url. On the client, the SSO retry and error
flows each assembled the destination from public-uri and the route params.

Flatten build-dest-url with a cond and call u/query-string->map directly.
Add rt/token->url as the single client helper for absolute route URLs, with
tests for both token shapes and for a blank token. Update the routing memory
with the new helper contract.

AI-assisted-by: hy4-flash-free
2026-11-16 17:34:49 +01:00
Florian Schrödl
699f79c693
♻️ Extract the token group's pill click and open sections (#12795)
Move what the token group works out into pure functions with tests:
whether a type's section is open, whether a text is being edited, and
what clicking a token pill does. Nothing changes in behavior.

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
2026-11-16 16:14:57 +01:00
Eva Marco
82421f9729
🐛 Show resolved value when opening an alias token edit form (#13038)
* 🐛 Show resolved color in alias token edit form swatch

The color token form opened every alias token with an empty swatch.
The resolved value only reached :color-result once the value field
was touched, so the swatch had nothing to show on open.

Keep the resolved color for the swatch when the field is untouched,
without showing the "resolved value" hint. Add an e2e test that loads
a fixture with a color token and an alias to it.

Closes #12672

AI-assisted-by: claude-opus-5-5

* 🐛 Show resolved value when opening an alias token edit form

The token edit form only showed "Resolved value" after typing in the
value field: the single-value inputs dropped the first resolution while
the field was untouched, and the typography/shadow reference field read
its first value from [:value :reference], which an alias token does not
have (its value is the reference string).

Show the hint on open when the resolved value differs from the written
one, so a plain `16` gets no `Resolved value: 16`. Start the reference
field stream with the alias string. Extend the e2e fixture with font
size and typography aliases and add a test for them.

Closes #12788

AI-assisted-by: claude-opus-5-5
2026-11-16 16:00:18 +01:00
Andrey Antukh
d2dfc09495
🐛 Carry the team id in every team scoped navigation (#12963)
* 🐛 Carry the team id in every team scoped navigation

The eleven `go-to-*` helpers of `app.main.data.common` resolved the
team with a plain `or` against `:current-team-id`, or read that key
alone, so an event emitted while no team was initialized built a
dashboard or workspace route without a `team-id`. `team-container*`
raises `:not-found :invalid-team-id` for such a route and
`exception-section*` does not report `:not-found`, so the user landed
on the not-found page and PostHog never saw it.

Add `resolve-team-id`, which falls back to the team of the route
already on screen and then to the profile `:default-team-id`. The
route goes first on purpose: an emitter that runs from a team screen
knows which team the user is looking at, and the personal team would
open their file under another team. The `:default` sentinel keeps its
meaning. With none of the four the helper still navigates with a nil
id, which is the documented last resort.

Harden the team-container test at the same time: it now renders the
same component with the store team the caller wants, captures markup
and errors per render, unmounts the root from a `finally`, and covers
the guard that compares the route id with the store team. React
reports a hook-order violation through `console.error` and recovers,
and only when a render adds hooks, so the harness captures that too
and the "id leaves" direction stays a guard test.

Closes #12962

AI-assisted-by: deepseek-v4.1-flash

* ♻️ Measure the navigation tests by termination

The `emitted` helper of `common_test` waited for the first event, with a
budget of 50 macrotasks, so a helper that emitted anything before its
navigation could be disposed early, and a helper that stopped closing
its stream passed on the first event. Wait for termination instead:
`async/observe` over a subject, and make `go-to-dashboard-search`
complete by pushing the `::rt/navigated` it listens for, which is the
event it waits for in the app to focus the search box. Every helper of
the family is measured the same way now, `-search` included.

`nav-params` returns nil when no navigation matched instead of calling
`deref` on nil, as its docstring promised. Add the mirror test for the
`:default` sentinel of `go-to-dashboard-deleted`, the second copy of
the branch that `-recent` already had covered.

Correct two memories: the resolver decides for every team scoped
helper, not for every `go-to-*` and not alone, since two direct
`rt/nav` emitters are the residual; and `(rx/empty)` is for a stream
that must not emit, not for one that must stay open.

Relates to #12962

AI-assisted-by: deepseek-v4.1-flash
2026-11-16 15:42:43 +01:00
Andrey Antukh
6e4e69c339
🐛 Read the media and thumbnails of a package one at a time (#13024)
The analysis of a package reads the metadata of every media and
thumbnail of its container to attribute the shared objects to each
file. It read them all at once, one promise per entry, and the
container of a big file holds thousands of them: every read opens its
own decompression stream, and Chromium fails the whole analysis under
that load while Firefox keeps up. The failure is masked by zip.js with
a generic "Cannot close a ERRORED writable stream".

The references now go through an observable, one entry at a time, and a
reference that cannot be read leaves its file without a size instead of
failing the package: a number that misses one of the objects of the
file is worse than no number.

Closes #13022

AI-assisted-by: deepseek-v4.1-flash
2026-11-16 15:42:15 +01:00
María Valderrama
c0f746ee34
🐛 Apply the invite policy to pending invitations (#13080)
* 🐛 Apply the invite policy to pending invitations

* 📎 Code review
2026-11-16 15:38:07 +01:00
Marina López
ba0eab57ab
🐛 Hide team plan from every member when owner has Enterprise (#13079) 2026-11-16 14:55:54 +01:00
Luke Lau
a224608a0e
⚡ Memoize boards with grids in frame-grid* (#13075)
On a test file `mem_benchmark` with 30k boards on one page, around 11ms is
spent each time the view is panned/zoomed iterating over each board and
checking has-grid?, which after https://github.com/penpot/penpot/pull/12790 is
now slightly slower because it involves an array scan.

We don't need to compute the list of boards with grids on every step of the pan
and can memoize it, which saves 30k calls to has-grid? on each frame.

AI-assisted-by: claude-opus-5-5
2026-11-16 14:32:10 +01:00
Luke Lau
bbaebfb146
🐛 Send the team's custom fonts to the worker (#13044)
The worker draws local exports and looks custom fonts up in its own store
to find their files. Only the main thread fetches the team's fonts, so the
worker's store had none, and exports drew text set in a custom font with
the fallback font.

The main thread now sends the worker the team's fonts each time they
change, and the worker keeps them in its store.

AI-assisted-by: claude-opus-5-5
2026-11-16 13:53:43 +01:00
Luke Lau
1ccb9e9cb9
⚡ Move WASM component thumbnail rendering to the worker (#13046)
This PR moves component thumbnail rendering off the main thread
and onto the worker, which avoids the freezes.

The main thread will send the worker over a request containing the component's
shape data, and the worker will render it in batches. Once finished it will
both persist the thumbnails to the server if requested and send back the PNG
data to the main thread.

AI-assisted-by: claude-opus-5-5
2026-11-16 13:48:04 +01:00
Belén Albeza
b0dbbe8285
🐛 Fix blurry file thumbnails rendered with render-wasm (#13026)
The wasm path drew file thumbnails on a 252px wide canvas, wrapped the
PNG in an SVG and sent it to the rasterizer, which scaled it up to its
default 300px width. The result was blurry on the dashboard on high-DPI
screens and in the link preview card.

Render the wasm thumbnail at 600px wide, twice the old size, and upload
the canvas PNG as is, without the rasterizer round trip. The SVG render
path keeps its current size.

Closes #13025

AI-assisted-by: claude-opus-5-5
2026-11-16 13:32:38 +01:00
penpot-renovate[bot]
99497d3b7c
⬆️ Update dependency pnpm to v12.21.0 (#13063)
- pnpm 12.21.0 (docker/images/Dockerfile.media-processor)
- pnpm 12.21.0 (docker/images/Dockerfile.mcp)
- pnpm 12.21.0 (docker/images/Dockerfile.exporter)
- pnpm 12.21.0 (docker/devenv/Dockerfile)
- pnpm 12.21.0 (render-wasm/package.json)
- pnpm 12.21.0 (plugins/package.json)
- pnpm 12.21.0 (plugins/libs/plugins-styles/package.json)
- pnpm 12.21.0 (plugins/libs/plugins-runtime/package.json)
- pnpm 12.21.0 (plugins/libs/plugin-types/package.json)
- pnpm 12.21.0 (plugins/apps/table-plugin/package.json)
- pnpm 12.21.0 (plugins/apps/rename-layers-plugin/package.json)
- pnpm 12.21.0 (plugins/apps/poc-tokens-plugin/package.json)
- pnpm 12.21.0 (plugins/apps/poc-state-plugin/package.json)
- pnpm 12.21.0 (plugins/apps/plugin-api-test-suite/package.json)
- pnpm 12.21.0 (plugins/apps/lorem-ipsum-plugin/package.json)
- pnpm 12.21.0 (plugins/apps/icons-plugin/package.json)
- pnpm 12.21.0 (plugins/apps/example-styles/package.json)
- pnpm 12.21.0 (plugins/apps/e2e/package.json)
- pnpm 12.21.0 (plugins/apps/create-palette-plugin/package.json)
- pnpm 12.21.0 (plugins/apps/contrast-plugin/package.json)
- pnpm 12.21.0 (plugins/apps/composable-test-suite/package.json)
- pnpm 12.21.0 (plugins/apps/colors-to-tokens-plugin/package.json)
- pnpm 12.21.0 (package.json)
- pnpm 12.21.0 (media-processor/package.json)
- pnpm 12.21.0 (mcp/packages/server/package.json)
- pnpm 12.21.0 (mcp/packages/plugin/package.json)
- pnpm 12.21.0 (mcp/packages/common/package.json)
- pnpm 12.21.0 (mcp/packages/browser-extension/package.json)
- pnpm 12.21.0 (mcp/package.json)
- pnpm 12.21.0 (library/package.json)
- pnpm 12.21.0 (frontend/text-editor/package.json)
- pnpm 12.21.0 (frontend/packages/ui/package.json)
- pnpm 12.21.0 (frontend/packages/mousetrap/package.json)
- pnpm 12.21.0 (frontend/packages/draft-js/package.json)
- pnpm 12.21.0 (frontend/package.json)
- pnpm 12.21.0 (exporter/package.json)
- pnpm 12.21.0 (docs/package.json)
- pnpm 12.21.0 (common/package.json)
- pnpm 12.21.0 (backend/package.json)

Signed-off-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com>
2026-11-16 13:15:48 +01:00
Andrey Antukh
86eb0bf805 Merge remote-tracking branch 'origin/staging' into develop 2026-11-16 11:07:05 +01:00
Andrey Antukh
7ef8c1cf36 Merge remote-tracking branch 'origin/staging-2.19.x' into staging 2026-11-16 10:05:00 +01:00
Andrey Antukh
635f7fc914
✨ Disable the admin-console by default in the devenv frontend (#13061)
* ✨ Disable the admin-console by default in the devenv frontend

The devenv does not run the admin-console service, but the frontend
showed its UI by default. The devenv containers now build the
frontend with PENPOT_DEVENV=true, which prepends disable-admin-console
ahead of the developer's config.js flags. Flags parse in order, so
enable-admin-console in config.js re-enables it; builds outside
devenv are unchanged.

Closes #13060

AI-assisted-by: inkling-2-small-free

* 📚 Require English in all code-facing text

Add a hard rule to AGENTS.md: everything in code must be in
English — identifiers, comments, docstrings, test descriptions,
log hints — with tests not excepted. The only allowed place for
another language is product copy rendered through the i18n
system. Also restated in mem:clojure/design-rules and mem:testing.

AI-assisted-by: inkling-2-small-free
2026-11-16 09:54:23 +01:00
Pablo Alba
77c87d16f1
🐛 Keep variant property order past eight properties (#13014) 2026-11-16 09:30:29 +01:00
Eva Marco
fa6af23d75
🐛 Disconnect a library that fails to load instead of breaking the file (#13048)
Opening a file connected to a broken shared library showed the
"Internal Error" page: every connected library was loaded in a single
stream, so one failing get-file broke the whole workspace.

Catch the error per library. When the backend fails to load it (a
server error, never a transport or transient error), a directly
connected library is disconnected and a toast tells the user; an
indirect one is only dropped from the state.

Closes #12429

AI-assisted-by: claude-opus-5-5
2026-11-16 09:02:31 +01:00
Filip Sajdak
557774e4f4 🐛 Call the team hook on every render of the team container (#12920)
team-container* called mf/deref only after returning early for a team id
that is not a uuid. When the same component rendered once without a team
id and then with one, the number of hooks changed between the two renders
and React threw "Rendered more hooks than during the previous render"
(error #310), which sent the user to the internal error page. The reverse
order throws "Rendered fewer hooks than expected".

Call the hook on every render and keep the uuid check in the condition
that builds the providers.

Two tests mount the component in jsdom and render it with a team id that
arrives and with one that leaves; both fail without this change.

Closes #12728

AI-assisted-by: claude-opus-5-5
AI-assisted-by: claude-sonnet-5-5

Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>
2026-11-16 08:41:22 +01:00
Marina López
bde53b4696
🐛 Hide team plan for standalone enterprise owners (#13047) 2026-11-13 14:16:30 +01:00
Eva Marco
b2c4b58b27
🐛 Keep the pages panel scroll when switching pages (#13004)
Switching pages swaps the workspace content for a loader until the new
page is ready, so the whole left sidebar mounts again. The pages list
started at the top and the selected page scrolled into view at the
bottom of the panel, even when it was already visible.

The sidebar scroll store now lives in workspace-inner*, which stays
mounted across page switches. The pages panel saves its scroll there and
restores it before the selected page scrolls into view. The layers,
assets and tokens panels keep their positions across page switches too.

Closes #13002

AI-assisted-by: claude-opus-5-5
2026-11-13 14:11:30 +01:00
Andrés Moya
0e4be21320
🐛 Ensure component name always matches root instance name (#12794)
* 🐛 Remove svg extension when creating a component from a svg file

* 🐛 Normalize root names to always match the component name

* ✨ Remove any extension ignoring case, not only .svg

* 🔧 Add some fixes and checks

* 🔧 Improve rename detection
2026-11-13 13:53:28 +01:00
Marina López
bb4556b705
🐛 Persist promotional banner collapse (#13040) 2026-11-13 13:07:05 +01:00
andrés gonzález
097ff41e03
✨ Send telemetry for WebGL renderer failures (#12987)
* ✨ Send telemetry for WebGL renderer failures

WebGL renderer failures left no trace in the audit log, so we could not
tell why people switch WebGL off.

- Send webgl-unavailable when the "WebGL is not available" modal shows,
  with the init error.
- Send webgl-context-lost, webgl-context-restored and webgl-reload-failed
  from the WASM renderer.
- Add the active renderer (wasm or svg) to handled-exception,
  unhandled-exception, exception-page and open-workspace-file.
- Add environment details to the WebGL events and to
  enable/disable-webgl-rendering: normalized GPU family and backend, max
  texture size, device memory, CPU cores and whether the app runs inside
  Electron. The full GPU renderer string is not sent, as it can help
  fingerprint a device.

Closes #12984

AI-assisted-by: claude-opus-5-5

* ⚡ Avoid throwaway WebGL contexts in renderer telemetry

WebGL events no longer create a context to read GPU details; the
settings, menu and unavailable modal create one at most once.

AI-assisted-by: claude-opus-5-5

* 🐛 Refresh remembered GPU details on each renderer init

A restored context can run on another GPU, so read it on every init
instead of only the first one.

AI-assisted-by: claude-opus-5-5

* ⚡ Never create a WebGL context for renderer telemetry

WebGL events send GPU details only when the renderer has already read
them on init, instead of probing a throwaway context.

AI-assisted-by: claude-opus-5-5

---------

Co-authored-by: Elena Torro <elenatorro@gmail.com>
2026-11-13 11:59:12 +01:00