24905 Commits

Author SHA1 Message Date
alonso.torres
69b77cef11 ✨ Expose CJK text layout in the Plugin API
Text shapes and text ranges read and write the CJK attributes, among them
the language (`lang`), writing mode, orientation, readings and emphasis
marks. Update the plugin types, the changelog and the API test suite.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
9226510bb6 ✨ Add the language profile and CJK options to the workspace
- The Text section shows writing mode, orientation and Distribute when
  the text has a CJK profile.
- A Language section picks the profile of the selected texts. Its
  options open in a view of their own, grouped in Selected text, Layout
  and Ruby.
- A compact menu at the selected text opens readings, emphasis marks and
  other options of the selection.
- File and Preferences menus and the account settings set the file and
  the default profiles. New texts take the last profile used, else the
  file one.

The board size presets share the new grouped dropdown. Add English,
Spanish and Japanese translations.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
c3f9493f03 ✨ Edit vertical and CJK text with IME input
The WASM text editor works in vertical text: the caret, selection and
arrow keys follow columns, the cursor and the resize handles match the
writing mode, and auto-width and auto-height texts grow toward the block
end. The IME input surface sits on the caret so candidate windows open
beside the column on each platform, and compositions update the text as
they change. Undo history and selection styles keep readings and other
CJK attributes.

The `ime` debug option shows composition bounds and both carets.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
f355b27e88 ✨ Send CJK text to the renderer and keep it in browser and exports
Serialize the CJK attributes of paragraphs and spans for the WASM
renderer, load CJK fallback fonts by script, and relayout text when they
arrive. The SVG and HTML text renderers, the exporter, the CSS code
generation and the clipboard keep the language, writing mode, readings
and emphasis marks.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
16d7380c4c ✨ Lay out vertical CJK text in the WASM renderer
Add vertical writing (`vertical-rl`) to the renderer: characters set in
cells along columns, upright or sideways orientation, vertical glyph
alternates and metrics, tate-chu-yoko, kinsoku and JLREQ squeezing across
columns, and readings and emphasis marks beside the column.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
4e9b4d183e ✨ Lay out horizontal CJK text in the WASM renderer
Add the CJK layout engine and use it for horizontal text:

- Line breaking with kinsoku rules that depend on the language: Japanese
  JLREQ, Chinese per region (Mainland, Hong Kong, Taiwan) and Korean
  word or syllable wrapping. Indivisible units stay together in narrow
  boxes.
- Justification and squeezing that follow JLREQ, and distributed
  alignment that keeps lines inside the box.
- Readings over the text (ruby, pinyin and zhuyin), emphasis marks,
  warichu and CJK underlines, attached to the ideographic em box and
  included in the export bounds.
- Shared glyph shaping, font tables and CJK fallback fonts.

`docs/cjk-layout.md` describes the design. Test fonts cover the locl,
vertical metrics and pinyin cases.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:21 +01:00
alonso.torres
db1d8bc16e ✨ Add CJK text attributes and language profiles to the data model
Texts get the attributes of CJK layout: the language of each paragraph (a
BCP 47 tag), the writing mode and orientation, readings (ruby, pinyin and
zhuyin), emphasis marks, warichu, tate-chu-yoko, line breaking rules and
distributed alignment. `cjk-layout` holds their values and defaults and
tells which language family a tag belongs to.

Files keep a language profile in their options: the language new text
layers take when the user has not picked one. Profiles keep their own
default, and new files start with it. A new change type sets the file
profile, and the `cjk-support` feature gates the whole work.

Range styling joins spans left with the same style, since tate-chu-yoko
and readings work per span.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:21 +01:00
alonso.torres
ffe37f9bd3 🐛 Keep text editing open when an IME cancels composition
Some IMEs (Fcitx Pinyin) end the composition before Escape is released,
so the key-up no longer looks like part of it and Escape left the text
edition. Remember when a key-down belongs to a composition and ignore
the Escape release that follows. Escape still leaves the edition or
closes the menu otherwise.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:21 +01:00
alonso.torres
ca81ef0f33 🐛 Restore selected text when composition is cancelled
Starting an IME composition over a selection deletes it, and cancelling
the composition left it deleted. When the IME ends with an empty text,
restore the content and the UTF-16 selection from before the
composition, keeping styles, the selection direction and redo. The
cancellation is not recorded as an edit.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:21 +01:00
alonso.torres
5ec27d794c 🐛 Restore undo and redo inside the WASM text editor
While a text was being edited, undo and redo did not reach the editor.
Keep a bounded content and selection history for each editing session.
Group committed compositions and styled insertions, leave IME previews
out, and start over when another change replaces the content.

Route keyboard shortcuts, native history input and the Edit menu to the
editor. The menu takes the focus, so focus the editor before restoring.
Restore UTF-16 selections through a new WASM binding.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:21 +01:00
alonso.torres
c6be545a9a 🐛 Relayout text whose font is fetched for another shape
Font fetches are shared per URL, so a text that asks for a face already
being fetched gets no fetch callback. process-pending only relaid out
text after its own callbacks, so such a text kept its fallback-font
layout. Auto-grow text recovered through the reflow resize, but fixed
text stayed wrong until another change.

Wait for the text's pending faces to be stored or to fail before the
relayout, whoever started their fetch.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:21 +01:00
Pablo Alba
a6282d0cdc 🐛 Keep variant mains and boards when repairing lost main flags
The repair of :variant-not-main removed a variant main that had only
lost :main-instance, with its children. Its component still pointed to
the removed shape and validation reported nothing after it. When the
live component still names the shape as its main, the repair now sets
:main-instance back; it removes only shapes no component claims.

The :ref-shape-not-found repair of the same pass now leaves a main
alone, so it does not give the restored main a :shape-ref.

The repair of :nested-main-not-allowed moved the shape to the page root
every time. It now moves it only when a main surrounds it; a main in a
plain board keeps its place and gets :component-root.

Closes #13257

AI-assisted-by: claude-opus-5-5
2026-11-27 14:48:33 +01:00
Pablo Alba
db3466aca6
🐛 Validate copies of unlinked libraries like the backend does (#13330)
* 🐛 Validate copies of unlinked libraries like the backend does

Copies of components from a library that is no longer linked failed
plugin validation with component-not-found and ref-shape-not-found,
while the backend accepted every save on them. The validator skips
copies whose library is not in the map it gets, but the plugin passed
the whole :files state, which also holds dashboard entries without
data. A library in the same project then looked present but empty.

The plugin validate, and the debug validate and repair, now pass only
the file and its linked libraries, the same set the backend uses. The
debug repair would otherwise detach those copies.

resetOverrides in the plugin API now refuses, with a message, when the
main component of the copy cannot be found or is deleted. Before, it
emitted a reset that changed nothing. The workspace menu already hides
the option in that case.

Closes #13323

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

* ✨ Fix MR findings
2026-11-27 14:42:52 +01:00
Elena Torró
401d646cdd
📚 Update the 2.20.0 changelog 2026-11-27 13:57:52 +01:00
Eva Marco
324ac9afe7
🐛 Hide the path edition options when the edited path is gone (#13371)
* 🐛 Hide the path edition options when the edited path is gone

The design panel showed the path edition options whenever a path edit
state existed for the edited shape. The shape can leave the page while
that state stays, for example when another user deletes it or an undo
removes it. The panel then rendered the measures of a missing shape,
with a nil type, and crashed with "No matching clause".

The panel now shows the path edition options only while the edited
path is on the page.

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

* ♻️ Name the edited path check apart from its result

The helper and the local that holds its result were both called
path-editing?, so the name meant a function in the namespace and a
boolean inside design-menu*. The helper is now editing-existing-path?.

AI-assisted-by: claude-opus-5-5
2026-11-27 13:12:38 +01:00
Andrey Antukh
3fd984e12e
🔧 Require an explicit secret key and accept shared keys from files (#13135)
* ✨ Accept explicit shared keys from files

Backend, exporter and media processor now read a service shared key from a
`*_FILE` variable when the direct environment value is absent. Blank or
missing files fail closed instead of disabling the credential. Backend also
persists an autogenerated master secret in `server_prop` so tokens survive
restarts without operator configuration.

The derivation from `PENPOT_SECRET_KEY` stays as a fallback; the shipped
Compose defaults are unchanged. Each service can now receive its own key,
while backend resolves all four.

AI-assisted-by: hy4-flash-free

♻️ Require an explicit secret key and tighten key files

Backend no longer persists or autogenerates the master secret: startup now
requires PENPOT_SECRET_KEY or PENPOT_SECRET_KEY_FILE. A blank service key is
disabled, while key files are trimmed, unwrapped, size-capped and fail closed
with named errors. Exporter, media processor and admin console follow the same
contract, and the admin console file reader moves to shared-utils.

AI-assisted-by: hy4-flash-free

* 🐛 Align service secret key configuration

Reject blank exporter keys without falling back to another source.
Allow the exporter and media processor to derive their service keys from
a master key file, and document the upgrade and security requirements.

AI-assisted-by: gpt-6.1-terra

* 🐛 Normalize key files consistently across services

Reject empty master key file paths when selected and apply the same
Unicode whitespace rules to backend, exporter and media processor.
Document the compatibility impact on existing secrets and tokens.

AI-assisted-by: gpt-6.1-terra
2026-11-27 12:06:05 +01:00
Pablo Alba
1995105df9 🐛 Keep uploaded SVGs out of variant boards
Adding an SVG with several variants selected, or dropping it on an empty
area of a variant board, put a plain group straight into the board. The
backend rejected the save with :main-instance-not-a-variant and the
workspace undid the change. The SVG upload now picks its parent with
get-first-valid-parent, as drawing and add-shape do, so it never lands
in a variant board or a component copy.

Validation reported any non-variant child of a variant board as a main
that should be a variant. Its repair set :variant-id on plain shapes,
which made a fake variant that a later repair deleted with its children.
Such a child now reports :variant-container-child-not-main, and its
repair moves it out, right after the board. A main that lost its flags
but is still claimed by its component keeps the old code.

Closes #13338

AI-assisted-by: claude-opus-5-5
2026-11-27 11:10:33 +01:00
Pablo Alba
764804a914
🐛 Keep fill children of hug boards from collapsing to 0.01 px (#13358)
* 🐛 Keep fill children of hug boards from collapsing to 0.01 px

A flex or grid board that hugs an axis has no free space for fill
children on that axis: along a flex direction any fill child, across it
only when every child is fill, and in a grid any fill child. The layout
shrank them to the 0.01 px minimum and the commit saved it. In component
copies, the new render engine then wrapped their text one character per
line.

The rule lives in common as fix-child-sizing, with tests, and now covers
grid boards. Every action that reaches this state applies it:

- Resize board to fit content fixes, in the temporary objects only, the
  fill children that the hug would collapse.
- The hug toggle changes the direct children only. It fixed fill sizing
  on all descendants, which froze collapsed grandchildren as overrides.
  Setting a child to fill inside a hug grid turns the grid to fix.
- A fill shape that arrives in a hug board by paste, move, canvas drag
  or create variant turns fix at its size, and the board keeps hugging.
  A move used to turn the board fix instead, which still collapsed the
  shape when the board fitted its children.
- When delete, hide, show or make absolute leaves only fill children,
  the board turns fix at its size, as moving a child out already did.
  This covers all the hide and show paths and deletes on other pages.
- The plugin API sizing, hidden and visible setters go through the same
  events as the design panel, so plugins and MCP get the same guards.

Files saved with collapsed sizes are not repaired by this change.

Closes #13353

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

* 🐛 Repair collapsed layout children

Add migration 0040 to restore collapsed layout children from exact sizes and
reflow the repaired boards. Guard singleton space-between layouts and require
all collapsed descendants to be repaired before a board can hug.

Closes #13353
AI-assisted-by: gpt-6-luna

* ✨ Fix MR findings
2026-11-27 11:02:58 +01:00
Juan de la Cruz
c276c41e9c
✨ Add new slides content for 2.20 release (#13368)
Add the release notes slides for 2.20: an intro and four slides on the
MCP server, WebGL rendering by default, design tokens, and safer saves.
Point the "0.0" release notes to 2.20.

Signed-off-by: elhombretecla <delacruzgarciajuan@gmail.com>
2026-11-27 10:44:43 +01:00
Elena Torró
23435832c3
📚 Update the 2.20.0 changelog 2026-11-27 10:37:16 +01:00
Andrey Antukh
cf4e0ded38 📎 Test binfile import limit configuration
Verify that configured limits decode and reach the importer, and that
missing values use the existing defaults.

AI-assisted-by: gpt-6.1-terra
2026-11-26 18:02:57 +00:00
Elena Torró
640a9665a2
🐛 Rotate container drop shadows in vector PDF export 2026-11-26 16:51:31 +01:00
Eva Marco
ee328dfcb9
🐛 Sync the bool type of a copy with the type it ends with (#13337)
* 🐛 Keep the bool type of a moved copy when its main becomes a group

:type is synced with the geometry group and :bool-type with the content
group. When the main bool became a group and the copy had its geometry
touched, the copy kept :type :bool but lost :bool-type, and the backend
rejected it as an invalid shape.

Sync :bool-type with the geometry group, next to :type and the path
content it defines.

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

* 🐛 Sync the bool type of a copy with the type it ends with

From the review: moving :bool-type to the geometry group stopped a new
bool operation of the main from reaching any moved copy, and dropped the
operation overrides stored as content-group touched.

Keep :bool-type in the content group. In update-attrs, work out the
type the copy ends with (its own when the geometry group is touched):
a bool never loses its :bool-type, and any other type gets none. Tests
cover a moved copy when the main becomes a group, a new operation
reaching a moved copy, a moved group copy when the main becomes a bool,
and an operation override on a copy.

AI-assisted-by: claude-opus-5-5
2026-11-26 14:20:39 +01:00
Juanfran
1ebb5ee6d9
🐛 Forward only backend rows to the admin console audit log (#13361)
Any signed-in profile can push events with any allowlisted name through
the browser endpoint and point them at any organization or member. The
admin console consumer forwarded those rows like real ones, so a user
could add forged entries to another organization's audit log.

The consumer now forwards an allowlisted row only when its source is
"backend". Browser rows count as skipped, so the cursor still passes
them. Every allowlisted name has a backend producer; the six names the
Admin Console browser used to send are recorded by its server now
(penpot/penpot-nitrate#901).

AI-assisted-by: claude-opus-5-5
2026-11-26 13:24:46 +01:00
Elena Torró
9c61a5bd9d
🐛 Fix shape drop shadows on image fills with alpha (#13279)
* 🐛 Shape drop shadows by the alpha of image fills

* 🐛 Shape exported drop shadows by the alpha of image fills

* 🐛 Cast child silhouettes for image-fill frame drop shadows

Image-only fills can leave transparent holes, so the direct container
drop-shadow path must not skip descendant silhouettes. Exclude those
frames from the fast path and from the covering check, and cover the
gate with unit tests.

AI-assisted-by: composer

* ♻️ Drop unreachable image branches from frame shadow fast path

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

* ⚡ Size raster export image shadow masks to the output resolution

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

---------

Co-authored-by: Alejandro Alonso <alejandroalonsofernandez@gmail.com>
2026-11-26 13:02:41 +01:00
Eva Marco
09b53a4932
🐛 Ignore 0fr tracks when a grid hugs its content (#13256)
With auto width or height, the fr unit is the largest size / value of
the flex tracks. A 0fr track divided by zero, so the fr was infinite,
the track size became NaN and so did the position of every child. The
backend rejected the shape and the save. Skip tracks with no fr value
when computing that minimum, in common (SVG renderer) and in
render-wasm (WebGL renderer). A 0fr track keeps the size of its
content, as in CSS.

Closes #13255

AI-assisted-by: claude-opus-5-5
2026-11-26 12:03:20 +01:00
Eva Marco
bb79d2f207
🐛 Keep typed values within the limits of editable selects (#13251)
* 🐛 Keep typed values within the limits of editable selects

A number editable select passed no :min or :max to its input, so only
the arrow keys kept the value in range. A typed guide size of 0 or less,
or a typography font size out of range, reached the backend, which
rejected the shape and the save. Pass the limits to the input, which
already clamps the typed value.

Closes #13250

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

* 🐛 Keep values unchanged when leaving a number input untouched

The number input clamped its value on focus, so with the new limits
leaving an Auto grid size without typing saved 1, and leaving a field
with an old value out of range rewrote it. Focus now keeps the current
value; only typed and stepped values are clamped.

The grid size field is also nillable now: Auto shows its placeholder
instead of 0, and clearing the field goes back to Auto.

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

* 🐛 Keep untouched and mixed number inputs unchanged on leave

The keydown handler stored the clamped value for every key, so Tab or
Escape on a font size of 2 saved 3 with no typing. Store it only for
arrows and Enter; typed text is stored by the change handler.

A mixed value has no number, so leaving the field fell back to the
default 0 and saved a font size the backend rejects. Leaving a field
that is not nillable without a value now saves nothing.

AI-assisted-by: claude-opus-5-5
2026-11-26 09:40:30 +01:00
Andrey Antukh
a474de4abf
🐛 Fix the pointer-map read and write contracts (#13055)
* 🐛 Fix the pointer-map read and write contracts

fdata/objects-map is consolidated, so the server stops negotiating it:
get-file and get-file-snapshot no longer convert it for a client that
does not declare it. Converting it rewrote the page map, and doing that
on a page that is still a pointer produced a fresh fragment id with no
row behind it (a read never persists), so the client got a 404 for
every page.

The save path now reattaches unchanged pages after migrating, like the
read path: a save that triggers a pending migration keeps the fragment
ids of the pages the migration does not change.

A pointer carries its file id in its metadata and the fragment loader
resolves with it, so it no longer depends on a per-file binding. That
makes libraries lazy (they were materialized in full on first access),
removes the file-id argument from the loader macros and the extra
arities of realize-pointers, and lets the snapshot preview resolve
without the live file id. A pointer without the field raises instead
of falling back: the feature has never been enabled in production.

Also use with-untracked in the validation and repair sites, cover
enable-objects-map with the encode-file tracking binding, document the
fragment contract, and delete two dynamic vars that have had no
readers since 2024-01-17.

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

* 🐛 Fix the pointer-map review findings

The snapshot preview no longer materializes the objects map when it has
to apply a pending migration: it realizes the pointers only, so an old
version and an already-migrated one return the same shape. The preview
stays read-only.

`wrap` now lets the bound metadata win, so the `:file-id` of the file
that writes the fragment row is authoritative, and the ns docstring
records that pointer metadata is changed with `vary-meta` (it merges
over the current map and keeps the file id) rather than `with-meta`.

Also bind the fragment loader in `srepl/main/validate-file-schema`,
remove a leftover argument from a test, and add the two missing tests:
the public RPC rejects a marked fragment while the internal loader
reads it, and the id plus the metadata survive the fressian and transit
round-trip.

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

* 🐛 Avoid orphan fragments during save migrations

Skip pointer tracking only while pending migrations run. Reattach unchanged
pointers after tracking resumes; verify stored fragment references in tests.

AI-assisted-by: gpt-6-luna

* 🐛 Prevent save migration tests from masking failures

Use one non-migrating file read for post-save IDs and migration state, so
a later read cannot mask a missing migration record.

AI-assisted-by: gpt-6-luna
2026-11-26 09:22:28 +01:00
andrés gonzález
00e7835b18
✨ Send the file id and validation codes with the save-failed event (#13339)
The save-failed audit event now carries the file of the failed commit and
the distinct codes of the validation details, so failed saves can be split
by cause and broken files counted from the event itself.

Since the backend keeps the valid commits of a save and returns the rest
as rejected, a validation failure no longer halts the queue and sent no
event. The rollback of rejected commits now sends save-failed too, with
the number of rejected commits.

Closes #12578

AI-assisted-by: claude-opus-5-5
2026-11-25 16:50:52 +01:00
Eva Marco
c55c9900b7
🐛 Keep a valid transform when a shape is squashed far from the origin (#13325)
* 🐛 Keep a valid transform when a shape is squashed far from the origin

A path squashed almost flat tens of millions of pixels from the origin
got an inverse transform with values beyond the safe range, for example
:f -1.04E10. The backend rejected the shape as invalid and the file
stopped saving.

apply-transform already kept the previous transform pair when the new
one had no inverse. It now does the same when either matrix is not a
valid matrix.

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

* 🐛 Check the squashed geometry in the transform overflow test

From the review: once the fallback keeps the identity pair, the product
of the transform and its inverse is the identity by construction. Also
check that the selrect and the points still follow the squash, and point
the test comment to #13324.

AI-assisted-by: claude-opus-5-5
2026-11-25 15:53:03 +01:00
Michael Panchenko
aab5a4752f
✨ Add on-demand pull request reviews (#13272)
* ✨ Add on-demand pull request reviews

Run Claude Code, Copilot CLI and OpenCode Go from PR slash commands in the
official development image. Let maintainers configure a default model and
effort for each reviewer and override both in a comment. Configure MCP
for code navigation and reply to inline questions in their original thread.

AI-assisted-by: gpt-6
Signed-off-by: Michael Panchenko <michael.panchenko@oraios-ai.de>

* ✨ Add a local runner for pull request reviews

Run the CI review scripts for a PR on a local machine and print the
review instead of posting it. Use the local Claude login when no OAuth
token is set, start Serena through uvx when it is not installed, and
show OpenCode errors when it returns no answer.

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

* ✨ Add /review and default OpenCode to DeepSeek V4.1 Flash

Accept /review at the start of a comment as an alias for /oc with the
repository defaults, and keep the typed command as the native agent's
mention. Use deepseek-v4.1-flash when no OPENCODE_MODEL is configured.

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

* 🔧 Default OpenCode reviews to high effort

Use high effort for DeepSeek V4.1 Flash when no OPENCODE_EFFORT is
configured, in CI and in the local runner.

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

---------

Signed-off-by: Michael Panchenko <michael.panchenko@oraios-ai.de>
Co-authored-by: alonso.torres <alonso.torres@kaleidos.net>
2026-11-25 14:56:11 +01:00
andrés gonzález
89717787c7
📚 Fix shortcut labels and ruler guide keys in the user guide (#13228)
* 📚 Fix Clear undo keys and snap labels in shortcuts docs

Clear undo is bound to alt+q on every platform, not Ctrl+Q on Linux and
Windows. The two snap rows used labels that do not match the actions
their keys toggle: Ctrl+Shift+' is "Snap to guides" and Ctrl+Shift+G is
"Snap to ruler guides" in the app.

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

* 📚 Align guide shortcut labels and macOS keys in the user guide

Rename "Show/hide grid" to "Show/hide guides" to match the app label for
Ctrl+'. Use the macOS option symbol for Copy link to board and in the
shortcut recording note. Keep the snap rows in alphabetical order.

Fix the ruler guides shortcut in Workspace basics: ruler guides show
only while rulers (Ctrl+Shift+R) and guides (Ctrl+') are both visible.
Document Ctrl+Shift+G to toggle snap to ruler guides.

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

* 📚 Note that toggling guides also hides board guides

Ctrl+' hides ruler guides and board guides alike, since both depend on
the same display-guides setting.

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

---------

Co-authored-by: Roshan Ramani <roshanramani.dev@gmail.com>
2026-11-25 14:19:35 +01:00
Eva Marco
edd487cddd
🐛 Normalize legacy svg attrs of pasted shapes (#13334)
* 🐛 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
2026-11-25 13:58:36 +01:00
Eva Marco
efe420e3e4
✨ Count the trips of a throttled update loop before reporting it (#12941)
* ✨ Count the trips of a throttled update loop before reporting it

The report of a throttled update loop could not tell a loop that goes
on from a long chain of updates that ends. It now waits five seconds
and reports how many times the scheduler tripped meanwhile, the stack
of the last trip and the number of objects of the page. The trace still
shows the first trip.

Relates #12580

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

* ♻️ Drop the bang suffix from the update loop report function

Review asked for no new functions with a ! suffix.

AI-assisted-by: claude-opus-5-5
2026-11-25 13:52:15 +01:00
Elena Torró
1438be5b26
🐛 Keep variant property order and remove the right property past eight
Variants.properties and currentValues() went through a set, which loses
order past eight items, so index-based removeProperty/renameProperty from a
plugin hit the wrong property. Use distinct to keep the order.

In the sidebar, input-with-meta* kept the input node after a real blur and
replayed a stale rename with an old position when its row unmounted,
undoing a property removal. Clear the node in on-stop-edit.

Add a unit test, a plugin-api-test-suite case and a plugins changelog entry.

Closes #13247
2026-11-25 13:39:09 +01:00
Pablo Alba
7f53bf76b6 🐛 Ignore default constraints when syncing library components
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
2026-11-25 13:20:03 +01:00
Eva Marco
6337810676
🐛 Keep the image when Selected colors changes a text color (#13313)
color-att->text built the text fill without the :image of the color,
so picking an image in Selected colors left a fill with only
:fill-opacity. The backend rejected the text as an invalid shape. The
same gap made an image fill impossible to match, so changing it back
to a plain color did nothing.

AI-assisted-by: claude-opus-5-5
2026-11-25 12:42:21 +01:00
Pablo Alba
571ee80a4b 🐛 Validate and repair variant properties as a set
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
2026-11-25 12:17:42 +01:00
Andrey Antukh
2b67de0e29 📎 Fix copyright header on several files 2026-11-25 09:26:43 +01:00
Andrey Antukh
70ca1f8869 📚 Keep review plans as siblings
Keep later review rounds tied to the original plan and verify code changes,

not prior review reports.

AI-assisted-by: gpt-6-luna
2026-11-25 08:13:04 +00:00
Belén Albeza
490995501d
🐛 Resize auto-width texts when a typography is applied (#13315)
With the WebGL renderer, applying a typography changed the text but left
its box at the old size, because nothing asked the renderer to measure
the text again. apply-typography now waits for the new font and resizes
the auto-grow texts inside its undo step, as the Design tab does.

The typography bar at the bottom of the canvas had its own copy of this
logic, with no resize and no undo step: the font-load heal resized the
box later without recording undo, so Ctrl+Z left the new size. It now
calls apply-typography.

Closes #13124

AI-assisted-by: claude-opus-5-5
2026-11-25 07:43:10 +01:00
andrés gonzález
b0c569d891
🐛 Submit the import audit events from the import job (#13150)
* 🐛 Submit the import audit events from the import job

Since 2.20 the dashboard imports .penpot files through the
:import-binfile job, which submitted no audit event. The outcome of
an import and the files it created were lost, so analytics could no
longer tell completed imports from failed ones.

The job now submits the import-binfile event with the name and props
of the legacy RPC event (status, file-ids, file-count, project,
version, generated-by, referer), plus the job id, the team id, the
package size and the elapsed time. A cancelled job reports the
cancelled status. A completed import also submits a create-file event
per imported file, as the legacy RPC does. As in the RPC, an import
refused by the permission check submits no event.

Closes #13148

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

* 🐛 Audit import jobs at their terminal transition

Run optional terminal hooks in the winning job transaction and use one
for import audit events. Preserve the separate import transaction and
cover cancellation, rollback, RPC paths, and dispatcher aborts.

AI-assisted-by: gpt-6.1-terra

* ♻️ Simplify the terminal job hook contract

Pass a semantic terminal job to the hook with its final status and
decoded parameters, result or error. Adapt the import audit and tests.

AI-assisted-by: gpt-6.1-terra

* 🐛 Keep import jobs bound to their original team

Freeze the destination team when creating an import job and serialize
imports with project moves. Use the frozen team for audit and webhook
events, and keep compatibility with existing jobs.

Select import audit props explicitly to prevent new job parameters from
being included in events by default.

AI-assisted-by: gpt-6.1-terra

* 📚 Document the import team fallback removal

Mark the legacy job audit fallback for removal in version 2.21.0.

AI-assisted-by: gpt-6.1-terra

* 🔧 Validate canonical AI model IDs in commit trailers

Require bare lowercase model IDs in AI-assisted-by trailers and cover
the validation with tests. Align the commit and PR workflows with the
same attribution rules.

AI-assisted-by: gpt-6.1-terra

---------

Co-authored-by: Andrey Antukh <niwi@niwi.nz>
2026-11-24 22:39:35 +01:00
Eva Marco
dadf4d3076
🐛 Keep all padding sides when setting one on a layout without padding (#13266)
* 🐛 Keep all padding sides when setting one on a layout without padding

Setting one padding side on a board whose layout had no stored padding
(made through the API or MCP) saved only that side, for example {:p1 12}.
The backend rejected the shape as invalid.

Start a padding change from the four sides at 0 when the shape has no
padding yet.

Closes #13265

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

* 🐛 Complete the layout padding after patching it

From the review: fill the four padding sides after the patch instead of
before, so a side cleared to nil also becomes 0, and any layout change
completes a partial padding saved before the fix.

AI-assisted-by: claude-opus-5-5
2026-11-24 16:08:08 +01:00
Eva Marco
590c3add36
🐛 Leave gradient mode when undo removes a stroke gradient (#13262)
* 🐛 Leave gradient mode when undo removes a stroke gradient

Undoing a gradient with the color picker open sent a plain color.
The picker dropped the stops but stayed in gradient mode, so adding
a stop built a gradient with no coordinates or colors and applied it
to the stroke. The backend rejected it as an invalid shape.

Switch the picker to color (or image) when the color is no longer a
gradient, and skip invalid gradients before applying them.

Closes #13261

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

* 🐛 Cover more colorpicker cases in the stroke gradient tests

From the review: plain and image colors still reach on-change through
the gradient guard, both gradient types leave the gradient tab, and a
plain color keeps the color tab. The image tab test is renamed after
what it checks.

AI-assisted-by: claude-opus-5-5
2026-11-24 16:07:17 +01:00
Eva Marco
915d405a9c
🐛 Drop nil style attrs when the legacy text editor saves (#13253)
The legacy editor writes the attrs it gets into the data of an empty
paragraph, nil values included, so turning off a text decoration there
leaves :text-decoration nil. finalize-editor-state copied that data into
the shape content as it was, the only commit path that skipped
ensure-valid-text-content, and the backend rejected the shape. Build the
content with a helper that runs it, shared by both renderer branches.

Closes #13252

AI-assisted-by: claude-opus-5-5
2026-11-24 15:47:45 +01:00
andrés gonzález
aa5e62a417
🐛 Fix SVG upload frame when the selection is inside a group (#13282)
* 🐛 Fix SVG upload frame when the selection is inside a group

With a shape selected inside a group, an uploaded or pasted SVG goes
into that group, but its frame-id came from the board under the drop
point. When the two boards differ, the save fails with invalid-frame.
Take the frame from the group instead.

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

* 🐛 Keep SVG upload frame aligned with its parent

Keep the SVG upload frame and parent from the same source.

When a shape inside a group was selected, the frame for the new SVG
came from the board under the cursor while the parent came from the
group, so saving failed with invalid-frame. The parent and frame now
come from one shared predicate, which also prevents a repeat of the
original drift between two copies of the condition.

Add the board-parent test for the frame branch this change rewrote,
and make the group checker assert that the SVG exists and that its
frame is the expected one. Add mutation evidence for both.

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

---------

Co-authored-by: Luis de Dios <luis.dedios@kaleidos.net>
2026-11-24 15:15:46 +01:00
Belén Albeza
e1818c88bb
✨ Remove the "Text Editor v3" label from the WebGL info overlay (#13293)
Text Editor v3 is now the default, so the label no longer tells anything.
Drop the TEXT_EDITOR_V3 render flag and the frontend code that set it.
The "WebGL rendering" label stays.

Closes #13289

AI-assisted-by: claude-opus-5-5
2026-11-24 14:50:37 +01:00
Eva Marco
271f5af784
🐛 Give a color to the stroke created when its style changes (#13264)
* 🐛 Give a color to the stroke created when its style changes

Changing the width, style or alignment of a stroke that a shape did not
have built the stroke from the style attributes only, with no color. The
backend rejected the shape as invalid.

Start from the default stroke, as the per-side width and the stroke width
tokens already do.

Closes #13263

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

* 🐛 Read bool strokes in the multiple selection menu

The bool type lacked :strokes in its editable attrs, so the multiple
selection menu ignored bool strokes. With a bool without strokes and a
shape with one selected, the menu showed that stroke as shared, and
editing it created a stroke on the bool. Two bools with the same stroke
showed none.

Relates to #13263

AI-assisted-by: claude-opus-5-5
2026-11-24 14:34:28 +01:00
Andrey Antukh
bc3f8dd6ef Merge remote-tracking branch 'origin/staging-2.19.x' into staging 2026-11-24 12:45:02 +01:00
Andrey Antukh
b52fcc7e6d 🎉 Add a command to create pull requests
Add `gh.py create-pr` to create pull requests with automatic base detection,
optional issue linking and support for project and draft options. Normalize
and validate detected base branches, and report the created URL if issue
linking fails. Update the skill and workflow documentation, and cover the
command and base detection with tests.

AI-assisted-by: hy4-flash-free
2026-11-24 12:33:09 +01:00