Skia listed Color Emoji too early and treated broad SMP ranges as
emoji, so text-default symbols rendered in color and FE0F could stay
monochrome. Empty spans also stopped pushing styles.
Split spans by Unicode Emoji_Presentation and variation selectors,
use emoji-first stacks only for emoji runs, keep Color Emoji last on
text runs, and always push a style for empty spans. Closes#13271.
* 🐛 Normalize legacy svg attrs of pasted shapes
Shapes copied from a version before 2.20 can hold camelCase svg attrs,
for example :strokeLinejoin. Files get them normalized by migration
0037 when they load, but clipboard data skips the migrations, so the
closed SvgAttrs schema rejected the pasted shape and the whole paste was
cancelled.
Move the shape normalization of migration 0037 to csvg/normalize-shape
and run it on every pasted shape in paste-shapes.
Closes#13327
AI-assisted-by: claude-opus-5-5
* 📚 Name the shared svg repair in the data model checklist
From the review: the checklist still named the withdrawn migration 0035
as the svg repair site. Point it to csvg/normalize-shape, used by
migration 0037 and by paste-shapes.
AI-assisted-by: claude-opus-5-5
Dragging a shape into a board sets its constraints to the default for
that place (left/top, or scale inside a group) without marking them
touched. A component main on the canvas has no constraints, so the
sync saw nil against left/top and wrote nil over the copy. With nested
components that sync writes into the middle library, so any change to
the inner component, even a 1px move, showed an update banner in every
file that uses it.
Treat a missing constraint as the default for the placement of the
shape being written when comparing during sync.
Closes#12719
AI-assisted-by: claude-opus-5-5
Validation compared each variant's property names with the first child
of its board, so it missed forbidden characters, too-long text and
repeated names, and never checked labels in deleted components. Repair
cut every variant down to the first child's names, which dropped
values, and left the file invalid.
Validation now checks the members of each board as one set: cleaned
text, and the same names in the same order, in layers-panel order as in
migration 0038. Repeated value combinations stay valid, as the editor
allows them. It also checks boards that exist only in a component's
objects, variant components that belong to no board, and the whole
board when a save touches only one of its members.
Repair writes the aligned properties and labels on each component and
its main. A live variant main outside its board is reported as
:variant-main-outside-board and detached, as the editor does, instead
of turning its parent into a board. :main-instance-not-a-variant now
repairs the main of a deleted component inside its objects.
Moving a shape or component into a board now cuts property values taken
from its name or path to 60 characters, as the schema requires.
Closes#13238
AI-assisted-by: claude-opus-5-5
Point the public CSS export to the generated file and test its build.
Clarify component restoration and cover the deleted-file path. Update
integration test documentation for the release bundle.
AI-assisted-by: gpt-6.1-terra
Build legacy migration fixtures from the datafied library to avoid
ClojureScript inference warnings without changing the test cases.
AI-assisted-by: gpt-6.1-terra
Show the existing interactive test command in help and documentation,
and check that help only names package scripts that exist.
AI-assisted-by: gpt-6.1-terra
Follow-up to #13210, from its review. The warning and error message
tests now echo the translation arguments, so they fail when the value
goes missing from the message. The generic shape attributes also check
sizing, opacity and rotation, and the group renaming cases talk about
group membership rather than the group's name in the path.
The token tests now share one `tr` stub instead of three copies.
Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
Co-authored-by: Eva Marco <eva.marco@kaleidos.net>
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
* 🐛 Keep fitted content clear of the rulers
Fit actions pass padding in document units, so the margin on screen
shrinks with the zoom. On large designs the margin became smaller than
the fixed 22px ruler overlay and part of the content was hidden under
it.
Add a :min-screen-padding option to adjust-to-viewport. The existing
design-space padding is kept when it already leaves enough margin on
screen; otherwise the viewport is fitted again with a fixed screen
margin. Use it in fit-to-all, fit-to-selected and fit-to-shapes so all
fit paths behave the same at any zoom level.
Closes#12609
AI-assisted-by: deepseek-v4.1-flash
* 🐛 Keep page-open fits clear of rulers
Pass the minimum screen padding when initializing the viewport, and cover all
four fit margins for wide and tall content with the call-site minimum zoom.
AI-assisted-by: gpt-6-luna
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
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#13179Closes#13181
AI-assisted-by: claude-opus-5-5
Covers the error and warning messages, how token values and color
bullets show, which token attributes each shape type takes, group
and set renaming helpers, and the duplicated set id migration.
Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
* 🐛 Check pages added with a full page value in soft mode
An :add-page change can carry a whole page under :page instead of an
id and a name. extract-affected-ids reads the page to check from the
change's top-level :id, so that form left the new page unchecked and
a referential error in it was stored.
Collect those page ids after the changes are applied and run the
affected check on them in soft mode: log the file id, the page ids
and the error codes, and never refuse the save. This is the first
step of the two-step rollout. The follow-up moves the page id into
extract-affected-ids and makes the check hard. The counters of
#12665 decide when to flip it.
Relates to #12666
AI-assisted-by: claude-opus-5-5, deepseek-v4.1-flash
Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>
* 🐛 Collect the page of a whole-page add-page in the affected check
An `:add-page` change that carries the page alone, with its id inside
`:page` and none at the top level, escaped the referential check:
`extract-affected-ids` read only the top-level `:id`. The schema side
(`touched-page-ids`) already reads `(or id (:id page))`; the referential
side now does the same.
This replaces the separate soft-mode check of the first commit. The page
now goes through `validate-file-affected` like any page a save touches,
so the deployment's flags decide whether an invalid page is refused
(`:file-validation`) or only logged (`:soft-file-validation`), and no
second log hint or rollout step is needed.
AI-assisted-by: claude-opus-5-5
* 🐛 Check the page an add-page stores, not its top-level id
An :add-page that carries the page whole stores it under the id inside
:page. extract-affected-ids and touched-page-ids read the top-level :id
first, so a change whose two ids differ stored one page and checked
another, which does not exist. Both now read the id of the page first.
The unit test of the affected check moves to the common validate tests,
with a case for the differing ids on the referential and the schema
side. The backend test sends that form through update-file as well,
and a new test sends the page as a commit group, the way the editor
does, and expects the commit under :rejected and no stored page.
AI-assisted-by: claude-fable-5-2
* ♻️ Derive the add-page change ID from the page
Use the page ID for both redo and undo so the builder cannot emit
conflicting IDs. Keep the change format and the library API unchanged.
AI-assisted-by: gpt-6.2-sol
---------
Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
* ✨ 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
* 🐛 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
With the tokenscript flag every resolution rebuilt the whole library:
each sidebar render, each propagation and each keystroke in a token
form. The adapter now keeps the interpreter state of the last
resolutions and updates it with set-sets, so only the tokens that
changed and their dependents are re-resolved and converted. Every other
output token stays the same object.
- common/deps.edn moves penpot/tokenscript-interpreter to v0.3.0:
token readers and writers and a set-sets that looks only into changed
sets (#1), on top of the DTCG import and export (#4) Penpot already
uses.
- The sidebar, token propagation, token application and the plugin API
pass the active sets unmerged (cfo/get-active-token-sets and its
force variant); the interpreter merges them. The plugin API's own
resolution cache is gone.
- The adapter hands Penpot's token records to the interpreter with a
reader (value and DTCG type, an error for a token without a value)
and a writer (the conversion to :resolved-value or :errors), which
runs only for the re-resolved names.
- The cache resolves new sets from the last resolution with the same
set ids, else from one sharing a set id, else from scratch.
- The token form controls resolve the draft in a set of its own on top
of the library's sets, the selected set last
(cfo/get-token-sets-for-edit). The form leaves the edited token's old
name out of them (cfo/without-token). A keystroke re-resolves only
the draft and its dependents. The last draft is cached apart, so
typing doesn't evict the sidebar's resolutions. Without the flag the
controls don't build these sets. The plugin API's token name and
value setters validate the candidate the same way.
- The token form hint shows resolved font families as a name list.
- Tests cover the unmerged set helpers, a plugin rename to a name below
the old one (which needs the old name left out), and compare renames,
with and without updating the references, against StyleDictionary.
Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
The component sync emits a `:reg-objects` for the parents of every
shape it touches, so a component swap collected 291 of them for 36
containers. Recomputing a group's geometry N times in a row gives the
same result as doing it once, so most of that work was thrown away,
in the browser and on the server, on every save.
`mch/merge-reg-objects` collapses them into one per container, with
the union of the shapes. The merged change moves to the end of the
batch: a group has to be recomputed after the shapes that resized
it, not before, or it keeps a stale `:selrect` until something else
touches it. That is also why it must not stay in the position of the
first change it replaces.
It runs on every commit, redo and undo alike, so the undo stack gets
the same benefit, and again when the buffer is batched for saving.
Measured on the swap that motivated this: 291 `:reg-objects` become
36, and the batch goes from 806 changes / 6.4 MB to 551 / 324 KB.
AI-assisted-by: space-bunny
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
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
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
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
* 🐛 Fix Chinese locale for dates and relative times
* 🐛 Add missing Hindi and Serbian date locales
* 🐛 Reset date locale to English for languages without one
---------
Co-authored-by: Eva Marco <eva.marco@kaleidos.net>
* 🔧 Test unique layer names in the file builder
The builder read used names from :unames while track-used-name wrote
them to ::unames, so two boards without a name both ended up as
"Board". #12794 fixed the key. These tests cover it: two unnamed boards
get "Board" and "Board-1", and two names that clean to the same path
get "-1" on the second one. Both fail with the old key.
AI-assisted-by: claude-opus-5-5
* 🔧 Test that component root names count as used names
#12794 also made add-component register the renamed main instance name.
A shape added later with the same name must get "-1". The test fails
without that track-used-name call.
AI-assisted-by: claude-opus-5-5
* 🔧 Test per-page unique names and anonymous components
The builder tracks used names per page, so the same name on two pages
stays unchanged. A component without a name is called "anonymous".
Each test fails without the code it covers.
AI-assisted-by: claude-opus-5-5
* ⚡ Stop resending deleted component objects on every touch
`pcb/update-component` attached the whole `:objects` map of a deleted
component to every `mod-component` change, so a single component swap
re-sent thousands of shapes that the same batch already carried as
shape changes. In one measured swap the 49 maps with objects were 94%
of the request (6.3 MB), and only 27% of the 4.275 shapes they carried
differed from what the server had.
Now `mod-component` carries component metadata only, and shapes inside
a component travel as `:mod-obj` changes scoped with `:component-id`,
which is what the component sync already emits. An absent `:objects`
key means "leave the stored shapes alone", only an explicit `nil`
drops them, so metadata-only changes cannot wipe a deleted component.
The two repairs that fix shapes inside a component (shape-ref cycle
and duplicated swap slot) now emit one `:mod-obj` per shape; the two
that move or clear the `:objects` key keep the whole-map write behind
the new `:objects? true` option.
Same swap on the measured file: 6.328.307 to 382.571 bytes.
AI-assisted-by: space-bunny
* 🔧 Cover the mod-component objects contract with tests
`pcb/update-component` sends the `:objects` map only when the caller
passes `:objects? true`, and `ctkl/mod-component` reads an absent key as
"leave the stored shapes alone". Two repairs depend on that option, and
dropping it broke nothing visible: the change carried no `:objects`, the
applier kept the invalid component as is, and the suite stayed green.
Add one repair test per error code, including the deleted-component
branch that must keep the map empty, and a round-trip test for the
shape-ref cycle repair. That repair now emits one `:mod-obj` per shape
and had no coverage; the test pins the scoped `:component-id` and that no
shape is lost.
Reword the `update-component` docstring as well: it describes what the
option does to the change instead of listing its current callers, which
goes stale as soon as another caller uses it.
AI-assisted-by: deepseek-v4.1-flash
* 🔧 Harden the mod-component repair tests
Address the review of the previous commit.
The cycle test only rejected a shape-ref pointing to itself, so it would
have passed if the repair repointed the link instead of removing it, or
if it left the component links on the main root untouched. It now
compares the resulting objects map with the expected one.
The four tests only inspected the first change, so a duplicated change
went unnoticed. They now compare the full list of changes: an exact
vector for the two repairs that rewrite the map, and id frequencies for
the cycle repair, which emits one change per shape in no fixed order.
The deleted-component fixture now removes the main instance through
`tho/delete-shape`, the same change generator the editor uses, instead
of a hand-written `:del-obj`. The message that promised a restorable map
now says what the repair does: normalize the value to an empty map.
AI-assisted-by: deepseek-v4.1-flash
* 🐛 Fix shared files 500 on shapes with invalid child ids
Old files can list in :shapes ids that are not uuids or that point to
no shape. Migration 0033 walked them and hit the uuid assert in
get-shape, which throws an AssertionError. The shared files list only
caught Exception, so that Error broke the whole list with a 500.
Make migration 0033 skip those ids, and catch Throwable when loading
each shared file, so a broken file is skipped and logged.
Closes#12343
AI-assisted-by: claude-opus-5-5
* 🐛 Repair invalid child ids in migration 0033 v2
Skipping invalid child ids in migration 0033 was not enough: the ids
stayed in :shapes, so the file still failed schema validation and
could not load. Files that already applied the migration would also
never run a changed version of it.
The migration now repairs each container before the naming walk:
string ids are parsed with uuid/coerce, nil and ids that point to no
shape are dropped, the duplicate that 0032 adds when a child is
listed as a string is removed, and a :shapes list becomes a vector.
Only the shapes that change are re-assoc'ed, so a healthy ObjectsMap
is not marked as modified and its page is not rewritten.
It ships as 0033-normalize-main-instance-names-v2 at the same
position in available-migrations, so files that recorded the old id
run it again. That position also makes it parse strings before
0035-fix-dangling-children drops the ids it cannot find.
The shared files listing restores the interrupt flag when the cause
of a skipped file is an InterruptedException.
Tests cover children outside the root walk, legacy components, the
objects-map wrapper of the unrealized save path, a list turned into a
vector, a shape without a :shapes key, a file that applied the old
id, and the end-to-end load of a broken shared file.
Relates to #12343
AI-assisted-by: claude-opus-5-5
AI-assisted-by: inkling-2-small-free
* 🐛 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>
* ✨ 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>
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
- 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
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>
* 🐛 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>
* 🐛 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