14837 Commits

Author SHA1 Message Date
Eva Marco
6aedbc330e
♻️ Use DS icon buttons for the Measures toggles (#13278)
* ♻️ Use DS icon buttons for the Measures toggles

"Clip content" and "Show in view mode" were labels over hidden
checkboxes, styled with the deprecated %button-tertiary. They become
ghost icon-button* with aria-pressed: real buttons with a name, the DS
tooltip instead of the browser title, and the DS pressed corners. The
handlers toggle the current value instead of reading the checkbox, and
the two unused refs go away.

The ratio lock, already an icon-button*, marks its state with
aria-pressed instead of the legacy .selected class; it looks the same.

A zero-tolerance visual test shows both toggles at rest, on hover and
turned off, and the ratio lock off and on.

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

* ♻️ Drop the unused button styles of the Measures menu

The toggles and the ratio lock no longer use the legacy button
styles, so these selectors match nothing and go away: .lock-size-btn,
.lock-ratio-icon, .clip-content, .show-in-viewer, .clip-content-input,
.clip-content-label, .selected and .checkbox-button. Also
.numeric-input-measures, which no module uses. A grep over frontend/src
found no other use of any of them.

.clip-show takes the DS spacing token. The refactor/ import stays for
the presets dropdown and the inputs, which move to the DS with the
selects and inputs groups. The visual test shows 0 px against the
previous commit.

AI-assisted-by: claude-opus-5-5
2026-11-26 09:41:16 +01:00
Eva Marco
9977a4fbc6
♻️ Use the DS button in the Design tab export menu (#13275)
* ♻️ Use the DS button in the Design tab export menu

The "Export N elements" button of the Export menu was a raw button with
the deprecated %button-secondary placeholder. It becomes a secondary
button*, as the Inspect export button already is, so it takes the DS
label, hover and disabled look. The btn-disabled class goes away: the
.scss never defined it, and button* styles the disabled state.

A zero-tolerance visual test shows the button at rest, on hover and
while exporting (the export request is held so the state stays), and
the export row, which the styles commit that follows must not change.

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

* ♻️ Move the Design tab export menu styles to the DS

exports.scss drops the deprecated spacing, flex-row and typography
mixins and the %mixed-bar placeholder: DS sizes, borders, spacing
tokens and px2rem take their place, with logical properties. The
mixed bar colors resolve to their DS tokens. The format and size
selects share one rule. The refactor/ import stays only for
%input-element, which the suffix input keeps until the text inputs
group moves it.

The mixed bar and the suffix input take body-small (line height 1.4
to 1.3). The visual test shows 0 px against the previous commit; the
mixed bar is not in it, because the test file cannot reach that state.

AI-assisted-by: claude-opus-5-5
2026-11-26 09:40:55 +01:00
Eva Marco
284ffbc391
✨ Focus a new page when it is added from the Pages list (#13138)
* ✨ Focus a new page when it is added from the Pages list

The "+" button added the page at the end of the list, often out of view,
so nothing showed that it was created. It now opens the new page, scrolls
the list to it and starts renaming it with the default name selected. A
collapsed Pages section expands first.

The new add-page event waits for the page to initialize before it starts
the rename, because page initialization replaces :workspace-local. Only
the user who adds the page gets the focus; other users get the page as a
change. create-page stays as it was for the plugin API. The rename events
move to the pages namespace so add-page can use them.

Closes #12474

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

* ✨ Skip the rename commit when a page keeps its name

From the review: a new page now starts in rename mode, so pressing Enter
without changes committed a rename to the same name, and the next undo
did nothing visible instead of removing the page. Renaming a page to its
current name commits nothing now.

Rename add-page to create-page-and-focus, which says what it does and
does not collide with pcb/add-page.

AI-assisted-by: claude-opus-5-5
2026-11-26 09:40:08 +01:00
Thomas Ramé
e6f3d21dce
🐛 Keep context menu submenus inside the window (#13302)
* 🐛 Keep context menu submenus inside the window

A submenu opens at the height of its entry, so one opened from an entry
near the bottom of the window ran past it and its last entries could
not be reached. It now moves up to end 8px above the window's bottom.

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
Signed-off-by: Thomas Ramé <thomas@rame.fr>

* 🐛 Keep nested context submenus inside the window

* ♻️ Compute the context submenu position in a testable function

---------

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
Signed-off-by: Thomas Ramé <thomas@rame.fr>
Co-authored-by: Florian Schroedl <flo.schroedl@gmail.com>
2026-11-25 18:29:18 +01:00
Alejandro Alonso
a0bbafaf12 Merge remote-tracking branch 'origin/staging' into develop 2026-11-25 15:45:00 +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
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
Eva Marco
fc4c7bb82c
🐛 Expect the other padding sides at 0 in the dimension token test (#13321)
Since #13266, a padding change on a layout without padding fills the
four sides, so the sides not chosen become 0 instead of staying nil.
The test from #13215 still expected nil and failed on develop.

AI-assisted-by: claude-opus-5-5
2026-11-25 11:21:23 +01:00
Luke Lau
95470a9ce8
🐛 Remove nested_shadows, and fix double group shadows on text (#13280)
* 🔧 Add a render test for group shadows on nested text

The snapshot records the shadow of a group on the texts and shapes
inside it, as rendered today. Stroked text gets the shadow twice (G, I,
J, L) or partly twice (H, K), while plain text (B to F) gets it once.

The next commit fixes this and updates the snapshot.

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

* 🐛 Remove nested_shadows, and fix double group shadows on text

The nested_shadows state is only used by text shapes to draw drop
shadows that it inherits from its parents. There's a bug where only
groups pushed onto the stack but both groups and frames popped it.

But when trying to fix this I noticed that
`render_drop_shadow_child_silhouettes` will already render the text
shapes shadow in the parent. So compared to the SVG renderer we were
applying the shadows twice.

We can just remove the stack and let the parent render the shadow
once, which brings text in line with other shapes.  In the render
test, stroked text now gets the shadow once (G to L).

There's some other divergences from the SVG renderer in
`render_drop_shadow_child_silhouettes` to do with non-flattened
containers, which text shapes will now be exposed to. I hope to post a
PR after this to address these.

AI-assisted-by: claude-opus-5-5
2026-11-25 10:36:05 +01:00
penpot-renovate[bot]
6512b31a29
⬆️ Update dependency pnpm to v12.23.0 (#13270)
- pnpm 12.23.0 (docker/images/Dockerfile.media-processor)
- pnpm 12.23.0 (docker/images/Dockerfile.mcp)
- pnpm 12.23.0 (docker/images/Dockerfile.exporter)
- pnpm 12.23.0 (docker/devenv/Dockerfile)
- pnpm 12.23.0 (render-wasm/package.json)
- pnpm 12.23.0 (plugins/package.json)
- pnpm 12.23.0 (plugins/libs/plugins-styles/package.json)
- pnpm 12.23.0 (plugins/libs/plugins-runtime/package.json)
- pnpm 12.23.0 (plugins/libs/plugin-types/package.json)
- pnpm 12.23.0 (plugins/apps/table-plugin/package.json)
- pnpm 12.23.0 (plugins/apps/rename-layers-plugin/package.json)
- pnpm 12.23.0 (plugins/apps/poc-tokens-plugin/package.json)
- pnpm 12.23.0 (plugins/apps/poc-state-plugin/package.json)
- pnpm 12.23.0 (plugins/apps/plugin-api-test-suite/package.json)
- pnpm 12.23.0 (plugins/apps/lorem-ipsum-plugin/package.json)
- pnpm 12.23.0 (plugins/apps/icons-plugin/package.json)
- pnpm 12.23.0 (plugins/apps/example-styles/package.json)
- pnpm 12.23.0 (plugins/apps/e2e/package.json)
- pnpm 12.23.0 (plugins/apps/create-palette-plugin/package.json)
- pnpm 12.23.0 (plugins/apps/contrast-plugin/package.json)
- pnpm 12.23.0 (plugins/apps/composable-test-suite/package.json)
- pnpm 12.23.0 (plugins/apps/colors-to-tokens-plugin/package.json)
- pnpm 12.23.0 (package.json)
- pnpm 12.23.0 (media-processor/package.json)
- pnpm 12.23.0 (mcp/packages/server/package.json)
- pnpm 12.23.0 (mcp/packages/plugin/package.json)
- pnpm 12.23.0 (mcp/packages/common/package.json)
- pnpm 12.23.0 (mcp/packages/browser-extension/package.json)
- pnpm 12.23.0 (mcp/package.json)
- pnpm 12.23.0 (library/package.json)
- pnpm 12.23.0 (frontend/text-editor/package.json)
- pnpm 12.23.0 (frontend/packages/ui/package.json)
- pnpm 12.23.0 (frontend/packages/mousetrap/package.json)
- pnpm 12.23.0 (frontend/packages/draft-js/package.json)
- pnpm 12.23.0 (frontend/package.json)
- pnpm 12.23.0 (exporter/package.json)
- pnpm 12.23.0 (docs/package.json)
- pnpm 12.23.0 (common/package.json)
- pnpm 12.23.0 (backend/package.json)

Signed-off-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com>
2026-11-25 10:02:19 +01:00
Andrey Antukh
805b648265 Merge remote-tracking branch 'origin/staging' into develop 2026-11-25 09:44:03 +01:00
Andrey Antukh
2b67de0e29 📎 Fix copyright header on several files 2026-11-25 09:26:43 +01: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
Andrey Antukh
d94518ec41 Merge remote-tracking branch 'origin/staging' into develop 2026-11-24 22:48:49 +01:00
Andrey Antukh
a7f66b18f9
✨ Honor trusted alternate origins for backend links and OIDC (#11892)
* ✨ Honor trusted alternate origins for backend links and OIDC

Add PENPOT_TRUSTED_ORIGINS, an optional list of bare scheme://host[:port]
alternate origins. A request whose Origin matches (exact, trimmed and
lowercased) uses that origin as the base for links generated while serving
it: emails, asset URLs, audit and webhook link fields, and redirects.
Unlisted origins, requests without Origin, and background or server-to-server
work keep the canonical public-uri (fail-closed). Malformed entries warn at
startup and never match.

Stamp the trusted origin on the request with a global http middleware that
binds config public-uri for the request extent; expose the chain as
root-middleware so tests assert it runs before auth and errors. Build every
backend link through the canonical cf/get-public-uri.

Carry the origin in the signed OIDC state (auth and organization SSO) so the
callback, a navigation without Origin, re-applies it with with-public-uri for
the token-exchange redirect_uri and every redirect, including logout. Verify
the state token once per callback and reuse the claims; build redirect URIs
with ensure-path-slash plus join and append-query-param for hash routes. A
removed origin does not invalidate states signed before it (up to four hours).

Bring MCP OAuth into scope: wrap its routes, stage the origin in the Redis
request record at authorize time, and re-apply it in decision so issuer,
resource, the approval redirect and the code-exchange iss agree on one base.

Keep the log-capture watch installed while waiting for the async rejection
record in the save tests; a watch removed first lost late records and read
nil. Add a delayed-executor regression test that makes the race deterministic
and document the rule in the backend testing memory.

Closes #11625

AI-assisted-by: deepseek-v4.1-flash
AI-assisted-by: qwen3.7-plus
AI-assisted-by: gpt-5.6-luna
AI-assisted-by: muse-spark-1.3-contributor

* ✨ Serve trusted alternate origins across frontend and backend

Let one installation serve a canonical domain plus trusted alternate
origins, without letting request headers pick arbitrary link bases.

The backend normalizes `PENPOT_TRUSTED_ORIGINS` on load: it drops malformed
entries with a warning and warns about HTTP origins outside localhost. It
selects the first trusted origin from `X-Penpot-Origin`, then `Origin`, and
applies only scheme, host and port to the public URI, keeping the configured
path. MCP OAuth keeps the canonical base because its authorize navigation
has no usable origin.

The frontend reads the same list from `config.js`, filled by the container
entrypoint, and selects the browser origin only on an exact match. It sends
`X-Penpot-Origin` on RPC calls (including GETs and multipart) and OIDC
initiation, not on asset, font or external requests. SSE captures the request
bindings, and export jobs store the effective base so the download link uses
it after the request ends. A closed export creation schema excludes
`:public-uri`, which the backend adds only after validation.

Register the OIDC callback for each alias. Removing an alias does not stop
already signed OIDC state, queued mail or export jobs from using it.

Add regression tests across backend, frontend and the nginx entrypoint, and
document the proxy setup, worker upgrade and rollback, and alias retirement.

Refs #11625

AI-assisted-by: hy4-flash-free
AI-assisted-by: gpt-6-luna
AI-assisted-by: gpt-6.2-sol
2026-11-24 20:02:29 +01:00
Himanshu Bhardwaj
f3baec6658
✨ Add an options button to color assets (#13189)
* ✨ Add an options button to color assets

Color assets could only be renamed, edited, duplicated or deleted from
the right-click menu, which tablet users can't open. Add a three-dot
options button, like the one on typography assets, that opens the same
menu below the button. It shows on hover and focus, and stays visible on
devices without hover.

Closes #12618

AI-assisted-by: Claude Opus 5.5

* 🐛 Keep the color asset options button reachable by keyboard

The options button was hidden with visibility, which also takes it out
of the tab order, so :focus-within could never reveal it from the
keyboard. Hide it with opacity instead, so Tab reaches the button and
shows it.

Open the menu through one helper for both the right click and the
button, so both keep clearing the selection first.

AI-assisted-by: Claude Opus 5.5

* 🐛 Toggle the color asset menu and fix its row and focus

---------

Co-authored-by: Luis de Dios <luis.dedios@kaleidos.net>
2026-11-24 19:59:45 +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
Eva Marco
07c3409ad0
🐛 Show the full library name in a tooltip when it is cut (#13237)
* 🐛 Show the full library name in a tooltip when it is cut

Long library names are cut with an ellipsis in the Libraries modal and
in the Assets panel, with no way to read the full name, so libraries
that share a long prefix cannot be told apart.

A new truncated-text* component shows the text and, only while CSS cuts
it, wraps it in the DS tooltip with the full text. A ResizeObserver
checks the size again when the box changes; it follows the node that the
tooltip mounts, so the tooltip also goes away when the text fits again.
The Libraries modal (new and legacy layouts) and the library titles in
the Assets panel use it.

Closes #13223

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

* 🐛 Keep a cut library name visible inside its tooltip

The DS tooltip trigger sets line-height: 0. A cut name inside it
inherited that value and collapsed, so the Assets panel hid the name of
a long shared library. The trigger of truncated-text* now inherits the
line height of its parent through an inline style; a class would tie
with the trigger class and depend on the order of the stylesheets.

AI-assisted-by: claude-opus-5-5
2026-11-24 15:47:25 +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
495df7ef66 Merge remote-tracking branch 'origin/develop' into develop 2026-11-24 13:12:23 +01:00
Andrey Antukh
4427b83ae0 Merge remote-tracking branch 'origin/staging' into develop 2026-11-24 13:12:08 +01:00
Andrey Antukh
5fafca7665 🐛 Correct UI CSS export and test restore flow
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
2026-11-24 12:44:30 +01:00
Elena Torró
407ee58ddd
🐛 Fix render-wasm panic when an auto layout has only absolute children (#13146)
* 🐛 Restore the WASM stack pointer after a failed call (#12978)

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

Closes #12977
Related to #12906

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

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

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

Closes #12763

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

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

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

Refs #12763

AI-assisted-by: claude-opus-5-5
2026-11-24 12:25:19 +01:00
Andrey Antukh
2da9bddd05 Merge remote-tracking branch 'origin/staging' into develop 2026-11-24 12:22:16 +01:00
Alejandro Alonso
277ca546f2
⚡ Re-present the frame when the grid overlay changes (#13248)
Hovering a grid frame requested a full render. That clears the
canvas and walks every visible tile even though the overlay is
only UI. show_grid and hide_grid now re-present the last frame.
2026-11-24 12:12:39 +01:00
Andrey Antukh
719f154b49 🐛 Clarify plugin save recovery warning
Warn that recovery may discard unsaved edits instead of implying that
reopening is the only recovery path. Update the API docs and test.

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

Closes #12977
Related to #12906

AI-assisted-by: claude-opus-5-5
2026-11-24 10:39:52 +01:00
Florian Schrödl
8490d2a18a
🔧 Tighten the token helper tests after review (#13242)
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>
2026-11-24 10:24:56 +01:00
Luis de Dios
0b4bb4b832
🐛 Keep fitted content clear of the rulers (#13069)
* 🐛 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
2026-11-23 23:32:13 +01:00
Pablo Alba
8d0ff7984b 🐛 Keep swapped children on switch and undo of a nested variant copy
Switching a variant copy that sits inside another copy dropped a component
swapped inside it, and the new variant showed its default child. Undoing
a variant switch also lost a swapped child: the old variant came back with
no child in that place.

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

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

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

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

Closes #13179
Closes #13181

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

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

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

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

Closes #13167

AI-assisted-by: claude-opus-5-5
2026-11-23 15:58:41 +01:00
Luis de Dios
340f5e36cf
🐛 Fix batch edit of colors in the selected colors menu (#13087)
* 🐛 Fix batch edit of colors in the selected colors menu

Restore the colorpicker flag that commit 20d2d22 lost when it replaced
the flag with the row index. Every change was treated as a picker change,
so the colors already applied were kept and reused by the next edit. That
made an edit on one row change the first color instead.

Direct edits of the color and opacity inputs now target the exact color
of the row. Picker changes keep the previous-color fallback needed while
the selected shapes are still updating.

Add unit tests for the new operation resolver.

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

* ♻️ Remove unused picker history from token detachment

Resolve token detachment operations directly from the current groups.

Picker color history is not needed for token detachment.

AI-assisted-by: gpt-6-luna

* ♻️ Clarify color row change arguments

Bind the row color once and name the change arguments.

Treat the picker flag as optional for direct edits.

AI-assisted-by: gpt-6-luna

* 🐛 Fix linting issue
2026-11-23 13:01:35 +01:00
andrés gonzález
3346c67a3b
✨ Add Copy link to the file and project menus in the dashboard (#13200)
Both menus get a Copy link option after Move to. The file menu copies
the workspace URL of the file and the project menu the URL of the
project page, then show a confirmation toast. A copy error shows a
toast that closes on its own; errors that are not clipboard ones are
also logged.

Also tidy both menus:
- Add a separator before Import Penpot files in the project menu.
- Rename "Open file in a new tab" to "Open in new tab".
- Add a separator before the download option in the multiple files
  menu, as in the single file menu.
- Show Pin or Unpin depending on the project state.

Viewers already had no project menu in the project list and on the
project page. Disable it, and rename on double-click, for pinned
projects in the sidebar too, so viewers can copy file links but not
project links. The user guide documents both options.

New translation keys are in en and es only.

Closes #13182

AI-assisted-by: claude-opus-5-5
2026-11-23 12:21:02 +01:00
Alejandro Alonso
5c768aeca0
🐛 Skip WASM font checks while the renderer is not live (#13235)
Page switches tear down the WebGL canvas before openPage resolves, so
font-stored? must not call _is_font_uploaded against a null resource
pool. Guard with wasm/live? like the other font FFI helpers, and cover
the skip path with a unit test.

Closes #13205
2026-11-23 12:01:10 +01:00
Florian Schrödl
888e2d9368
🔧 Test applying dimension and spacing tokens (#13215)
Covers how dimension, spacing and sizing tokens change position,
corners, stroke sides, paddings, gaps, margins and size limits, the
fallback to the closest font weight with its warning, and detaching
tokens from attributes without knowing the token.

The sizing test in token_actions_test now applies the token through
the function the app uses for sizing tokens, not the dimensions one.

Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
2026-11-23 10:44:20 +01:00
Andrey Antukh
35a7189682 Merge remote-tracking branch 'origin/staging' into develop 2026-11-23 10:08:48 +01:00
Andrey Antukh
174596db1d Merge remote-tracking branch 'origin/main' into staging 2026-11-23 10:08:15 +01:00
Florian Schrödl
f216ae921d
🔧 Add tests for token helpers (#13210)
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>
2026-11-23 09:57:17 +01:00
Eva Marco
15871f3de6
🐛 Fix the disabled invite button in the empty invitations state (#13193)
* 🐛 Center the disabled invite button in the empty invitations state

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

Closes #13173

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

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

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

Closes #13171

AI-assisted-by: claude-opus-5-5
2026-11-23 09:28:36 +01:00
Belén Albeza
5cd9080482
🐛 Fix typography in Password and Notifications settings (#13218)
Use the DS heading component for the page and section titles.

Closes #13216

AI-assisted-by: claude-opus-5-5
2026-11-20 19:05:09 +01:00
Andrey Antukh
8bca3f86ee Merge remote-tracking branch 'origin/develop' into develop 2026-11-20 18:56:41 +01:00
Andrey Antukh
0572645d97 🔧 Fix CI module commands
Set a default key for exporter tests and use the library format script.
Add dry-run tests for both commands. Format the backend merge resolution.
Align the token test with its selected fixture.

AI-assisted-by: gpt-6-luna
2026-11-20 17:55:33 +00:00
Andrey Antukh
52750d14de
♻️ Reduce the frontend e2e suite by merging equivalent specs (#13094)
* ♻️ Merge duplicated e2e loads and harden ten spec groups

Collapse multi-case Playwright specs into one test with a named step per
case, so the app or document loads once per group instead of once per
case. No case is dropped. In scope, the affected cases fall from 85 to
52 tests and from about 1300 to 760 worker-seconds.

- stroke-to-path and toolbar (15 to 2 tests, -80%): each step anchors a
  layer row to its exact name, checks the count grows by one and that the
  clicked row is selected before the context menu. The skipped path case
  now uses the tool's click-per-node and Enter gesture. The curve step
  counts exact Path rows; the update-file override that returned a whole
  file is gone; the toolbar test runs on the DOM renderer because the
  prebuilt WASM bundle creates no text.
- dimension tokens and colorpicker (12 to 6, -45%): steps assert the
  resolved pill value, not just the pill; the width/height step detaches
  the extra pill. HSB now awaits isVisible on real labels, gradient steps
  count stops and the radial case switches its own type.
- export frames and multiselection (11 to 3, -70%): rows use aria-checked
  instead of a 500 ms sleep, and steps wait for the sidebar before editing
  so a stale render cannot write to the previous selection. The frames
  entry is checked by row count and the "file" item by id.
- variants and workspace (41 to 37, -29%): waits now follow rendered
  state, the duplicated setupEmptyFile is gone, and the layer tree derives
  its children container from the row's own id. The copy/paste flake is
  fixed with a selectRow retry, Escape to deselect, hover instead of
  clicks and idempotent container expansion.
- grid editor and sidebar scroll (6 to 4, -24%): the editor opens once and
  blind 200/500 ms waits are gone; hover checks computed opacity because
  the button is hidden with opacity: 0. Only the second scroll test stays;
  the store has nine unit tests in ui/sidebar_scroll_test.cljs.

Also drop a dead binding, restore two Taiga links and fix comments that
cited the wrong drawing.cljs ranges and cancel-drawing's docstring.

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

* ♻️ Close the e2e merge review findings

Restore the renderer coverage the merge lost and make the merged steps
measure their own work.

The five shape tools run under WASM again, and the text tool runs there
too with the v2 editor flag: WasmWorkspacePage already enables it, so
the toolbar gesture keeps its drag and typing assertions. Curve now
compares the exact Path rows with their own baseline.

WorkspacePage gains layerRows, and layerRow delegates to it; toolbar,
stroke-to-path and export-frames use them instead of local copies. The
variants setup waits for the component icon and the variant rows
instead of two fixed sleeps, selectRow clicks once, and the cut/paste
step asserts its own delta. The stale comments lose their line numbers,
Path is no longer called the pencil, the orphan fixture is deleted, and
the sidebar smoke regains the Assets round trip.

Document the local e2e bundle prerequisite in the frontend testing
memory.

Closes #13093

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

* 🐛 Wait for the layer selection in the token spec

The dimension-token test clicked a layer row and went back to the Tokens
tab without proving the selection. A lost click left the previous shape
selected, and the border-radius step could pass on that shape. The
selection now goes through WorkspacePage.selectRow, which clicks once and
waits for aria-checked.

selectRow moves from variants.spec.js into the page object, and
selectLayer delegates to it, so the click-and-wait selection lives in one
place.

AI-assisted-by: deepseek-v4.1-flash
2026-11-20 18:55:19 +01:00
Andrey Antukh
adb61a9b96 Merge remote-tracking branch 'origin/staging' into develop 2026-11-20 17:58:20 +01:00