24867 Commits

Author SHA1 Message Date
Francis Santiago
617e56b71e
Merge pull request #13153 from penpot/fc-issue-done-status-automation
✨ Route completed issues by QA requirement
2026-11-18 16:29:49 +01:00
Francis Santiago
b488f6b2df ✨ Route completed issues by QA requirement
Set issues with the team-qa label to Ready for QA.
Set all other completed issues to Product Review.
2026-11-18 16:15:13 +01:00
Luke Lau
5166b8d5ea
⚡ Avoid iterating over every object in frame-titles* (#13089)
* ⚡ Avoid iterating over every object in frame-titles*

Similarly to #13075, frame-titles* used to iterate over every object to work
out the frames at the root that need titles.

For files with lots of objects this can be slow, but we can just get the root
frames by looking at the root object's children.

We need to remove non-main-component instances to copy the behaviour of
`get-frame-ids :skip-copies? true`. This also now causes the title to be drawn
on a child frame whenever it's focused.

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

* 🐛 Don't show frame title on focused frames

Restores the existing behaviour when focused
2026-11-18 15:17:44 +01:00
Yamila Moreno
dedd435db5
🔧 Add PRs to status tech-review (#13152)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-18 14:59:46 +01:00
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
Andrey Antukh
aa12e52081
⬆️ Update the system dependencies of the devenv and the images (#13144)
* ⬆️ Bump the JDK to 27.0.1.1 on devenv and the backend image

The devenv image compiled the backend bundle with JDK 27 while the
production image ran JDK 26. The runtime starts with --enable-preview,
so a runtime line behind the compiler line is a silent trap rather than
a working setup.

Both pins now use Zulu 27.0.1.1 (zulu27.30.201-ca), the current GA of
the line, with the same sums on both architectures. The jlink module
list in the backend image still resolves on 27, so it does not change.

Sums checked by downloading both tarballs; the jlink JRE built from
them starts and reports 27.0.1.1.

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

* 🔥 Remove the unused gitpod setup

No workflow built docker/gitpod and its AdoptOpenJDK 16 install no
longer matches the devenv. The README badge linked to a setup that no
longer exists, so it goes with it.

The historical changelog entry stays: CHANGES.md is generated from the
milestones.

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

* ⬆️ Bring the docker/ updates from develop

Move the devenv and the production images to what develop already
carries:

- Base images to the current dhi.io digests.
- Node 24.22.3 and pnpm 12.21.0 in the devenv image and in every
  production Dockerfile that ships pnpm.
- Rust 1.99.0 and Serena 2.1.0, with SERENA_UPDATE_VERSION raised to
  match and a note that it must never be lower than the image pin.
- tini as the exporter ENTRYPOINT.

Devenv additions: PENPOT_DEVENV=true so the frontend compiles with the
admin console disabled by default, xauth and libvulkan1 plus the GPU
compose overlay, the MCP OAuth metadata route in nginx, and clipboard
support in tmux.

The JDK stays at 27.0.1.1 on both pins.

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

* ⬆️ Finish the Node 24.22.3 bump outside docker/

The docker/ import brought Node 24.22.3 into the devenv and the image
tags while .nvmrc and the two plugins-deploy workflows stayed on
24.22.2.

Node stays on the 24.x line on every site: the plugins-deploy runtime
pins follow .nvmrc, even though develop moved them to node@26.13.1 in
99db795966.

AI-assisted-by: deepseek-v4.1-flash
2.19.3 2.19.3-RC2
2026-11-18 12:51:30 +01:00
Yamila Moreno
89d5a862b5
🔧 Require milestone in PRs (#13129)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-18 11:54:01 +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
David Barragán Merino
240e757586 🐛 Size frontend nginx workers from the container CPU limit
worker_processes auto starts one worker per host CPU, ignoring the
container CPU limit, and since worker_connections went from 2048 to
65535 each worker reserves about 30 MB at startup. A frontend limited
to a few CPUs on a 64-core node needs close to 2 GB before serving a
request and gets OOM killed.

Default the worker count to the CPUs the container can use, its cpuset
and its cgroup CPU quota rounded up, when they are fewer than the CPUs
of the host, and keep auto otherwise. Make both settings configurable
through PENPOT_HTTP_SERVER_WORKER_PROCESSES and
PENPOT_HTTP_SERVER_WORKER_CONNECTIONS, and refuse to start on values
that are not valid.

Refs #13103

Signed-off-by: David Barragán Merino <david.barragan@kaleidos.net>
2026-11-18 10:51:18 +01:00
Yamila Moreno
dfc2ff6b56
🔧 Improve issue templates (#13126)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-18 10:00:39 +01:00
Andrey Antukh
3f6c69bb6a Merge remote-tracking branch 'origin/staging' into develop 2026-11-18 09:32:49 +01:00
Álvaro Tejero-Cantero
3b3669b63b
🐛 Drop map-valued svg attrs when migrating legacy files (#13130)
Files written by old Penpot versions hold maps where an svg
attribute value should be, such as a `:filter` that once read
`url(#filter_2)`. Since #12006 the `:svg-attrs` schema is closed and
admits scalars only, and migration 0035 kept those maps, so the file
data check at the end of every migration rejected the file. Such a
file can be neither imported nor opened. Two built-in templates,
Avataaars and Tutorial for beginners, are among them.

`attrs->kebab-props` now drops a value that is not a string, a number,
or a boolean, at the top level and inside `:style`. Migration 0035 and
every birth path go through it, so stored attrs match the schema.

Of the 143 files in penpot/penpot-files, 4 fail to import at
`:svg-attrs :filter` before this change, and all 4 import after it.

AI-assisted-by: claude-opus-5-5
2026-11-18 09:31:39 +01:00
Andrey Antukh
930f74218c Merge remote-tracking branch 'origin/staging-2.19.x' into staging 2026-11-18 09:29:54 +01:00
Andrey Antukh
09259623da 🔥 Remove the unused Signed-off-by validator
check_signed_off_by was never registered in the validator list, so it never
ran, and no test exercised it. The DCO sign-off applies to external
contributors through CONTRIBUTING.md, not to every commit, so the local
checker has nothing to enforce there.

Drop the function and the DCO mention in the script docstring.

AI-assisted-by: deepseek-v4.1-flash
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
2026-11-18 08:28:51 +00:00
Andrey Antukh
5c93ece9b9 📚 Slim the code review skills without losing checks
code-review-criteria and review-code carried weight that changed no
decision: a 16-row rationalizations table, red flags that repeated the axes,
and three sections written for the author of a change rather than for the
reviewer. 338 lines become 251.

Drop that layer, dedupe DRY/KISS/YAGNI between the core principles and the
axes, merge the two instruction lists of the flow, and compress the GitHub
comment format.

The reviewer no longer re-runs the suite or a build: the author's run and CI
already provide that evidence, and repeating it only made reviews longer. It
runs at most the single test file that settles a specific doubt, and states
which evidence it relied on.

AI-assisted-by: deepseek-v4.1-flash
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
2026-11-18 08:28:28 +00: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
Andrey Antukh
dce4d8fe56 ✨ Allow human co-authors in the commit checker
The checker rejected any Co-authored-by trailer, which also blocked a real
person. The trailer is meant to credit a human co-author, and git and
GitHub use it for that; only AI providers, agents and bots are unwanted.

Match the trailer value against a blocklist of providers and agents plus
bot identities, and point to the dedicated AI-assisted-by trailer for AI
participation. Co-authored-by joins the trailer exemption of the
80-character body rule.

Update the tests, CONTRIBUTING.md, the create-commit skill and the commit
memory to the new rule.

AI-assisted-by: deepseek-v4.1-flash
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
2026-11-18 08:20:43 +00: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
Yamila Moreno
d403a66122
🔧 Require milestone to issues linked to a PR (#13133)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-18 09:07:22 +01:00
penpot-renovate[bot]
a9972d5b47
⬆️ Update dhi.io/nginx image to 5f75855 (#13136)
- dhi.io/nginx 1.31.8-debian13-dev@5f75855 (docker/images/Dockerfile.frontend)

Signed-off-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com>
2026-11-18 09:05:41 +01:00
Luke Lau
14abaf93f4
⚡ Cull tile shapes to the tile instead of its whole margin (#13112)
After background blur support was added to render-wasm in 5ba53f7296,
we needed to start rendering shapes in the 256px margins of the tile,
since they contribute to the blur result.

This means that a tile may end up drawing shapes from the tiles around
it, and in the worst case we end up drawing 4x the number of shapes.

We can limit this to only the tiles that have background blur, which
significantly reduces the number of shapes drawn.

Masked groups do something similar so this generalizes and reuses the
`group_reach` stack, which stores how far past the current tile is
painted.

Before we start drawing the shapes in `render_shape_tree_partial`, we
walk the shapes in the tile to check how far the background blur
"reaches" and extend `group_reach` by just that amount, rather than
a 256px radius. As part of the generalization we also need to update
`masked_group_filter_reach` so it works on non-masked groups.

On the mem_benchmark file a full render calls render_shape 77.1% less
often. On the admin dahsboard there's 62% less. This gain shows up
particularly in interactive transforms, e.g. dragging another board
across the heroicons board goes from about 21 to 48 fps.

AI-assisted-by: claude-opus-5-5
2026-11-18 07:07:53 +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
Yamila Moreno
f65242fb00
🔧 Manage renovate PRs (#13131)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-17 19:00:05 +01:00
Elena Torró
14b9d77e9f
🐛 Fix duplicated suffix on single-file WASM exports (#13125) 2026-11-17 17:39:04 +01:00
David Barragán Merino
0915f89419 🐛 Size frontend nginx workers from the container CPU limit
worker_processes auto starts one worker per host CPU, ignoring the
container CPU limit, and since worker_connections went from 2048 to
65535 each worker reserves about 30 MB at startup. A frontend limited
to a few CPUs on a 64-core node needs close to 2 GB before serving a
request and gets OOM killed.

Default the worker count to the CPUs the container can use, its cpuset
and its cgroup CPU quota rounded up, when they are fewer than the CPUs
of the host, and keep auto otherwise. Make both settings configurable
through PENPOT_HTTP_SERVER_WORKER_PROCESSES and
PENPOT_HTTP_SERVER_WORKER_CONNECTIONS, and refuse to start on values
that are not valid.

Refs #13103

Signed-off-by: David Barragán Merino <david.barragan@kaleidos.net>
2026-11-17 16:49:09 +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
Belén Albeza
2a9b9a57cc
🔧 Set as default the flag to enable html paste in v3 (#13114) 2026-11-17 16:15:26 +01:00
Alonso Torres
eb2c8cf359
🐛 Check Host and Origin headers in the MCP server (#13117)
* 🐛 Check Host and Origin headers in the MCP server

The MCP endpoint, the REPL server and the plugin WebSocket accepted
requests with any Host and Origin header, so a web page open in the
user's browser could drive a local MCP server: connect as the plugin
and call its tools.

RequestGuard checks both headers against an allowlist and rejects other
requests with HTTP 403, or WebSocket close code 1008. The list comes
from PENPOT_MCP_ALLOWED_HOSTS, where "*" turns the check off. When it
is unset, local mode allows only loopback names and remote mode allows
any host, since remote mode relies on user tokens and has no file
access.

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

* 🐛 Keep the Host and Origin check on in single-user remote mode

The default allowlist followed remote mode, so a single-user server with
PENPOT_MCP_REMOTE_MODE=true accepted any Host and Origin. It requires no
user token either, so a web page could still drive it and run code in the
user's Penpot session. The default now follows multi-user mode: single-user
servers allow only loopback names, and multi-user servers, which rely on
user tokens, allow any host. Startup warns when the check is off in
single-user mode.

PENPOT_MCP_ALLOWED_HOSTS entries with a scheme, port or path never matched,
so every request failed with 403. The server now refuses to start and names
the bad entry.

AI-assisted-by: claude-opus-5-5
2026-11-17 16:01:49 +01:00
Andrey Antukh
e6eb8bcd5a
✨ Add pgjdbc prepared statement cache settings (#13099)
* ✨ Add pgjdbc prepared statement cache settings

Expose pgjdbc's server-side prepared statement cache as three
optional backend variables: PENPOT_DATABASE_PREPARE_THRESHOLD,
PENPOT_DATABASE_PREPARED_STATEMENT_CACHE_QUERIES and
PENPOT_DATABASE_PREPARED_STATEMENT_CACHE_SIZE (bytes, converted
to whole MiB for the driver, rounding up). When unset, the
driver defaults apply (5 executions, 256 entries, 5 MiB), so the
behavior is unchanged. The values reach Hikari as
dataSourceProperties strings, because pgjdbc only reads String
values; flushCacheOnDdl stays at its default.

Closes #13092

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

* ♻️ Sync the pool options schema with the code

The integrant pool options schema validated a ::connect-timeout
option that nothing reads, while the keys the code consumes
(::connection-timeout, ::idle-timeout, ::max-lifetime) were
missing from it. The schema now declares the three, matching the
code and the defaults map. The removed key was not referenced
anywhere else.

Follow-up to #13092.

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

* ♻️ Rename the prepared statement cache threshold setting

Keep the three knobs under one name in the configuration:

  PENPOT_DATABASE_PREPARED_STATEMENT_CACHE_THRESHOLD
  PENPOT_DATABASE_PREPARED_STATEMENT_CACHE_QUERIES
  PENPOT_DATABASE_PREPARED_STATEMENT_CACHE_SIZE

The old PENPOT_DATABASE_PREPARE_THRESHOLD read as a verb and was the only
one of the three that did not name the prepared statement cache.

Fix the documentation of the values: 0 in either cache value disables the
cache, not only the size, and -1 prepares a statement from its first
execution and forces binary transfer, which is what pgjdbc does.

Cover the -1 threshold end to end: it already decoded and validated, but
nothing proved that it reaches the driver. The tests also pin 0, so a
falsy check cannot silently drop it.

Closes #13092

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

* ♻️ Fix the prepared statement cache contracts

The threshold schema accepted any integer, but the driver clamps every
negative to -1 and turns on binary transfer, so a typo like -10 changed
the wire protocol instead of failing at boot. Both schemas now declare
{:min -1}: -1 and the non-negatives stay valid.

The tests compared our own dataSourceProperties literals with our own
literals, which cannot catch the failure the feature fears (a property
the driver ignores). They now read the threshold back from a real
connection: 5 with no options, 1 and 0 when configured. The size ceiling
is covered one byte over a MiB, and queries=0 too.

The docs, the app.db comment and the memory described the threshold 0 as
disabling the cache. It does not: 0 stops the server-side prepared
statements while the driver's cache of parsed queries stays in use,
bounded by the other two values. The same texts lost the
pg_prepared_statements pointer (the view only lists the session that runs
the query) together with the flushCacheOnDdl and PgBouncer sentences, and
the section now carries its version marker.

Closes #13092

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

* 💄 Format the prepared statement cache pool test

The continuation arguments of the two with-connection calls were aligned
under the options map instead of two spaces past the form, which cljfmt
rejects.

Local verification missed it because `./scripts/ci backend --test` runs
the tests only: lint and format are separate tasks, so the pre-push check
is the whole `./scripts/ci backend` or an explicit --lint/--fmt.

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

* ♻️ Address the review of the prepared statement cache

The pool startup line shows the three values, so the configured cache is
visible without reading the environment back; a nil means the driver
default.

bytes->mib-ceil uses Math/ceilDiv: the same rounding in one expression,
and the size schema already rejects negatives.

The cache-limit tests count a closed statement in pg_prepared_statements
instead of comparing the property literals. A closed statement stays
prepared in the server only while the driver's cache holds it, which is
what tells an accepted property from an effective one; the positive case
keeps the cache enabled with a sub-MiB size. The config test drops the
groups that only exercised the decoder and keeps the ones that pin the
accepted range.

The manual and the memory note that a query parameter of the same name in
PENPOT_DATABASE_URI wins over the variable: pgjdbc ignores the Properties
value when the URL carries it.

AI-assisted-by: deepseek-v4.1-flash
AI-assisted-by: claude-opus-5-5
2026-11-17 14:06:04 +01:00
Luke Lau
0bfcaa4109
⚡ Avoid redundant copy of tile atlas (#13104)
61cd9fe88683a4068817f538a2ae54d80aca095e stored a reference to the
last snapshot of the tile atlas, presumably to avoid the call to
image_snapshot when not needed.

But it turns out image_snapshot doesn't actually cost anything since
it just returns a reference to the surface texture. Storing the
reference actually causes a 4096x4096 texture copy because skia has
copy-on-write behaviour. Skia sees the reference stored in Surfaces,
so when the next render tries to draw on the surface it needs to
allocate + copy over the tile atlas texture.

By removing the reference skia can reuse the texture on the next
render which avoids a 64MiB copy on the GPU.

AI-assisted-by: claude-opus-5-5
2026-11-17 13:46: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
Rayen Khammar
fa1249c1a5 🐛 Reap zombie Chromium processes in the exporter container (#12969)
* 🐛 Reap zombie Chromium processes in the exporter container

The exporter runs node as PID 1 with no init process. Chromium helper
processes orphaned when Playwright closes a browser are re-parented to
node, which never reaps them, so every browser-based export left
defunct chrome-headless processes behind.

Enable init for the exporter service so Docker's built-in init runs as
PID 1, reaps the orphans and forwards signals to node.

Closes #10339

Signed-off-by: Rayen Khammar <khammarrayen4@gmail.com>

* 🐛 Move zombie reaping fix into the exporter image

Install tini and run it as the image entrypoint with -s, so orphaned
Chromium helpers are reaped in every deployment, including Kubernetes.
-s keeps tini working without a warning when it runs under docker-init
(init: true). Drop the compose init: true change to keep one mechanism.

Signed-off-by: Rayen Khammar <khammarrayen4@gmail.com>

---------

Signed-off-by: Rayen Khammar <khammarrayen4@gmail.com>
2026-11-17 11:46:19 +01:00
Rayen Khammar
445d02e012
🐛 Reap zombie Chromium processes in the exporter container (#12969)
* 🐛 Reap zombie Chromium processes in the exporter container

The exporter runs node as PID 1 with no init process. Chromium helper
processes orphaned when Playwright closes a browser are re-parented to
node, which never reaps them, so every browser-based export left
defunct chrome-headless processes behind.

Enable init for the exporter service so Docker's built-in init runs as
PID 1, reaps the orphans and forwards signals to node.

Closes #10339

Signed-off-by: Rayen Khammar <khammarrayen4@gmail.com>

* 🐛 Move zombie reaping fix into the exporter image

Install tini and run it as the image entrypoint with -s, so orphaned
Chromium helpers are reaped in every deployment, including Kubernetes.
-s keeps tini working without a warning when it runs under docker-init
(init: true). Drop the compose init: true change to keep one mechanism.

Signed-off-by: Rayen Khammar <khammarrayen4@gmail.com>

---------

Signed-off-by: Rayen Khammar <khammarrayen4@gmail.com>
2026-11-17 11:41:43 +01:00
Andrey Antukh
38a9878981
🔥 Remove the unused SQLite-based binfile v2 format (#12947)
The SQLite-based v2 binfile package was never released, and its only
caller was the developer REPL helper `app.srepl.binfile`, which exported
and imported a whole team. With the format gone, the helper, the
functions of `app.binfile.common` without a caller (`get-fonts`,
`get-file-thumbnail`, `get-team`, `get-teams`, `collect-summary`) and
the `sqlite-jdbc` dependency go with it.

The public surface does not change: the import RPC accepts only versions
1 and 3, and the test that pins the rejection of version 2 stays as it
is.

AI-assisted-by: deepseek-v4.1-flash
2026-11-17 10:59:10 +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
Andrey Antukh
1d60ba65b5 Merge remote-tracking branch 'origin/main' into staging-2.19.x 2026-11-17 10:02:29 +01:00
Pablo Alba
ea0ac02900 🐛 Fix duplicate-file crash on nil keys in deleted component objects (#13045)
* 🐛 Fix duplicate-file crash on nil keys in deleted component objects

* ♻️ Withdraw the legacy-36 migration in favor of 0036

legacy-36 and 0036-clear-nil-keys-in-objects perform the same
cleanup of nil keys in `:objects`. Migrations only clean up
invalid data here, so they carry no order dependency between
them and running both is wasteful.

Remove the legacy-36 defmethod and its id from
`available-migrations`, the same way 0021-fix-shape-svg-attrs
was withdrawn in favor of 0035. Files that recorded legacy-36
re-migrate through 0036; their persisted `:migrations` lists
keep the old id, and the playwright fixtures recording it stay
untouched.

Add a migrate-file test proving a file that recorded legacy-36
is re-armed for 0036 and passes schema validation after.
Document the withdrawal pattern in the migration subtleties
memory.

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

---------

Co-authored-by: Andrey Antukh <niwi@niwi.nz>
2.19.3-RC1
2026-11-17 09:45:48 +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