24852 Commits

Author SHA1 Message Date
Elena Torró
407ee58ddd
🐛 Fix render-wasm panic when an auto layout has only absolute children (#13146)
* 🐛 Restore the WASM stack pointer after a failed call (#12978)

A failed render-wasm call traps without popping its shadow-stack frames.
Each failure leaked stack until it overwrote static data, and from then on
every call trapped as wasm-critical. h/call now saves the stack pointer
before the call and restores it on failure.

Closes #12977
Related to #12906

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

* 🐛 Fix render-wasm panic when an auto layout has only absolute children

An auto flex or grid layout whose children were all absolute shrank to
zero, and a rotated shape below it got a matrix that cannot be inverted,
which panicked in `_propagate_modifiers`. Skip auto-size when there is
no content, as CLJS does. A matrix that still cannot be inverted is now
a recoverable error, which shows a toast instead of the error page.

Closes #12763

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

* 🐛 Count hidden children in render-wasm grid auto-size

A grid takes its size from its tracks, so, like CLJS, it skips auto-size
only when every child is absolute. Flex still skips hidden children,
since its line building leaves them out.

Refs #12763

AI-assisted-by: claude-opus-5-5
2026-11-24 12:25:19 +01:00
Alejandro Alonso
277ca546f2
⚡ Re-present the frame when the grid overlay changes (#13248)
Hovering a grid frame requested a full render. That clears the
canvas and walks every visible tile even though the overlay is
only UI. show_grid and hide_grid now re-present the last frame.
2026-11-24 12:12:39 +01:00
Belén Albeza
76adaf86b1 🐛 Count hidden children in render-wasm grid auto-size
A grid takes its size from its tracks, so, like CLJS, it skips auto-size
only when every child is absolute. Flex still skips hidden children,
since its line building leaves them out.

Refs #12763

AI-assisted-by: claude-opus-5-5
2026-11-24 10:41:11 +01:00
Belén Albeza
f807e749db 🐛 Fix render-wasm panic when an auto layout has only absolute children
An auto flex or grid layout whose children were all absolute shrank to
zero, and a rotated shape below it got a matrix that cannot be inverted,
which panicked in `_propagate_modifiers`. Skip auto-size when there is
no content, as CLJS does. A matrix that still cannot be inverted is now
a recoverable error, which shows a toast instead of the error page.

Closes #12763

AI-assisted-by: claude-opus-5-5
2026-11-24 10:41:11 +01:00
Belén Albeza
35278f3917 🐛 Restore the WASM stack pointer after a failed call (#12978)
A failed render-wasm call traps without popping its shadow-stack frames.
Each failure leaked stack until it overwrote static data, and from then on
every call trapped as wasm-critical. h/call now saves the stack pointer
before the call and restores it on failure.

Closes #12977
Related to #12906

AI-assisted-by: claude-opus-5-5
2026-11-24 10:39:52 +01:00
andrés gonzález
deffc02098
✨ Print the cause of an error in the frontend error report (#13274)
WASM errors are thrown as an ex-info whose cause is the original failure
(the trap, `RuntimeError: unreachable`, `memory access out of bounds`,
`Aborted(OOM)`). The CLJS `format-throwable` printed only the ex-data and
the stack, so the report said where a WASM call failed but never why.

Add a "Caused by:" block with the cause message, printed on its own since
only V8 starts `.stack` with it, followed by its formatted data and stack.

Relates to #12910

AI-assisted-by: claude-opus-5-5
2026-11-24 09:47:50 +01:00
Alonso Torres
3bd549a146
🐛 Stop MCP plugin tasks from throwing after the plugin closes (#13224)
Closing a plugin removes its globals (console, penpot, ...) while a task
of the MCP plugin may still be running. Under SES a removed global reads
as undefined, so the task failed at its next use of console or penpot,
and the catch handlers failed again on console.error. The rejection
reached the workspace as "Cannot read properties of undefined (reading
'error')", for tasks that succeeded as well as for failed ones.

A task that ends after the plugin closed now returns quietly. It cannot
answer: the UI iframe and its WebSocket are gone, and the MCP server
already fails the task when the plugin connection closes. The outer
catch logs through the console reference taken at load, so it cannot
throw.

Tests: PluginTaskRequest.test.ts runs TaskHandler.ts and plugin.ts in
one sandbox, removes the globals while a task waits, and checks that no
rejection escapes and no error is logged when the task ends in success or
failure. A task that fails while the plugin is open still sends its error
response.

Closes #12503

AI-assisted-by: claude-opus-5-5
2026-11-23 17:39:03 +01:00
Pablo Alba
b58f7d2996 🐛 Build each file repair on the data left by the previous ones
repair-file built every repair of a pass from the file data taken before
the pass. Repairs write whole values (a :mod-component with the whole
component, a :set with the whole :shapes vector), so two repairs on the
same component or shape attribute undid each other: the last write won,
the lost fix came back as an error, and each clash cost another pass.

Each repair's changes are now applied before the next repair is built.
A private repair-file* returns the data and the changes; repair-file
returns the changes, which give the same result when applied in order,
and repair-file-until-valid reuses the data instead of applying the
batch again (on the backend a second apply wrote an orphan page fragment).

Repairs now see what earlier repairs of the pass did, so
:ref-shape-not-found does nothing when its shape was removed or its ref
shape resolves again; it would otherwise detach a copy that an earlier
:invalid-main-instance-id repair had already relinked.

Tests stub repair-error, through a multi-arity fn so the JS build can
call it, and cover two clashing errors on one component in either order,
three missing children fixed in one pass, and repairs on removed shapes.

Closes #13239

AI-assisted-by: claude-opus-5-5
2026-11-23 16:32:58 +01:00
Pablo Alba
8d0ff7984b 🐛 Keep swapped children on switch and undo of a nested variant copy
Switching a variant copy that sits inside another copy dropped a component
swapped inside it, and the new variant showed its default child. Undoing
a variant switch also lost a swapped child: the old variant came back with
no child in that place.

When the swap was made in the copy, the original shape of the swapped
child was looked up from the nearest main, which is the copy in the outer
main, so it had no match in the variant main. Look it up from the match
of its parent in the variant main instead.

When the swap was made in the outer main, the child had no slot of its
own, so it was deleted with the old copy and never moved. The new
ctf/get-outer-swaps finds these heads by walking their ref chain up to
the variant main. The delete step and keep-touched both use it, so they
pick the same heads: kept off the delete list, moved into the new copy
and pointed to the swapped-in component, with the slot of the child they
replace. The walk that advances the refs of a subtree moves to
ctf/get-advanced-refs, which the clipboard now shares.

When the switch kept a swapped child, the undo of its move into the new
copy put it back under the old copy id. That id is also the id of the new
copy, so undoing the creation of the new copy removed the child.
change-parent now takes the undo parent from its objects, as it already
did for the previous sibling.

When the new variant had no match for a swapped child, the child was
removed with the old copy, with no undo entry. Move it to the root first
and delete it from there, after the rest of the switch, so undo brings it
back after the old copy.

Closes #13179
Closes #13181

AI-assisted-by: claude-opus-5-5
2026-11-23 16:06:09 +01:00
Alonso Torres
70c37934af
✨ Expose the file features and active renderer to plugins (#13169)
Plugins and the MCP could not tell whether the new render engine (WebGL)
or the SVG engine draws the open file.

Add file.features with the sorted features of the open file: its stored
features plus the features active in the session. render-wasm/v1 comes
from the session alone, so it is present only when WebGL draws the file,
whether the renderer comes from the wasm query param, the profile setting
or the workspace menu. The backend never stores that feature on the file,
so the stored features alone cannot answer it. For any other file, such
as a library or a File kept after opening another file, features is null.

Add penpotUtils.isWasmRenderer() to the MCP plugin and list it in the
MCP instructions. It throws a clear error when the Penpot version does
not expose the file features. Regenerate the MCP API docs, which also
picks up the missing penpot.location entry, and the plugin API test
suite surface.

Add plugin API test suite tests for the open file and for a file that is
not open. Note in the plugins memory that every new or changed Plugin API
member gets a suite test whenever the suite can reach the case.

Closes #13167

AI-assisted-by: claude-opus-5-5
2026-11-23 15:58:41 +01:00
Yamila Moreno
1edaf6baef 🔧 Improve PRs validations
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-23 12:56:49 +01:00
Alejandro Alonso
5c768aeca0
🐛 Skip WASM font checks while the renderer is not live (#13235)
Page switches tear down the WebGL canvas before openPage resolves, so
font-stored? must not call _is_font_uploaded against a null resource
pool. Guard with wasm/live? like the other font FFI helpers, and cover
the skip path with a unit test.

Closes #13205
2026-11-23 12:01:10 +01:00
Andrey Antukh
0498c68b5b Merge branch 'staging-2.19.x' into staging 2026-11-23 10:41:09 +01:00
Andrey Antukh
234a1e547b 📎 Update several skills 2026-11-23 10:40:10 +01:00
Andrey Antukh
174596db1d Merge remote-tracking branch 'origin/main' into staging 2026-11-23 10:08:15 +01:00
Andrey Antukh
1177a817ed 📚 Update the changelog for 2.19.4
Document the fix for importing large .penpot files in Chrome.

AI-assisted-by: gpt-6.2-sol
2.19.4
2026-11-23 08:50:58 +00:00
Andrey Antukh
eb0106e6fb ✨ Simplify changelog review and report label edits
Keep the release procedure in one place and separate review from GitHub
writes. Clarify how to prepare and verify release highlights.

Report each successful label edit so earlier changes remain visible if a
later edit fails.

AI-assisted-by: gpt-6.2-sol
2026-11-23 08:48:18 +00:00
Andrey Antukh
5e1e0bef34 ✨ Collect changelog inputs in one command
Gather milestone issues, pull requests, advisories, and changelog checks
into one JSON snapshot. Reuse it across the release workflow to avoid
repeating GitHub queries while keeping write actions separate.

AI-assisted-by: gpt-6.2-sol
2026-11-23 08:40:20 +00:00
Andrey Antukh
b822b38279 ⬆️ Update docker images 2026-11-23 09:39:45 +01:00
Andrey Antukh
f089c86a71 🐛 Fix changelog generation and advisory pagination
Use GitHub's cursor pagination for repository advisories and flatten the
returned pages.

Remove empty breaking-change sections and document the changelog contract.

AI-assisted-by: gpt-6-luna
2026-11-23 08:33:08 +00:00
Eva Marco
15871f3de6
🐛 Fix the disabled invite button in the empty invitations state (#13193)
* 🐛 Center the disabled invite button in the empty invitations state

The disabled button sits inside a tooltip trigger, a fit-content grid
that the text-align of the empty state does not center. Center the
trigger with auto inline margins.

Closes #13173

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

* 🐛 Make the disabled primary button label readable in the light theme

In the light theme the label of a disabled primary button used the
background secondary color on the muted accent background, so both were
almost the same. Use the tertiary accent for that label in the light
theme only, as design asked. The dark theme keeps its colors.

Closes #13171

AI-assisted-by: claude-opus-5-5
2026-11-23 09:28:36 +01:00
Andrey Antukh
f2648581cc Merge branch 'main' into staging-2.19.x 2026-11-23 08:54:46 +01:00
Belén Albeza
5cd9080482
🐛 Fix typography in Password and Notifications settings (#13218)
Use the DS heading component for the page and section titles.

Closes #13216

AI-assisted-by: claude-opus-5-5
2026-11-20 19:05:09 +01:00
Andrey Antukh
e0194ce60a
✨ Deliver telemetry audit events independently (#13230)
* ✨ Ship telemetry shadows with a cursor consumer

Send anonymized audit events through a dedicated telemetry consumer,
including when Nexus or admin-console also persist full events. Keep the
legacy payload and cadence of 10,000 events per chunk and three hours
between passes. Nexus skips shadows to avoid archiving duplicates.

Move shadow deletion to the audit GC. Delete full rows and shadows along
independent cursor paths, and expire shadows after seven days even when
they have not been sent. Run the deletion paths in parallel with bounded
batches, separate time budgets and independent failure handling.

Replace the shared consumer catalog with transport definitions and one
generic pass runner. Keep the legacy telemetry report and newsletter in
the scheduled task, and update the tests, memories and rollout runbooks.

Addresses F1 of the audit-log consumer review.

AI-assisted-by: deepseek-v4-flash
AI-assisted-by: gpt-6.1-terra

* 🐛 Address audit log consumer review findings

Enable audit log GC by default and document how to pause it during rollout
or before registering a consumer that needs a complete replay.

Run GC paths in order on the runner thread. Count each committed batch and
preserve partial totals on ordinary failures while propagating interruption.

Skip full-row payloads in telemetry queries and decoding. Keep the age
limit for local retention only, and document the shared pass contract.

AI-assisted-by: gpt-6.2-sol

* 🐛 Close audit log consumer review findings

Verify telemetry counts processed and skipped events in a mixed batch.
Clarify how to pause GC, the scope of the replay race, and what the
retention warning counts. Remove private Nexus setup from the public
upgrade runbook.

AI-assisted-by: gpt-6.2-sol

* 📚 Simplify the audit log guide

Consolidate the guidance on event trust, privacy and delivery. Keep examples
that explain why the design works and link to code and runbooks for details.
Clarify replay limits and distinguish age-based deletion from missed delivery.

AI-assisted-by: gpt-6.2-sol
2026-11-20 16:28:42 +01:00
Pablo Alba
c9c9a574a0
🐛 Repair variant property set when removing a property (#12960)
* 🐛 Repair variant property set when removing a property

Removing a property could leave two variants with the same value
combination. The remaining property vectors now go through
ctv/sanitize-properties-set, and each main's variant name is refreshed, so
the set stays valid, as the 0038 migration leaves it.

On a clash, the variant higher in the layers panel keeps its values and
the lower one gets a " (n)" suffix. The plugin docs for removeProperty
say so.

The rename-in-layers path removes properties that are empty in every
variant. That cannot make two variants equal, so it skips the clean-up:
a duplicate made by the rename stays and its warning shows.

Closes #12959

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

* 🐛 Keep the top variant on a clash in migration 0038

Migration 0038 cleaned the members of a set in :shapes order, so on a
value clash the bottom variant in the layers panel kept its values and
the top one got a " (n)" suffix. The top variant is the primary one, and
removing a property already keeps it. update-variant-container-properties
now passes the members top first, so both paths agree: the primary
variant keeps its values and its property names lead the set. 0038 is
not in a release yet, so it changes in place.

The removeProperty plugin docs now cover three or more clashing variants
and all-blank values, and the plugins CHANGELOG has an entry for the fix.

AI-assisted-by: claude-opus-5-5
2026-11-20 15:35:40 +01:00
andrés gonzález
fae248bb35
📚 Update user guide for 2.20 features (#13149)
* 📚 Update user guide for 2.20 features

- WebGL rendering is on by default for new accounts.
- Text copied in Penpot keeps its formatting when pasted.
- Detach reference in typography and shadow token forms.
- Saving: retries and read-only mode while saves fail.
- Version restore message for people who have the file open.
- Esc closes the layer search, history and shortcuts panels.
- Ctrl/Cmd+click opens files and projects in a new tab.
- Import steps and per-file export progress; current export
  option labels, including Link matching libraries on import.

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

* 📚 Apply review precisions to the 2.20 user guide

Cancelled imports keep the files that already finished. Pasted text
detaches typographies instead of removing them, and only gets the default
fill when the image was its only fill. Detach reference is a hover icon.
A single match you can't edit also asks for the library.

AI-assisted-by: claude-opus-5-5
2026-11-20 14:16:30 +01:00
Alonso Torres
84a7471ea2
🐛 Keep the MCP connection when an account first leaves the workspace (#13192)
The MCP controller restarts its runtime when the profile id changes, and
it compared ids by object identity. Leaving the workspace clears the
transit uuid cache, and on the first visit it also saves the
workspace-visited prop, which reloads the profile. The reloaded id came
back as a new uuid instance, so MCP init ran again: it closed the plugin,
dropped the WebSocket and left the new plugin disconnected.

Compare profile ids by value, and add a regression test that sends the
same id as two distinct uuid instances.

Closes #13128

AI-assisted-by: claude-opus-5-5
2026-11-20 14:13:55 +01:00
Álvaro Tejero-Cantero
932544996f
✨ Add a flag that makes file-gc skip its media clean-up (#13220)
The new backend flag `file-change-retention`, off by default, makes
file-gc skip its media clean-up (deleted components, unused media
objects, and thumbnails). That clean-up roots only in the head and the
snapshots, so it would remove media that a kept revision row still
names. The file and fragment clean-up still run: revision rows name
neither.

penpot#13187 keeps revision rows under the same flag. Set the flag only
where both are deployed. An instance that rolls back to this release
with the flag still set keeps the media its retained history needs.

AI-assisted-by: claude-opus-5-5
2026-11-20 13:15:35 +01:00
Andrey Antukh
212ee6ef48
🐛 Scope components in share-link view-only bundles (#13118)
* 🐛 Scope share-link component reads to the allowed pages

A page-scoped share link exposed the primary file's components
map in get-view-only-bundle and authorized the file's components
fragment in get-file-fragment, leaking the stored shapes of
deleted components from pages the link excludes.

The share-link bundle now trims the primary file's components to
those referenced transitively from the allowed pages and emits them
inline; the membership path keeps the full map. The fragment scope
check no longer grants the components pointer to share links;
allowed page pointers remain readable.

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

* 🐛 Tighten share-link bundle component retention

The share-link view-only bundle now carries only live components
referenced transitively from the allowed pages; deleted components
never travel (their stored shapes are the main vehicle of leaked
excluded-page content). This drops the reachability walk at deleted
references and removes the duplicated subtree helper in favor of the
canonical get-component-shapes.

Also adds membership retention and cycle regression tests, and drops
the private advisory identifiers from the new test comments.

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

* ♻️ Apply the second review's fixes to the share-link fix

Ordering the namespace require so the format gate passes, renaming
the working bindings to what they hold, documenting the eager-realize
limitation at the realization site, sharing the same-file reference
predicate, and switching the fragment scope check to an allowlist of
the pages scope.

Test markers are anonymized; the walk-through-deleted contract and
the full-scope link get dedicated tests; pointer-mapped files assert
an inline referenced component and the empty-components form.

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

* ♻️ Apply the third review's minor fixes to the share-link fix

Correct the comment about realization reuse, align the new test bindings,
and drop the tautological fixture assertions. Cover the fragment scope
for excluded pages, membership on pointer-mapped files, and the legacy
same-file reference form; make both permission memories state the
actual invariants.

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

* 🐛 Scope the share-link library trim to the emitted bundle

The library trim walked the primary file's full components map, deleted
components included. A deleted component keeps its main-instance subtree
in :objects, so a library component instanced only inside those stored
shapes was retained in the linked libraries of the view-only bundle and
reached anonymous share-link viewers, metadata and stored shapes
included.

Walk the data the bundle emits instead: pages scoped to the link plus the
trimmed components map. Pages still come from the realized file, because
pointer-mapped pages only load in their own loader.

Covered by a regression test that instances two library components inside
a deleted primary component: only the library component the link's page
references survives the trim.

AI-assisted-by: deepseek-v4.1-flash
2026-11-20 12:06:02 +01:00
Yamila Moreno
3c24fb0e48 🔧 Fix pr validations
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-20 11:58:38 +01:00
Pablo Alba
2f86049377 ♻️ Address review of the nested swap slot fixes
When pasting, read each child to advance from the objects being built,
not from the page, so a later change to the parent cannot make it read a
stale shape.

Fix the docs of ignore-children-fn in get-children-ids and delete-shapes:
it receives a shape id, not a shape.

Add a unit test for ctf/get-swap-level, a paste test where the swap sits
at the last level the copied head drops, and a detach test where the
swapped copy sits under two non-swapped nested copies.

AI-assisted-by: claude-opus-5-5
2026-11-20 11:41:37 +01:00
Pablo Alba
3df7c5fea2 🐛 Keep main overrides on variant switch when the outer component is deleted
When a variant nested in a copy of a deleted component was switched, the
overrides made in that component's main were dropped: the lookup of the
matching shape in the original variant main stopped at the deleted
component, so the touched attributes were never copied.

Follow deleted components in find-shape-ref-child-of, like the ref chain
walk that collects the touched flags already does.

Closes #13177

AI-assisted-by: claude-opus-5-5
2026-11-20 11:41:37 +01:00
Pablo Alba
51c04cd686 🐛 Keep refs under a swapped nested copy when detaching
Detaching a copy moved the shape-ref of every shape under its first-level
nested copies up one level. Below a nested copy swapped in the detached
copy itself, the swap already points it into the swapped-in main, so its
children ended up one level too far and the detach failed to save with
:missing-slot.

Skip those swapped nested heads, and their descendants, when advancing
the nesting level.

Closes #13176

AI-assisted-by: claude-opus-5-5
2026-11-20 11:41:37 +01:00
Pablo Alba
ad4359efec 🐛 Keep swap slots when pasting a nested copy with a swapped component
Copying a copy nested inside another copy moved the shape-ref of every
shape under it up by the same number of levels. Below a nested copy that
was swapped in one of the dropped levels that count is too high: the swap
already points it into the swapped-in main, so its children ended up one
level too far and the paste failed to save with :missing-slot.

Count the levels per nested head instead, stopping at the level where it
was swapped (new ctf/get-swap-level), for the copied head too. The ref
chain used to collect touched flags now also follows deleted components,
like advance-shape-ref already did, so inherited slots are kept.

Closes #13076

AI-assisted-by: claude-opus-5-5
2026-11-20 11:41:37 +01:00
Andrey Antukh
d446926202
🐛 Fix compile warnings in the frontend test tree (#13109)
* 🐛 Fix compile warnings in the frontend test tree

The frontend test build printed 25 analyzer warnings, all of them in test
namespaces: 7 :fn-arity and 18 :infer-warning.

The arity ones were latent bugs. Both builds use the :esm target, where a
call that crosses a namespace boundary becomes a plain JS call, so CLJS
arity dispatch never runs and the missing argument arrives as undefined
instead of throwing: the warning was the only signal. One `wait-for` call
had no message, and five `interaction-proxy` calls still passed five
arguments after the six-argument signature landed in #11621.

The rest were JS property reads whose target type could not be inferred
(proxies, atoms, awaited promises). A `^js` hint on the target fixes them,
the convention already used under src/. Inside `set!` a form-level hint
does not reach the target, so the two per-side stroke widths bind the
stroke first.

Test behavior is unchanged: the same 27 tests in shape-bugfixes-test keep
their 63 assertions, and the full frontend suite passes (1901 tests, 7686
assertions). The memories record why `:fn-arity` cannot be ignored in this
build and how to force a clean recompile before checking for warnings.

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

* ♻️ Split the tokens plugin tests into one test per case

`tokens_test.cljs` drove five tests from `doseq` tables, one of them a
nested loop over three catalogs and seventeen mutations. A failure only
named the case through its `t/testing` label, and the nested one shared a
single store across all fifty-one combinations.

Each row is now a test of its own: twelve stroke property edits, four
`tokensSource` rejections, seventeen catalog mutations (each asserting the
local, source and other connected catalog), five activation changes and
three token application paths, taking the namespace from 67 to 104 tests.
Fixtures (`stroke-tokens-fixture`, `external-tokens-fixture`, ...) keep the
arrangement in one place, and every test builds a fresh store.

Two helpers return JS objects with `^js` on their names, so the test bodies
stay free of interop hints. Assertions drop from 430 to 345 because the
cross product no longer repeats `isEditableTokens` and `tokens-unchanged?`
once per catalog and mutation; every write is still asserted against the
three catalogs.

`mem:testing` now says tables are for short identical bodies only;
`frontend/testing` records the `defn ^js` return-tag trick.

Verified: namespace 104 tests / 345 assertions, full frontend suite 1938
tests / 7601 assertions, 0 failures; test build 0 warnings; cljfmt and
clj-kondo clean.

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

* 📎 Apply suggestion from @elenatorro

Co-authored-by: Elena Torró <elenatorro@gmail.com>
Signed-off-by: Andrey Antukh <niwi@niwi.nz>

---------

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
Co-authored-by: Elena Torró <elenatorro@gmail.com>
2026-11-20 11:30:59 +01:00
Andrey Antukh
90a06e982b
♻️ Rework the audit-log consumers and the jobs substrate (#12701)
* ♻️ Rework audit-log consumers and jobs substrate

Fold the implementation, follow-up fixes, migrations and tests into one

code commit.

AI-assisted-by: gpt-6-luna

* 📚 Consolidate 2.20.0 upgrade runbooks

Keep the operational upgrade procedure and its supporting runbooks in a

separate documentation commit.

AI-assisted-by: gpt-6-luna

* ♻️ Remove the audit-log flag and derive persistence at boot

Persistence now follows the consumer flags instead of a separate switch.
app.config computes cf/audit-persist? once at boot from :nexus and
:admin-console, and every write site reads that value, so request paths
no longer check flags per event. With no consumer enabled no full rows
are written; telemetry shadows and webhook deliveries keep their own
flags. The frontend wire signal stays :audit-log as a derived value.

Update the 2.20 runbooks, memories and the devenv flags to match, and
migrate the tests that used to toggle :audit-log directly.

AI-assisted-by: hy4-flash-free

* 🐛 Accept error-reporting batches and precompute sink flags

push-audit-events now accepts crash batches with :error-reporting alone, so
the frontend signal from get-environment-data matches a real destination.
The reporters receive unhandled-exception events without storing any row.

All per-event sink checks read booleans computed once at boot: webhooks,
telemetry and error reporting join audit-persist? in app.config. The test
fixture and with-audit-config rebind all four values together, and the
tests that toggled those flags directly were migrated.

Address F2 of the review of the previous commit. F1 stays deferred to a
separate plan.

AI-assisted-by: hy4-flash-free

* 💄 Match the layout cljfmt expects in the flags set

The first comment of the varia set sat on its own line after the opening
delimiter, and cljfmt joins such a comment to the delimiter line, so the
Common Tests lint step failed on common/src/app/common/flags.cljc. Keep
the comment on the opening line, the same shape the login and email sets
already use.

Note in mem:scripts/ci that the backend lint lints ../common/src but does
not format-check it, so common has to be passed to scripts/ci as well.

AI-assisted-by: deepseek-v4-flash
2026-11-20 11:12:00 +01:00
Andrey Antukh
1debed7f3c
⬆️ Update dependencies (#13191)
* ⬆️ Update dependencies

* 🐛 Fix CI failures after the dependency update

Both the plugins bundle build and the frontend lint job failed after the
dependency bump. `@penpot/plugin-styles` now resolves to the workspace source,
which lacked the public `styles.css` entry point; add a shim that imports
`src/lib/styles.css` so the linked and published layouts expose the same path.

Stylelint 18 enables three rules that flag existing legacy styles. Disable
them with a TODO until those declarations are cleaned up, keeping this
dependency update free of visual changes.

AI-assisted-by: hy4-flash-free
2026-11-20 09:53:37 +01:00
Pablo Alba
6d0be9f47f 🐛 Undo a main text edit and its follow-up sync in one step
After a font size change on a main text, the main resizes itself in a
commit that stacks onto the edit's undo entry. That commit still took
the group its undo transaction was opened with, and the component sync
it starts inherited that group. So the sync became a separate undo
entry: the first Ctrl+Z undid only that sync, the copies were measured
again right away, and nothing visible changed. The user had to press
Ctrl+Z twice to undo the edit.

A stack-undo? commit that records undo (save-undo? and undo changes,
the same test the history watcher uses) and has no undo group of its
own now takes the group of the entry at the current undo index. The
commits it starts, such as the component sync, inherit it, so one
Ctrl+Z reverts the edit, the resize and the sync.

A stacked commit that records no undo joins no entry, so it keeps a
group of its own: the automatic text heals must not take the rollback
unit of the user's last action. A stacked commit that joins an open
transaction that already holds changes keeps the transaction's group,
as append-undo adds it to the transaction.

The rule for commit groups in
mem:frontend/workspace-state-persistence-subtleties now includes the
stacked-entry step.

Tests: frontend-tests.data.workspace-undo-test covers a stacked commit
with no transaction, in an empty transaction and in a transaction that
already holds changes; a stacked commit that records no undo; and one
undo over an edit, its stacked commit and a follow-up commit of the
same group. frontend-tests.data.workspace-heal-undo-test drives the
real resize-text and component watcher on a main text with a copy:
one undo reverts the edit, the resize and the syncs on both.

Closes #13207
Relates to #12721
Relates to #13065

AI-assisted-by: claude-opus-5-5
2026-11-19 23:33:24 +01:00
Pablo Alba
8a9e87e33e 🐛 Skip WebGL auto-grow heals for texts with a failed font
On the WebGL renderer, a face that failed to load counts as ready,
because WASM lays the text out with a fallback font. The page-open
check skipped only texts waiting for a font, so it measured texts with
a failed face using the fallback and saved that size with no undo
step, on every page open. A team font that was deleted or returns 404
changed the size of every auto-grow text using it.

The check after fonts load had the same problem: a face that was
pending at page load and then failed was measured with the fallback
and resized, also without undo.

Both checks now skip texts that use a failed face, as the SVG :check
phase already does. The font relayout still runs for them, so they
show in the fallback font, but their stored size stays as it was.
app.render-wasm.api.fonts/font-failed? reports a failed face, and
shape-ids-for-failed-fonts finds the texts that use one.

Tests: frontend-tests.render-wasm.stale-text-selrects-test covers a
page load and a font load where one stale text uses a failed face;
only the other text is resized. The tests now mock font-failed?, so
they do not read failed faces left by other tests.

Relates to #12721

AI-assisted-by: claude-opus-5-5
2026-11-19 21:12:21 +01:00
Pablo Alba
ef0333eafe 🐛 Fix auto-grow text sizes after sync and page open
On the WebGL renderer, a sync re-measure of copies shared a 40 ms
batch with user resizes of the main text. The batch skipped the
component sync when any request asked for that. So a resize of the
main (grow type, font size, paste, search and replace) often never
reached copies on other pages or in other files, and the viewer and
exports showed the old size.

A batch now skips the sync only when every request asks for it, the
same rule as :save-undo?. Such an edit costs one extra short sync
round. That round holds only skip requests, so it stops after one
pass.

A copy that the sync switched from fixed to auto-grow was never
re-measured, because the check read the grow type before the sync.
The check now reads the grow type that the change sets. A copy that
the sync makes fixed is not re-measured.

A sync started without an undo group (library update dialog, color
and typography sync) committed with a fresh group, and its re-measure
and layout pass took other ones. Ctrl+Z first undid only the
re-measure and left the copies in the old box. The sync now picks its
group when it runs: inside an undo transaction (color, typography and
asset deletes) it takes the transaction's, otherwise a fresh one. The
re-measure and layout pass share it, so one undo reverts the edit, the
sync and its follow-ups, and a failed save rolls them back together.

On the SVG renderer, opening a page resized a copy with no position
data even when its size had not drifted. Measured sizes round up, so
17.4 became 18. The measurement from that resize then landed on the
user's last undo entry. The heal now reports whether it resized, and
the check phase resizes only when the size drifted.

The SVG page-open check covered only texts with overridden content.
A copy loses its touched flags, so a label overridden inside a main
(a Button label in a Card main) was never checked in the main's
copies, and its heal skips the component sync. The check now covers
every auto-grow text inside a copy, as the WebGL check does. The
heal's reflow now skips the component sync too: without undo it
touched the main component on every page open.

A page-open check measured with a font that failed to load wrote the
fallback font size. It now writes no size then; a copy without
position data still gets it. The WebGL and SVG renderers can measure
a text differently; a gap over 1 px makes each page open by a user of
the other renderer write the size back. Two browsers on the SVG
renderer can do the same: a long auto-width line can differ by more
than 1 px, and an auto-height text can wrap a line differently. This is
a known limit, noted in the text-heal docstring.

The drift check moves to text-size-drifted? in
app.common.geom.shapes.text, and takes a tolerance. Both renderers use
it: 1 px for the SVG check and the WebGL page-open check, 0.1 px for
the WebGL font-load check. The WebGL check did not skip axes that fill
their layout parent, so those texts looked stale on every page open
and were resized for nothing. It now reads the stored width and height
and skips fill axes.

The sync docstring and a test message gave the wrong reason for
:skip-component-sync?. :ignore-touched stops the resize from marking
:geometry-group. :skip-component-sync? stops the re-measure commit from
starting another sync. "Remasure" is now "re-measure" in
identifiers, test names and comments. The sync docstring now states
that an auto-grow copy takes the main's size on each geometry sync,
also with overridden content, until the re-measure or the page-open
check corrects it. The sync's undo comment no longer says the layout
pass gets the sync's undo group: the layout buffer drops it, and the
pass joins the same undo entry through :stack-undo?.

Tests: heal undo tests cover mixed user and sync batches in both
orders, and undo for both renderers. A heal leaves the undo stack
unchanged, and undo reverts the user edit. A heal reflow skips the
component sync. Sync tests cover a copy that becomes auto-grow
(re-measured) and one that becomes fixed (not), and a sync with no
undo group that shares one with its re-measure, also inside an undo
transaction, with and without a group of the edit. Viewport tests cover
no resize without drift, a drifted copy that resizes and settles, the
check of every auto-grow text in a copy, and no size write from a
failed font. Component tests mount the SVG renderer: a drifted copy is
measured once to check and once to settle, with no undo step, and a
matching copy is measured once. Stale-selrect tests cover skipped fill
axes. The drift tests move to common-tests.geom-shapes-text-test, with
tolerance and grow-type cases.

Relates to #12721

AI-assisted-by: claude-opus-5-5
2026-11-19 21:12:21 +01:00
Pablo Alba
2964e88a8c ⚡ Re-measure auto-grow texts only on size changes
On the WebGL renderer, a sync from a main component re-measures every
auto-grow text it changes on the page. The sync runs on every edit to
a main component, so an edit that cannot change a text size, such as
opacity, shadow or text color, still re-measures and re-lays out every
synced text.

The sync now re-measures a text only when the change sets an attribute
that can change its size: :grow-type, :width, :height,
:layout-item-h-sizing, :layout-item-v-sizing, or :content that differs
in more than its fills. A text color change reaches copies as a
:content change, so fills are removed from both contents before
comparing. Sync emits operations only for attributes that changed, so
the operation attributes are enough. Moves (x and y only) do not
re-measure.

Tests: frontend-tests.data.workspace-sync-text-wasm-test adds cases for
a fill change and an opacity change on the main text (no re-measure),
and for a font size change and a width change on an auto-height text
(re-measure).

Relates to #12721

AI-assisted-by: claude-opus-5-5
2026-11-19 21:12:21 +01:00
Pablo Alba
0e103fb215 🐛 Skip undo step for SVG auto-grow heal resizes
On the SVG renderer, opening a page measures auto-grow text copies
with overridden content and writes back their size and position data
when they drifted. The write went through the normal text commits,
which stack onto the user's last undo entry. So the first Ctrl+Z after
opening a page also reverted the heal.

A component sync also set the position data of a copy to nil, even
for a fill change on the main. Such a copy skipped the check and went
through the normal path, with undo.

Heal requests now take :save-undo? false. resize-text and
update-position-data accept optional opts, and a request with
:save-undo? false marks its text as a heal for the current batch. A
later user request for the same text in the batch removes that mark.

The batch commit splits in two. User texts commit as before. Heal
texts commit with :save-undo? false and :skip-component-sync? true,
so each copy heals on its own page open instead of syncing.

The heal resize asks for the parents' reflow with :save-undo? false.
The layout buffer lays out heal updates apart from user ones and
passes the flag to apply-modifiers, so the reflow records no undo
step either.

The :check phase also heals a copy without position data, with no
undo. When the size drifted, the text moves to a new :settle phase.
The measurement that the heal resize causes also commits without undo.

Known limit: when the heal's reflow moves the text (for example,
re-centering it in a flex parent), the renderer measures the text
again with no phase. That position-data commit still stacks onto the
last undo entry. Left for a follow-up.

Tests: frontend-tests.data.workspace-heal-undo-test (SVG store) covers
a heal resize with no undo, no component sync and a reflow without
undo; a heal and a user change in one batch; a user request after a
heal of the same text; and the layout buffer keeping a heal's reflow
apart. frontend-tests.ui.viewport-texts-html-test covers the options
each phase sends: drifted copy, matching copy, copy without position
data, unmeasurable text, settle, and no phase.

Relates to #12721
Relates to #13065

AI-assisted-by: claude-opus-5-5
2026-11-19 21:12:21 +01:00
Pablo Alba
c34cd056e4 🐛 Skip undo step for auto-grow heal resizes
On the WebGL renderer, the workspace resizes auto-grow texts whose
stored size no longer matches their WASM layout. This runs when a page
opens and when fonts finish loading. These resizes are not user
actions, but each one recorded an undo step. So the first Ctrl+Z after
opening a page undid the resize instead of the user's last edit, and
the copy went back to the wrong size.

The listener for the stale-text event now asks for the resize with
:save-undo? false. The flag passes through the resize debounce to the
commit, which hands it to apply-wasm-modifiers, so the shape update
records no undo step.

Resizes are batched in a debounce window. A batch skips the undo step
only when every request in it asked for that. A user resize that lands
in the same window keeps its undo entry. Batch options are now merged
for every request, including those without options, so this check
works.

Tests: frontend-tests.data.workspace-heal-undo-test covers a heal
resize that commits without an undo step, a resize without the flag
that still records one, a mixed batch that keeps the undo step in
either order, and a batch of heals that skips it.

Relates to #12721
Relates to #13065

AI-assisted-by: claude-opus-5-5
2026-11-19 21:12:21 +01:00
Pablo Alba
14cb15e844 🐛 Re-measure overridden auto-grow texts on page open
On the SVG renderer, a text is measured only when its text
properties change or when it has no position-data. A component copy
with overridden text content keeps its own position-data. If its
main changes while the page is closed, the copy takes the main's
size, and nothing measures it when the page opens. It keeps the
main's height, so its flex siblings overlap the extra lines.

When a page opens, each auto-width or auto-height text with
overridden content on a copy starts in a :check phase and gets one
hidden HTML measurement. In :check, the result is written (size and
position-data) only if the size differs by more than 1px on the axis
the text grows on. Otherwise nothing is written, though the text
modifier is still cleaned. The phase is then dropped, so later
measurements work as before. A copy with no position-data skips the
check and is measured and committed as usual.

The new dwt/text-size-drifted? holds the 1px rule. It ignores an axis
that fills its layout parent, because the layout sets that size and
the check would otherwise find drift on every open. The 1px tolerance
matches the WebGL page-load check. SVG stores whole pixels, rounded
up, so smaller gaps are only rounding. A finer tolerance would
rewrite the same texts each time a page opened.

Each content-overridden auto-grow copy costs one extra measurement
per page open.

Tests: frontend-tests.data.workspace-texts-test covers
text-size-drifted? for sub-pixel and exact 1px gaps, the growing axis
only, and fill axes. frontend-tests.ui.viewport-texts-html-test covers
which copies start in :check, the drifted, matching and unmeasurable
cases, and the 1px commit when no phase is set.

Known limit: the heal commits like any SVG measurement, so it adds to
the user's last undo entry.

Relates to #12721
Relates to #13065
2026-11-19 21:12:21 +01:00
Pablo Alba
8902c6a9d8 🐛 Resize stale auto-grow texts when their page loads
With the WebGL renderer, a component copy synced while its page was
closed takes the main's size for its auto-width or auto-height text.
Nothing measured it again when the page opened. The only check of stored
text sizes against the WASM layout ran after font loads, and only for
texts that waited for a font. Once fonts were loaded, which is true for
every page after the first in a session, the stale copy kept the main's
size. Its flex siblings then overlapped the extra lines.

Page loads now check every auto-grow text they bring into WASM. This
covers the sync path for small pages and the chunked async path for
pages with 100 or more shapes. A stale text goes through the existing
stale-text event, so the workspace resizes it. Texts still waiting for a
font skip the check, since the font check handles them when the font
arrives. So no text is resized twice.

The page check uses a 1px tolerance, and the font check keeps 0.1px. The
classic renderer stores whole pixels and WASM stores fractions, so a
finer tolerance would rewrite the same texts each time a page opened.
Shape updates made while editing do not run the check, so typing does
not resize texts.

Tests: new frontend-tests.render-wasm.stale-text-selrects-test covers
small and large page loads, sub-pixel gaps, fixed texts, texts waiting
for a font, and shape updates while editing.

Note: set-objects also serves thumbnails, the viewer and the export
worker, where nothing listens to the event. There the check costs one
cached size read per auto-grow text, the same cost the font check already
had for texts that waited for a font.

Relates to #12721
Relates to #13065
2026-11-19 21:12:21 +01:00
Pablo Alba
a37ad6161d 🐛 Keep auto-grow text boxes sizing on component copies 2026-11-19 21:12:21 +01:00
Elena Torró
d3e2ce2de5
🐛 Keep layer order in the export boards dialog (#13198)
Closes #13197
2026-11-19 20:42:49 +01:00
Andrey Antukh
314c771784 🔧 Add create-issue shortcut with Issue Type in gh.py
Create an issue and assign its Issue Type in one command instead of the
manual create-then-mutate flow. The type name is case-insensitive and the
command prints the issue number, URL, title and type as JSON.

Add unit tests for the full flow, labels, invalid types, gh failures and
the CLI output, and update the gh, creating-issues and create-issue skill
documentation.

AI-assisted-by: hy4-flash-free
2026-11-19 19:47:41 +01:00
Yamila Moreno
04a9aaac78 🔧 Close invalid pull requests (#13196)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 17:38:10 +01:00
Alejandro Alonso
3e697c2794
✨ Forward frontend audit events to host callbacks (#13175)
Hosts need a vendor-agnostic way to react to named audit events in the
browser (for example SaaS config.js). Penpot exposes
penpotAddEventCallback / penpotEventCallbacks, loads an early stub before
config.js, and invokes matching callbacks after make-event, without
coupling to any analytics SDK.

Closes #13091

AI-assisted-by: Composer
2026-11-19 16:02:45 +01:00