24752 Commits

Author SHA1 Message Date
Roshan Ramani
e202612469
📚 Fix the telemetry flag name in the configuration guide (#13032)
The guide told self-hosters to add enable-telemetries to PENPOT_FLAGS.
flags/parse turns that into :telemetries, which nothing reads; the
telemetry task checks :telemetry, so the documented flag never enables it.

AI-assisted-by: claude-opus-5-5
2026-11-13 08:31:37 +01:00
penpot-renovate[bot]
c19f7a6e5d
⬆️ Update dhi.io/node image to v24.22.3 (#13031)
- dhi.io/node 24.22.3@ (docker/devenv/Dockerfile)
- dhi.io/node 24.22.3@ (.nvmrc)
- dhi.io/node 24.22.3-debian13-dev@aee95f1 (docker/images/Dockerfile.media-processor)
- dhi.io/node 24.22.3-debian13@84adaf3 (docker/images/Dockerfile.mcp)
- dhi.io/node 24.22.3-debian13-dev@aee95f1 (docker/images/Dockerfile.mcp)
- dhi.io/node 24.22.3-debian13-dev@aee95f1 (docker/images/Dockerfile.exporter)

Signed-off-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com>
Co-authored-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com>
2026-11-13 08:30:10 +01:00
Andrey Antukh
5c45c8ddaf Merge remote-tracking branch 'origin/staging' into develop 2026-11-13 08:18:50 +01:00
Andrey Antukh
ad710ed143 📚 Document the squash-merge default and the no-squash opt-out
Squash merge appeared twice in the guide, as a review-process bullet and
in branch naming, with no reason and no way out. Add a Merging
subsection: one PR lands as one atomic commit, so the history stays
readable and git bisect never stops on an intermediate commit that fails
the tests or the linter. A contributor who keeps every commit
self-contained may ask for a regular merge in the first line of the PR
description.

Record the same contract in mem:workflow/creating-prs (merge strategy,
and the Merge line above the AI Note line) and in
mem:workflow/creating-commits (what a self-contained commit means when a
regular merge is requested).

AI-assisted-by: deepseek-v4.1-flash
2026-11-13 07:10:24 +00:00
Andrey Antukh
9bac1d290b 📚 Clarify when to run the file_change partition procedure
The procedure straddles the upgrade to 2.20.0 and the document said
nothing about the order. The preparation (phases 0 and 1) goes before
the version update, the bulk and the delta passes after it, and only
the cutover needs a scheduled maintenance window. The subtitle claimed
the whole thing was online, which is not true.

The copy marks no longer travel as a session GUC with a date typed by
hand. The delta mark is seeded at the bulk with `now()`, and a CHECK
keeps it from ending up empty; the instant of the cutover is recorded
in the same table after the commit, so the checks of phase 5 read it
instead of comparing against a date the operator retypes in every
session.

The procedure was run end to end on a scratch database, with the 23
SQL blocks extracted from the document and the application writes
simulated between the phases.

AI-assisted-by: deepseek-v4.1-flash
2026-11-13 06:58:46 +00:00
deni-ing
d774e197d0
🐛 Make GitHub logo follow the theme on the login page (#12943)
The GitHub icon had a hardcoded white fill, so it was almost
invisible on the light theme. Use currentColor so it follows
the button text color.

Fixes #12938

Signed-off-by: deni-ing <242363192+deni-ing@users.noreply.github.com>
2026-11-12 18:26:57 +01:00
Luis de Dios
24a5fd2043
♻️ Refactor the share link dialog to the design system (#12965)
* ♻️ Split the share link dialog into smaller components

Move the dialog state into a content component and extract the
permissions section, the page selection, the select rows, the
collapsible panel and the destroy confirmation.

The confirmation now keeps the link to destroy instead of matching it by
flags, so deleting a link no longer depends on the options snapshot.

AI-assisted-by: deepseek-v4.1-flash
(cherry picked from commit 3ce7f9d09765e4f6afc033db544aabca379c0ca4)

* ♻️ Use the design system controls in the share link dialog

Replace the deprecated select, the raw text input and the hand-written
page checkboxes with the design system select, input field and checkbox
components, and drop the deprecated icons and the unused uuid parsing.

AI-assisted-by: deepseek-v4.1-flash
(cherry picked from commit 3ce7f9d09765e4f6afc033db544aabca379c0ca4)

* ✨ Add dialog semantics to the share link dialog

Give the dialog and the destroy confirmation proper dialog and
alertdialog roles and labels, cancel the confirmation with Escape, and
connect the disclosure button with its panel through aria-controls.

AI-assisted-by: deepseek-v4.1-flash
(cherry picked from commit 3ce7f9d09765e4f6afc033db544aabca379c0ca4)

* ✨ Toggle the share dialog from the viewer header

Let the share button close the dialog when it is already open, report
the dialog state with aria-expanded and aria-pressed, and mark the
button with data-allow-click-modal so the closing click does not count
as an outside click.

Drop the click-outside guard on close; it is not needed once the button
can reopen the dialog.

AI-assisted-by: deepseek-v4.1-flash
(cherry picked from commit 3ce7f9d09765e4f6afc033db544aabca379c0ca4)

* 🐛 Move focus into the share dialog and restore it on close

Move focus into the dialog when it opens and into the Cancel button when
the delete confirmation opens, so Escape reaches the confirmation handler
instead of closing the whole dialog.

Restore focus to Destroy link when the confirmation closes and to the
Share button when the dialog closes.

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

* ♻️ Apply review follow-ups to the share link dialog

Use aria-haspopup instead of aria-pressed on the Share toggle, drop the
raw z-index, and express the small spacing values with px2rem. Restore
the collapsible pointer cursor and merge its two classes.

Memoize the permission options, expose aria-controls only while the
panel is open, and label the read-only URL field.

AI-assisted-by: deepseek-v4.1-flash
2026-11-12 17:53:39 +01:00
Danny Shirely
192e76781a
✨ Add export previews to Design and Inspect (#12059)
* ✨ Add export previews to Design and Inspect

Preview a selected shape's export presets in Design and Inspect, with
output dimensions and a shared persisted expansion preference.

Bound native previews to 240px and debounce subtree updates while keeping
the current image until its replacement is ready. Release replaced URLs
and cancel pending rendering when the preview closes.

Keep this change focused on previews and track native export fill
handling separately.

Closes #7561

AI-assisted-by: gpt-6
Signed-off-by: Danial Shirali <danialshirali16@gmail.com>

* 🌐 Add Spanish translations for the export preview

The export preview added four new keys only to en.po, so Spanish users
saw them in English.

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

* 🌐 Improve the Spanish export preview labels

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

---------

Signed-off-by: Danial Shirali <danialshirali16@gmail.com>
Co-authored-by: Eva Marco <evamarcod@gmail.com>
2026-11-12 17:23:46 +01:00
Andrey Antukh
ec1e2c9e1a Merge remote-tracking branch 'origin/staging-2.19.x' into staging 2026-11-12 15:36:44 +01:00
Andrey Antukh
92c478b0e2 Merge remote-tracking branch 'origin/merge-staging' into staging 2026-11-12 15:32:33 +01:00
Andrey Antukh
dc38eaa843
🐛 Fix font upload crash and preserve font metadata (#11951)
* 🐛 Fix font upload crash and preserve variant metadata

opentype.js 2.0.0 returns no fontSubfamily name for fonts whose
Macintosh name table only holds custom records. That made
parse-font-weight/parse-font-style call re-seq on nil and crash the
upload.

A nil or blank variant is now treated as no match in
app.common.media, defaulting to weight 400 and style normal. The
variant parsing also accepts oblique as italic, and the new
parse-font-family helper derives the family from a filename by
stripping the known weight/style tokens, separating a style token
glued to a weight token ("Roboto-BoldItalic" -> "Roboto").
first-nonblank-string returns the first nonblank candidate, so a
blank preferredFamily/preferredSubfamily no longer shadows a valid
fontFamily/fontSubfamily.

app.main.data.fonts gains resolve-font-metadata and
prepare-font-entry. opentype.js values win per field; any missing
value falls back to the filename-derived family, weight and style.
The parsed and woff2 branches share the same helper, so metadata is
preserved instead of collapsing every face to weight 400, and
fonts with missing vertical-metric tables upload with no height
warning instead of failing.

process-upload reports per-file failures (unknown signature,
unparseable file, preparation error) with a single bad-font
notification instead of silently dropping them, and never errors
for per-file failures.

The upload now sends :variant-name to create-font-variant, which
accepts it as an optional param (ships in 2.20), so the foundry
name survives the upload.

Closes #10436

AI-assisted-by: deepseek-v4.1-flash
AI-assisted-by: muse-spark-1.3-contributor
Signed-off-by: CHOI JUNSOO <junsoo1172@gmail.com>

* 🐛 Parse glued font style tokens in the font parsers

EvaMarco's review on #11951: parse-font-family and
parse-font-weight handled glued tokens like "BoldItalic", but
parse-font-style did not. For names such as
"opensans-bolditalic-webfont.woff2" the three parsers disagreed:
the italic face resolved to style normal and collided with the
bold-only file on the (family, weight, style) join key. One
binary silently overwrote the other during upload, losing one
font face without any warning.

A new private normalize-font-name helper is applied by all three
parsers. It splits a style token glued to a weight token, now
with a lookahead boundary so "LightItalic_v2" splits too, and
strips a trailing technical suffix (-VF or _v<number>).
parse-font-family, parse-font-weight and parse-font-style now
interpret the name consistently.

Tests cover the three cases from the review, the bold-only
control case, and an end-to-end process-upload check that a bold
and a bold-italic WOFF2 survive as two variants.

Relates to #10436 and PR #11951.

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

* Remove duplicate frontend test registration

---------

Signed-off-by: CHOI JUNSOO <junsoo1172@gmail.com>
2026-11-12 15:29:30 +01:00
Marina López
5803f2594c
🐛 Show the organization in the new team form (#13023) 2026-11-12 15:11:43 +01:00
Marina López
029283b1f9
🐛 Hide standalone Enterprise plans for team owners (#13017) 2026-11-12 14:54:56 +01:00
Luis de Dios
185fef889b
🐛 Fix collapsing token set groups after reordering (#12671)
* 🐛 Fix collapsing token set groups after reordering

The handler captured the first render path, and the tree is keyed by
index, so after a reorder it toggled the path of another group.

Closes #12625

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

* 🐛 Refresh double click handler of token set groups

Add the start edition callback to the hook deps so the handler does
not keep the initial closure.

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

* ✨ Add regression test for folding reordered token set groups

Reorder a group in the sets tree, fold it, and assert that only that
group collapses. The tree is keyed by index, so the test also proves
the collapse handler does not keep a stale path after a reorder.

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

* 🐛 Refresh double click handler of token set nodes

Add the start edition callback to the hook deps so the handler does not
keep the initial closure.

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

* ♻️ Key token set tree nodes by identity instead of index

React reuses a node by its key. Keyed by the tree index, a reordered
group moved the instance to another node and its handlers kept the
previous paths. Groups are now keyed by path and sets by id, so each
node keeps its own handlers.

The set being created has no persisted id yet, so the tree walk
generates a new one on every render. Keep one uuid for its whole
creation instead.

AI-assisted-by: deepseek-v4.1-flash
2026-11-12 13:49:43 +01:00
Miguel de Benito Delgado
ef725c0cc2
🔧 Enable checking commit messages from files (#12951)
Adds a new flag --message-file to check-commit

AI-assisted-by: deepseek-flash
2026-11-12 13:28:35 +01:00
Eva Marco
d829e47a04
🔧 Run the Playwright tests with a dark color scheme (#12989)
* 🔧 Run the Playwright tests with a dark color scheme

Since #12480 a profile without a theme follows the system one, and
headless Chrome reports a light scheme, so the e2e tests ran with the
light UI. Set colorScheme to dark in the shared Playwright options so
the tests use the default dark UI again. Tests that need another scheme
still set it with page.emulateMedia.

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

* 🔧 Drop the dark color scheme overrides now set for every test

The shared Playwright options now set the dark color scheme, so the ds
project override and the emulateMedia call in the selection size badge
test do nothing.

AI-assisted-by: claude-opus-5-5
2026-11-12 13:27:52 +01:00
penpot-renovate[bot]
88e1b29e5c
⬆️ Update DHI base images (#13008)
- dhi.io/debian-base trixie-debian13@c12f605 (docker/imagemagick/Dockerfile)
- dhi.io/nginx 1.31.8-debian13-dev@a5fc6ab (docker/images/Dockerfile.frontend)
- dhi.io/node 24.22.2-debian13-dev@8a0d16b (docker/images/Dockerfile.media-processor)
- dhi.io/node 24.22.2-debian13@fb9c8a5 (docker/images/Dockerfile.mcp)
- dhi.io/node 24.22.2-debian13-dev@8a0d16b (docker/images/Dockerfile.mcp)
- dhi.io/node 24.22.2-debian13-dev@8a0d16b (docker/images/Dockerfile.exporter)

Signed-off-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com>
2026-11-12 13:10:05 +01:00
andrés gonzález
9d42ed29ce
📚 Document how to order variant properties and values (#12996)
Users ask how to choose the order of values in the variant property
dropdown. The values follow the order of the variants in the Layers
panel, and this was not documented. Also document that properties can
be reordered by dragging them in the Design tab.

AI-assisted-by: claude-opus-5-5
2026-11-12 13:04:13 +01:00
JiMyung Lee
61154e6bfe
✨ Keep the swap component search when changing library (#12873)
Changing the library in the Swap component menu cleared the search
field, so checking several connected libraries for the same component
meant typing the name again for each one. Keep the term and reset only
the library id and the group path, so the new library is shown already
filtered.

Closes #12335

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

Signed-off-by: JiMyung Lee <lee.ji.myung@gmail.com>
2026-11-12 12:45:36 +01:00
Marina López
b5eab6a949
💄 Update promotional banner (#12944) 2026-11-12 12:35:13 +01:00
Belén Albeza
86a8ac34cd
🎉 Add basic bullet lists to the v3 text editor (#12720)
* 🎉 Add UI for toggling bullet lists (under config flag)

* 🎉 Store list-style-type as a paragraph attribute

The bullet list toggle now saves list-style-type ("none" or "disc") on
the selected paragraphs and reads it back. A paragraph without the attr
counts as "none", so a bullet paragraph next to an older one shows as
mixed.

WASM keeps the value on each paragraph: the paragraph bytes grow from
12 to 16, Enter keeps it on the new paragraph, and the v3 editor reports
it in the current styles, so the sidebar shows it while editing too.

Refs #12630

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

* ✨ Draw bullets for list paragraphs

A paragraph with list-style-type "disc" now gets a solid round bullet,
sized as Chrome draws a CSS disc marker (measured with Source Sans Pro):
a radius of 0.16 font sizes, centered 0.32 font sizes above the first
baseline, with a gap of 0.33 font sizes before the text. The bullet
hangs outside the text box, before its start edge (after it for RTL),
like CSS list-style-position: outside, so the text layout, caret and
selection stay as they were.

The bullet takes the paint of its line's first style run, so fills,
strokes, shadows and masks apply to it as they do to the glyphs. An
empty item, which has no run, borrows the previous item's paint. The
cached paint, the text extrect and text-to-path share one walker over
the paragraphs, so they always agree: the extrect grows to hold the
bullets, like shadows and blur, and flattening a text keeps them.

Refs #12630

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

* ✨ Show the list style in Inspect

Text paragraphs with list-style-type "disc" now show a "List Style" row
in the Inspect Styles and Computed views, after Text Transform. Its copy
action gives "list-style-type: disc;". Text without a list shows no row.
The list item check lives in common as list-paragraph?, so every place
that needs it shares one rule.

Refs #12630

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

* ✨ Generate list HTML and CSS for bullet paragraphs

In the Inspect code, neighbouring paragraphs with list-style-type
"disc" become one <ul> with an <li> each, keeping the paragraph's class
and dir. Other paragraphs stay <p>. Only code mode groups them; text
rendering still uses <p>.

The CSS sets list-style-type on the items and resets the list's margin
and padding, so the browser hangs the bullet before the text as the
canvas does. Paragraph rules set font-size: 0, so each item also gets a
::marker rule with its first span's font size and text color. A
::marker can't paint a gradient, so a gradient fill gives its first
stop.

Refs #12630

AI-assisted-by: claude-opus-5-5
2026-11-12 11:50:05 +01:00
Belén Albeza
00e77a0f53
🐛 Fix slow variant switch with the WASM renderer (#12985)
Changing a component inside a big main component made the WASM renderer
draw that component's thumbnail at full size on the main thread, before
the viewport redraw. On the Fauna file the 2140x1642 thumbnail took about
1.2 s to render and PNG-encode, so the switch showed up late.

- Fit the thumbnail's longest side between 200 and 512 px. Small
  components still scale up; big ones now scale down.
- Draw the thumbnail only on a frame with no viewport render pending

Closes #12968

AI-assisted-by: claude-opus-5-5
2026-11-12 11:49:01 +01:00
Andrés Moya
2c86db80bd 🔧 Unify migration tests 2026-11-12 11:41:27 +01:00
andrés gonzález
1eccb3b4bb
✨ Track library token usage in analytics events (#12958)
Add a from-library property to the apply-tokens event, true when the
file takes its tokens from a linked library.

Emit a link-file-to-library-tokens event with tokens-count when the
linked library has tokens, mirroring link-file-to-library-variants.
Both events share one get-library-usage call.

Closes #12915

AI-assisted-by: claude-opus-5-5
2026-11-12 11:41:11 +01:00
Miguel de Benito Delgado
756541939a
🔧 Add renderer benchmark runner (#12756)
Add a CLI under frontend/performance/benches/render_wasm that builds the
renderer, runs seeded scenes (rects, plus, paths, masks) in headless
Chromium and saves per-case timings.

- build, run: prepare or reuse builds; measure cases with warmups,
  repetitions, deadlines
- ab: build and compare Cargo feature configurations
- compare, merge: median changes with bootstrap CIs between saved runs,
  guarded by scene, build and settings checks
- purge: delete managed builds, runs or comparisons
- GPU runs through `run-devenv --gpu`

Lint, format and pnpm scripts now cover performance/ and its tests.

AI-assisted-by: gpt-6.1-sol, deepseek-flash, muse-spark, glm-5.3, gpt6-astra, claude-5.5-sonnet, claude-haiku-5.5
2026-11-12 11:02:34 +01:00
Andrey Antukh
8b9558b380
♻️ Reduce and speed up the frontend e2e token suite (#13001)
* ✨ Add unit tests for the token name schema

Cover make-token-name-schema, the schema that rejects a token name whose
path clashes with an existing token or group. The lower-level
token-name-path-exists? already had a test; the schema that composes it
did not.

The cases pin an exact duplicate, a token inside a token, a token name
that collides with a group, an existing child path, valid siblings, the
fail-closed nil tree, invalid syntax and the length limit. This is the
unit-test base for reducing the 15 group-name-clash e2e cases to two.

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

* ♻️ Remove duplicate token tests and fix the spread step

The three top-level tests duplicated the ones inside the creation
describe; only the indentation differed. Keep the originals.

The shadow token test labelled "Valid spread" filled the blur field, so
the token under test ended with blur 0 and the spread never changed.
Fill spread instead and expect the referenced token to resolve with
Blur: 4.

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

* ♻️ Reduce the token group-name-clash e2e matrix to two tests

The fifteen cases repeated the same setup and only changed the token
type and value. The rule is now covered by the token name schema unit
test, so keep two representatives: thirteen simple types in one test
with a test.step each, and the two composite forms (Typography and
Shadow) in a second test.

The helper no longer re-runs the file setup, so each test loads the
page once: 15 page loads become 2 and the block drops from 433 s to
about 21 s.

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

* ♻️ Cover the numeric token creation types in one test

The nine creation tests repeated the same validation ladder and only
changed the token label and placeholder. Run the ladder once in the
border radius step, keep the reference token creation, and create the
other eight types with a test.step each.

The new helpers split the flow: open the form, assert the ladder, save
a token. The e2e drops from nine page loads to one.

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

* ♻️ Reduce the remapping e2e spec to three tests

Keep one remapping flow per token shape: box shadow with alias
references, border radius with a value change, and a group rename with
undo. The two cancel paths lose their own page loads and become steps
inside the shadow test: close keeps the original name, and "don't
remap" renames the token and breaks the reference.

The deleted typography and shadow applied-shape cases exercise the same
data path, which the remapping unit tests already cover.

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

* ♻️ Shrink the tooltip and numeric-revert e2e tests

The tooltip test asserted five message shapes over eleven layer
selections. Keep the three that have no unit test: a deleted token, a
reference outside the active sets, and a token in an inactive set. Each
is one step with a pill label and its tooltip text.

Three of its five messages were already covered by the token pill unit
test, including both resolved-value cases.

Keep one numeric-revert test and drop the fixed sleeps: await the value
with toHaveValue instead. Division by zero and the min/max clamp are
unit-tested in the numeric input tests.

AI-assisted-by: deepseek-v4.1-flash
2026-11-12 10:58:52 +01:00
Andrés Moya
a35dd49b6a Merge branch 'staging-2.19.x' into staging 2026-11-12 10:36:04 +01:00
makesomethingshit
dfc7919f7b
🐛 Preserve HSL values while editing lightness (#12629)
* 🐛 Preserve HSL values while editing lightness

Keep HSL editing components through black, white, and grayscale.
Use the same draft for numeric inputs, sliders, and gradient previews.
Strip the draft before emitting color data and reset it on other edits.

Closes #12615

Signed-off-by: makesomethingshit <junsoo1172@gmail.com>
AI-assisted-by: GPT-6

* 🐛 Keep HSL drafts consistent across gradient and ramp edits

Match RGB components to HEX so gradient echoes preserve HSL drafts.
Discard stale HSL values when editing Ramp hue, saturation or value,
while preserving them for opacity-only changes.
Cover grayscale gradient echoes and saturation restoration.

Signed-off-by: makesomethingshit <junsoo1172@gmail.com>
AI-assisted-by: GPT-6

---------

Signed-off-by: makesomethingshit <junsoo1172@gmail.com>
2026-11-12 10:11:56 +01:00
Andrey Antukh
64a51e86fd
🐛 Fix files blocked by dangling child references in migrations (#12936) (#12979)
The 0033-normalize-main-instance-names migration walks the shape tree
following the :shapes vectors. When a parent listed a child id missing
from the container :objects map (a dangling reference), the traversal
stored the nil child into :objects, creating a nil key that made
check-file-data reject the whole file: get-file answered 500 "invalid
file data" and the file could not be opened or migrated further.

Fix it in two parts:

- 0033 returns the container untouched when a listed child does not
  exist, so the traversal never stores a nil shape.
- The append-only migration 0035-fix-dangling-children prunes from
  every :shapes vector, in pages and components, the ids absent from
  the owning container :objects map, logging each fix at trace level.
  It mirrors 0032-fix-children-not-in-parent, which repairs the
  opposite inconsistency.

Both parts are needed: 0033 runs before the repair migration, so
without the guard the same file fails again in the same migrate call.

Add regression tests for the traversal guard and for the repair
migration, and record in mem:clojure/logging the convention that
:hints start lowercase.

Closes #12936

AI-assisted-by: qwen3.8-flash
2026-11-12 09:41:49 +01:00
Marina López
df0092fc60
🐛 Enforce sso before creating organization teams (#12980) 2026-11-12 08:35:32 +01:00
Andrey Antukh
75b55b567f 📚 Document test database and valkey env discipline
Agents must respect the PENPOT_TEST_* variables already set in the
shell and not override them with values copied from CI logs (the CI
endpoints only exist inside the CI docker network) unless the user
asks otherwise, such as a temporary database.

The shared test database may carry migrations applied by newer
versions; when that blocks a test run, dropping and recreating only
the database from PENPOT_TEST_DATABASE_URI is explicitly permitted.

AI-assisted-by: inkling-2-small-free
2026-11-12 06:27:44 +00:00
Andrey Antukh
12d73d0f63 🐛 Fix flaky assertion in climit waiting-count test
The test expected exactly one publication of the :rpc-climit-waiting
gauge inside the with-redefs window. The republisher daemon thread,
started at component init with no delay and rescheduling every 15 s,
publishes the same counter and can land inside that window, so the
recorded sequence could be [0 0] and the assertion failed with
actual [0 +0] (Backend Tests job in #12979).

Assert on the last published value instead of the whole sequence,
the contract waiting-last documents and the sibling tests use.

AI-assisted-by: inkling-2-small-free
2026-11-12 06:27:40 +00:00
Andrey Antukh
e57d358c53 📎 Update .gitignore 2026-11-12 07:09:42 +01:00
Pablo Alba
34f0d12b99
🐛 Ignore float noise when syncing moved library components (#12976) 2026-11-11 17:09:33 +01:00
penpot-renovate[bot]
b438676d6c
⬆️ Update dhi.io/node image to f6ba5e2 (#12975)
- dhi.io/node 24.22.2-debian13-dev@f6ba5e2 (docker/images/Dockerfile.media-processor)
- dhi.io/node 24.22.2-debian13-dev@f6ba5e2 (docker/images/Dockerfile.mcp)
- dhi.io/node 24.22.2-debian13-dev@f6ba5e2 (docker/images/Dockerfile.exporter)

Signed-off-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com>
Co-authored-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com>
2026-11-11 16:55:19 +01:00
andrés gonzález
0d05cfaf5e
✨ Add the file to plugin and MCP audit events (#12972)
* ✨ Add the file and MCP session to plugin audit events

Events sent by plugins and the MCP plugin only carried their origin, so
the multi-file and dashboard MCP workflows could not be measured, nor
duplicated events from several open tabs spotted.

The context of se/event and se/add-event now carries the file-id of the
file the action ran in (absent on the dashboard) and, for the MCP, the
mcp-session-id of the tab connection that ran it.

Closes #12902

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

* ♻️ Drop the MCP session id from plugin audit events

Every audit event already carries the session-id of the tab in its
context, and the MCP session id is only a hash of it, so it adds
nothing to group events by tab.

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

* 🐛 Use a reified event in the system events test

ptk/data-event does not implement IWithMeta, so add-event failed on it.
Plugin actions emit reified events, which carry metadata.

AI-assisted-by: claude-opus-5-5
2026-11-11 16:18:15 +01:00
andrés gonzález
ca616a39ed
🐛 Send the plugin origin with penpotMgmt dashboard actions (#12971)
Dashboard actions made by a plugin or the MCP through penpotMgmt reached
the backend audit log without event origin, so they looked like actions
made by hand in the dashboard. The backend reads the origin from the
x-event-origin header, which rp/cmd! only sends when the params carry
::ev/origin in their meta.

Tag the params of every penpotMgmt mutation with the same meta that
se/add-event sets (mcp or plugin). The rename, share and team update
events now keep that meta on the RPC params, so setters send it too, and
set-file-variants-shared takes the caller origin instead of a fixed
dashboard one.

Closes #12901

AI-assisted-by: claude-opus-5-5
2026-11-11 16:02:29 +01:00
Pablo Alba
bb672a3723 🐛 Block grid track duplication and paste in component copies 2026-11-11 15:32:10 +01:00
Pablo Alba
3eebe92606 🐛 Keep the swap slot when duplicating a swapped nested copy 2026-11-11 15:32:10 +01:00
Gabriel Ribeiro
7e9a3c3c28 📚 Fix typos in technical and user guides
Fix five misspelled words in the docs: "notifiy" and "occured" in the
integration guide, "enviroment" in the developer guide index, "succesful"
in the authentication subsystem page and "achive" in the layers page.

AI-assisted-by: claude-opus-5-5
Signed-off-by: Gabriel Ribeiro <267068126+gabrielribeiro3105@users.noreply.github.com>
2026-11-11 15:24:13 +01:00
andrés gonzález
a301c2b43f
✨ Keep board names visibility after reloading the workspace (#12872)
Hiding board names from the View menu reset on every reload, while
rulers and comments kept their state. Add the flag to the layout flags
persisted in local storage so it behaves the same way.

Closes #12871

AI-assisted-by: claude-opus-5-5
2026-11-11 14:52:35 +01:00
andrés gonzález
54b1eb5d5f
✨ Add shape count to the apply-tokens audit event (#12970)
The apply-tokens event fires once per apply call, so a plugin or MCP
script that loops over shapes sends one event per shape while the UI
sends one per selection. Add a shape-count prop with the number of
shapes the token was applied to, so analytics can compare origins in
the same unit.

Closes #12900

AI-assisted-by: claude-opus-5-5
2026-11-11 14:43:11 +01:00
Andrey Antukh
bcac14a4a8
🐛 Skip circular library links on binfile import (#12062)
* 🐛 Skip circular library links on binfile import

File import recreated circular library references that the
link-file-to-library command already rejects. The v3 importer
now skips manifest relations that would close a cycle, or link
a file to itself, and logs each skipped link. Closes #12052.

AI-assisted-by: muse-spark-1.3-contributor-free

🐛 Address review findings on circular import guard

F1 extracts the cycle check into bfc/library-link-status and reuses
it in link-file-to-library and v3 import, keeping UI errors intact.

F3 orders get-files-rels and manifest relations so the first edge
wins deterministically, and documents it.

F2 adds a three-node transitive cycle test; F4 asserts file_library_sync
has no orphan rows for skipped links and matches rels otherwise.

AI-assisted-by: muse-spark-1.3-contributor

🐛 Pass team-id in binfile v3 circular library tests

The four circular library relation tests (import-skips-circular,
import-skips-transitive-cycle, import-skips-self-referencing,
import-keeps-acyclic) called v3/import-files! without ::bfc/team-id.
resolve-and-link-libraries asserts (uuid? team-id), so with
enable-backend-asserts the tests errored instead of running.

Add (assoc ::bfc/team-id (:default-team-id profile)) to each test,
mirroring the production RPC import path and the earlier fix in
a36193e54b for the other binfile v3 import tests.

Verified: 1338 tests, 6910 assertions, 0 failures.

AI-assisted-by: mistral-large-4

* 🐛 Guard the v1 import and restore the RPC check order

The version 1 importer recreated the circular library references that
the version 3 importer already skips, and a user reaches it through
`import-binfile` and the import job. It now asks
`bfc/library-link-status` before inserting each relation, so a self
link or an edge that would close a cycle is skipped and logged, and it
processes the relations in sorted order like v3 does. Closes #12052.

The version 2 importer stays out on purpose: only the developer REPL
reaches it, and a note in the code records the gap.

`link-file-to-library` keeps the shared helper but restores the order
of the base commit: the self link guard, then the edition permission
and team ownership checks, and only then the cycle check. A caller
without permission gets `not-found` again instead of the circular
error, and a rejected request no longer runs the recursive library
query first.

Tests: a v1 import that recreates a cycle, the self link error of the
command, and the permission check running before the cycle check.

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

* 🐛 Tolerate repeated file entries in the v1 binfile import

The v1 exporter unioned the requested files with their libraries
without deduplicating, so a package exported from a file inside a
library cycle (see #12052) lists that file twice in the metadata. The
v1 import created one file per entry, so the second insert hit the
primary key of `file` and aborted the whole import with "file already
exists".

The importer now reads the pair of objects of every entry to keep the
stream in sync but imports the first occurrence only, warns about the
repeats, and answers with one id per imported file.

The v1 export keeps its behavior: it has no caller in the product, and
only the tests and the developer REPL use it.

Tests: a package with a repeated entry, built with the v1 export from
a cyclic library pair, imports the file once and leaves no duplicated
rows.

AI-assisted-by: deepseek-v4.1-flash
2026-11-11 13:02:57 +01:00
andrés gonzález
0efa550a99
✨ Improve the changelog flow: dev-only bugs and feature sections (#12981)
* ✨ Keep bugs that never reached production out of the changelog

The team rarely adds `no changelog` to bugs found while building a
feature of the same release, so they end up in the changelog and make
Penpot look less stable than it is.

Add `changelog.py dev-only-bugs`. Bugs whose parent is a Feature or
Enhancement of the same milestone are sure: `--apply` labels them
`no changelog` on GitHub. Bugs under an epic of the milestone, with the
`regression` label, or whose version field names only hourly, develop,
staging, PRE or this milestone, are candidates for a human to confirm;
the anomaly report lists them as warnings. `gh.py issue` now returns
body and parent. The flow memory documents it as step 3.

Closes #12747

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

* ✨ Split features and enhancements in the changelog flow

Features were listed together with enhancements under "✨ New
features & Enhancements", so they did not stand out. Map the Feature
issue type to its own "🎉 Features" section, keep Enhancement under
"✨ Enhancements", rename the bug section to "🐛 Bugs" and
set the order: boom, rocket, lock, tada, sparkles, bug.

The new layout applies from 2.20.0: 2.19.0 and 2.19.1 are already out
with the old one, so 2.19.x patches keep it.

Closes #12741

AI-assisted-by: claude-opus-5-5
2026-11-11 13:00:06 +01:00
Alonso Torres
1599e096da
🐛 Fix MCP session discovery for plugins connected from the dashboard (#12865)
* 🐛 Fix MCP session discovery for plugins connected from the dashboard

With Redis-backed routing, execute_code without a sessionId timed out
with SessionDiscoveryError when the plugin ran on the dashboard. The
discovery reply schema required a string fileId and fileName, so replies
listing a session with no open file were dropped, and discovery waited
for its timeout.

Share one session schema between the plugin handshake and discovery
replies. It accepts a null file and keeps workspaceState. An unreadable
reply now fails discovery at once with an error that names the problem
and says a retry will not help. Timeout and Redis failures state their
reason.

Closes #12860

* 🐛 Stop blaming server load when MCP discovery fails on shutdown

Closing the dispatcher rejected pending discoveries with the default advice,
which blamed temporary server load. Shutdown now gives its own advice.

The dispatcher tests now cover each discovery failure path: an unreadable
reply alongside a valid one rejects with InvalidDiscoveryResponseError and
does not dispatch, a late unreadable reply leaves a settled discovery
unchanged, and timeout, Redis failure and shutdown each state their reason.
2026-11-11 12:10:34 +01:00
Alonso Torres
adda9ad908
✨ Restrict global plugins to MCP and localhost (#12949)
Plugins with global scope or a management permission (allow:global,
manage:projects, manage:teams, manage:delete) keep running outside a file
and can drive the management API. That feature is still in progress, so
only the bundled MCP plugin and plugins served from localhost, 127.0.0.1
or [::1] get it. The host check ignores letter case and a trailing dot.

The check runs at three points:

- parse-manifest throws global-not-allowed, so the plugin manager and the
  dashboard install link refuse remote global plugins with a specific
  message. Opening an installed plugin fetches its manifest again, so
  plugins stored before this change are refused too.
- start-plugin! and load-plugin! refuse to run such a plugin and warn the
  user; this also covers bundled plugins without a URL.
- has-permission? withholds the global permissions from stored remote
  plugins, so the management API rejects them.

AI-assisted-by: claude-opus-5-5
2026-11-11 10:28:11 +01:00
andrés gonzález
37f4556b0b
📚 Document MCP sign-in with OAuth (#12950)
Explain how MCP clients with OAuth support connect to the remote MCP
server with a URL that has no key: the user signs in to Penpot, allows
access, and the client receives the MCP key. Keep the key-in-URL path
for clients and instances without sign-in.

Describe the approval page, what allowing access changes, and how
regenerating or expired keys affect signed-in clients. Document
PENPOT_MCP_AUTH_URI for self-hosted instances.

Relates to #12034

AI-assisted-by: claude-opus-5-5
2026-11-11 09:54:27 +01:00
Alonso Torres
f89879cca1
🐛 Fix plugin component lookups for missing and deleted components (#12755)
* 🐛 Fix plugin component lookups for missing and deleted components

Shape.component() threw "Assert failed: (uuid? id)" on a copy whose
library is not available, because the head lookup returns a pair with a
nil component and the proxy was built anyway. It now returns null.

Shape.componentRoot() built its proxy with the component's file and main
page, so a copy on another page or file than its main got a shape that
pointed at nothing, and a copy of a missing library threw. It now
resolves the root on the shape's own file and page, like componentHead().

LibraryComponent.mainInstance() returned a proxy for the root kept in a
deleted component's objects, which is on no page, so every field read
empty and parent threw. It now returns null for a deleted component.

* 📚 Fix the variant example in the MCP instructions

The createVariantContainer example called penpot.currentPage.findAllShapes
and Shape.isMainComponent, which do not exist, so running it as written
failed. Use penpotUtils.findShapes with isComponentMainInstance instead.
2026-11-11 09:39:04 +01:00
Pablo Alba
c466c289de 🐛 Fix integrity error copying variants across files 2026-11-11 09:01:09 +01:00
Andrey Antukh
34c702bc80
✨ Add table partitioning for file-change (#12417)
* ✨ Partition file_change by file_id

Partition `file_change` by `HASH (file_id)` in 16 partitions, with the
same bounds as `file_data`, so a join between them is resolved partition
by partition. The primary key becomes `(file_id, id)`, which a
partitioned table needs, and every access filters by `file_id`.

The new table carries a `kind` column (1 snapshot, 2 revision) as a
reserve: the queries still tell them apart by the label, and `kind`
takes over when they are rewritten. The payload of a snapshot stays in
`file_data`; the `data` column is kept for reading old `legacy-db`
payloads.

The four snapshot commands require `file-id`, because it prunes the
partition. The objects GC locks and deletes by the pair, in batches. The
old table is kept as `file_change_legacy` as the way back.

The automatic migration refuses to run above 10 GiB or 2M rows and
points to the runbook; big instances partition online with that runbook,
which copies by id, follows the `updated_at` watermark in delta passes
and checks that no row of the source is missing from the target.

Closes #12416

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

* 🐛 Address the review of the file_change partition

The production runbook promised a rollback it did not have: the section
was a sketch, and its statements could write to the table about to be
dropped. The rollback is removed, and so is every comment that described
it. `file_change_legacy` stays as a frozen copy of the previous layout.

The cutover check now aborts the transaction when a row of the old table
is missing in the new one, instead of leaving the decision to the
operator.

The five secondary indexes of the new table are built after the last
delta pass: the bulk and the delta passes only need the primary key, so
the batches no longer maintain them.

The copy of 0158 is now replayed in a test against the pre-0158 shape
with a labelled and an unlabelled row, plus an empty instance that must
leave no legacy table behind. The updated_at assertion of the snapshot
mutations is bounded by the test clock, and the repair revision stops
writing the `features` of the file, like the normal save.

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

* 📎 Fix linter issues

* 🐛 Fix stale helper call in rpc_file_snapshot_test

The suite does not load: `th/run-pending-tasks!` does not exist in
backend-tests.helpers. The pending jobs runner is `run-pending-jobs`
(no arguments), the name every other call site of the suite uses.

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

* 📚 Align the partition change with the 2.20.0 milestone

2.19.0 is already shipped; this work targets 2.20.0. The operations
file of the partition procedure carries the 2.20.0 prefix, the
references that point at it (the migration, the runbook table and the
memory) follow, and the RPC doc/changes tags of the snapshot commands
record 2.20 as the release that makes `file-id` required.

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

* 🐛 Fix review findings on the partition rebase

The 0157 legacy test was missed by the rebase and inserted file_change
rows without the new mandatory `kind` column, so the backend suite fails
against the migrated schema. The inserts now carry `:kind`
(snapshot-kind for the labelled rows, revision-kind for the rest).

The post-cutover verification block of the runbook terminates the
first query with a semicolon so the block pastes into psql without a
syntax error.

The guard message of the migration names the step
(0158-partition-file-change) instead of "0158", ambiguous since two
migrations share that number.

Closes #12416

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

* 🐛 Fix the stale label in the snapshot restore test

The rename block of snapshots-crud runs before the restore block,
so the restored version is already named "label1-updated" when the
restore publishes its message. The command names the version by the
label the row has at that moment, not by the one it had when it was
created, so the test was asserting a stale value.

Assert the current label, and say why in the comment.

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

* ♻️ Split the version event tests into one test per command

The workspace version events and the plugin proxy send the file-id
of the open file on every snapshot command, because the command
needs it to prune the partition of file_change. Both tests checked
that with a doseq and t/testing blocks, so a failure named the whole
group and not the command that broke.

Give each command its own test. The workspace ones share a helper
that runs the event and returns the command and params it sends; the
plugin ones keep their own mock of rp/cmd!.

AI-assisted-by: deepseek-v4.1-flash
2026-11-10 23:27:17 +01:00