24922 Commits

Author SHA1 Message Date
Andrey Antukh
b6a08ea4cb
⚡ Fuse the reg-objects of a change batch per container (#12310)
The component sync emits a `:reg-objects` for the parents of every
shape it touches, so a component swap collected 291 of them for 36
containers. Recomputing a group's geometry N times in a row gives the
same result as doing it once, so most of that work was thrown away,
in the browser and on the server, on every save.

`mch/merge-reg-objects` collapses them into one per container, with
the union of the shapes. The merged change moves to the end of the
batch: a group has to be recomputed after the shapes that resized
it, not before, or it keeps a stale `:selrect` until something else
touches it. That is also why it must not stay in the position of the
first change it replaces.

It runs on every commit, redo and undo alike, so the undo stack gets
the same benefit, and again when the buffer is batched for saving.
Measured on the swap that motivated this: 291 `:reg-objects` become
36, and the batch goes from 806 changes / 6.4 MB to 551 / 324 KB.

AI-assisted-by: space-bunny
2026-11-20 13:50:17 +01:00
Andrey Antukh
d6e816daa0
✨ Cover subscription rules with unit tests and trim e2e specs (#13006)
Move the pure subscription rules out of the browser specs and into unit
tests, then keep only the cases a browser can prove.

- Extract show-manage-subscription-link? and show-main-menu-power-up? from
  the dashboard team panel and the workspace main menu, and use them at
  both call sites. A new subscription_dashboard_test.cljs covers which
  plan a subscription reads to, including unpaid and canceled demotion, the
  owner and enterprise sides of both affordances, and the banner and
  members-CTA boundaries: four editors over the seats, no usage data, and
  the demoted plans.
- Add get-versions-stored-days tests to workspace_versions_test.cljs: an
  active nitrate or enterprise license keeps 90 days, a canceled one lets
  the team plan decide, a license without the admin console does not count,
  and unlimited, enterprise, professional and planless teams keep 30, 90
  and 7 days.
- Rewrite the profile usage tests as async tests with mock/with-mocks* and
  an async transport double: the editors from the usage call reach
  [:props :subscription :editors], a failing call leaves the profile
  untouched and logs once, and the call is skipped without the
  subscriptions flag.
- Cut the e2e suite from 13 cases to 7. Five dashboard cases keep the menu
  icon, the two sidebar plan names, the owner-only settings link and the
  members CTA; two workspace cases keep the translated days warning with
  the upsell step and the enterprise menu with no upsell. Assert the
  unlimited glyph and drop the CTA count.
- Drop the three get-team-info mocks the dashboard never calls and six
  unreferenced subscription fixtures, reusing the invitations fixture.
- Sort the subscription test requires in runner.cljs: cljfmt's
  :sort-ns-references? wants subscription-dashboard-test first.

Closes #13005

AI-assisted-by: deepseek-v4.1-flash
2026-11-20 13:45:59 +01:00
Yamila Moreno
ea11c4d71d 🔧 Fix pr validations
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-20 11:59:29 +01:00
Andrey Antukh
15a099f118 Merge remote-tracking branch 'origin/staging' into develop 2026-11-20 09:54:54 +01:00
Andrey Antukh
1debed7f3c
⬆️ Update dependencies (#13191)
* ⬆️ Update dependencies

* 🐛 Fix CI failures after the dependency update

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

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

AI-assisted-by: hy4-flash-free
2026-11-20 09:53:37 +01:00
Filip Sajdak
c40287254c
✨ Explain why a library cannot be disconnected in its modal (#12921)
* ✨ Explain why a library cannot be disconnected in its modal

A library that another connected library uses cannot be disconnected from
a file, but the Libraries modal showed it with the same disconnect button
as any other library, only disabled, and said nothing about why.

Replace that button with an icon and a tooltip. A nested library ("Connected
through ...") says it is inherited from its parent, and a direct library
that another connected library uses says which one. Both name the library
to disconnect first. A library nothing else uses keeps its button.

library-disconnect-hint decides the case from the same data the disabled
state used, so the buttons that were disabled are the ones that change.
The legacy libraries tab keeps its button.

Closes #12838

AI-assisted-by: claude-opus-5-5
AI-assisted-by: claude-sonnet-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

* 🐛 Name every library to disconnect in the disconnect hint

The hint named only the parent of a nested library as the one to
disconnect. That was wrong when several libraries use it (disconnecting
one leaves it linked through the others) and no help when the parent is
nested too and has no disconnect button either.

The removal step now lists the libraries the user can actually disconnect:
those that use the library directly or through others, and that no linked
library uses. The parent is still named as the reason it is inherited. In
a cycle nothing is removable, so the parent is named as before.

Tests cover a shared dependency, a deep chain and a cycle.

AI-assisted-by: claude-opus-5-5
AI-assisted-by: claude-sonnet-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

* 🐛 List directly linked libraries in the disconnect hint

A library linked to the file directly stays until the user disconnects
it, even when another linked library uses it. The hint skipped those: for
a file linked to A and B, with A using B and B using C, it told the user
to disconnect only A, and C stayed linked through B.

Collect the libraries that use it, however far up, and that are either
linked directly or used by no linked library. A directly linked library
that another one uses cannot be disconnected yet, and its own tooltip
says to disconnect that one first.

The test covers a directly linked intermediate library.

AI-assisted-by: claude-opus-5-5
AI-assisted-by: claude-sonnet-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

* 🐛 Count a library linked in this session as direct in the hint

Only the libraries fetched when the workspace opens carry :is-indirect.
One linked afterwards comes back without it, so the hint did not treat it
as directly linked: after connecting B (which uses C) and then A (which
uses B) without reloading, C's tooltip said to disconnect only A, and C
stayed linked through B.

A library the user linked has no flag and is direct by construction, so
only one known to be indirect is skipped.

The test covers that sequence.

AI-assisted-by: claude-opus-5-5
AI-assisted-by: claude-sonnet-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

* 🐛 Flag libraries linked in this session as direct or indirect

Only the libraries fetched when the workspace opens carried :is-indirect.
Linking a library afterwards loads it and its dependencies through
load-library-file, and none of them got the flag, so a missing flag could
mean either. The disconnect hint in the Libraries modal reads it to tell
which libraries the user can disconnect, and it listed the wrong ones for
a chain connected in the same session (it named a dependency that has no
disconnect button).

Set the flag where the library is loaded: the library the user links is
direct and the libraries it brings in are indirect. The hint is back to
trusting only a flag that says false, because a missing one no longer
means a direct link.

The test links a library with one dependency and checks both flags.

AI-assisted-by: claude-opus-5-5
AI-assisted-by: claude-sonnet-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

* 🐛 Keep a library's direct flag when it is loaded twice

When links overlap, a library can be requested twice: once because the
user linked it and once because a library linked right after brings it
in. Each load stored its own :is-indirect value, so whichever answer
landed last won, and an indirect one could erase the direct link. The
disconnect hint then listed the wrong libraries.

Store a loaded library through one event that never turns a known direct
link into an indirect one. The reverse order already ends direct, since
the user's link is stored with the flag false.

The test links a library and then one that uses it before the first
answer arrives, and answers in the order that used to lose the flag.

AI-assisted-by: claude-opus-5-5
AI-assisted-by: claude-sonnet-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

* 🐛 Scope a library's kept direct flag to the file it belongs to

The flag kept when a library is loaded twice was read from :files, which
outlives a workspace. A library that was a direct link of the file visited
before could keep that flag in the next file, where another library only
brings it in, and the disconnect hint then listed one library too many.

Keep the flag only when it was recorded for the file being loaded, using
the :library-of the entry already carries.

The test leaves a library flagged direct for another file and links a
library that brings it in.

AI-assisted-by: claude-opus-5-5
AI-assisted-by: claude-sonnet-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

* 💄 Name the libraries in the disconnect hint as design asked

The nested library hint now reads "Connected through <parent>. To
remove it, disconnect <libraries>." instead of "Inherited from ...".
The library names in both hints (connected through and used by) show
in the primary foreground color, so they stand out from the text.

The translation is split on its two placeholders instead of rendered
as HTML, because the library names are written by users. The full
plain sentence stays as the aria label of the icon.

The new key is workspace.libraries.connected-through-hint, since
workspace.libraries.connected-through already labels the parent in the
list.

AI-assisted-by: claude-sonnet-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

---------

Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>
Co-authored-by: Eva Marco <evamarcod@gmail.com>
2026-11-20 09:49:28 +01:00
Filip Sajdak
454e461c1e
✨ Copy stable deep link to selected boards from context menu (#10170)
* ✨ Copy stable deep link to selected boards from context menu

The workspace "Copy link" action copied the raw current location, which
only carries file and page ids, so the link did not point at any specific
board. Build the link from the current route plus a `board-id` query param
derived from the selection: a selected board contributes its own id, and a
selected shape contributes the id of the board it belongs to.

`board-id` is an existing workspace route param (`zoom-to-frame` already
selects and zooms to it on load), and board ids are stable across renames
and reordering, so the link keeps resolving to the same board. When the
selection contains no board, it falls back to the previous behavior.

Relates to #4584

AI-assisted-by: claude-opus-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

* 📎 Add tests for copying a stable board link

copy-link-to-clipboard now links to the boards of the selection through
their ids, and nothing covered it. The tests run the event on a state
with two boards, a rectangle in each and a rectangle on the root, with
the router and the clipboard replaced.

They check that a selected board, and a shape in a board, link to that
board; that shapes in two boards link to both and a board with its child
gives one id; that the route params are kept next to the board ids; and
that an empty selection, or a shape on the root, copies the current
location. The five board cases fail on the version of the function before
the change.

AI-assisted-by: claude-opus-5-5
AI-assisted-by: claude-sonnet-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

* ♻️ Share how the selection maps to its boards

select-shape and copy-link-to-clipboard each worked out which boards
a selection belongs to, with slightly different rules for a shape on
the root. Both now call selected-board-ids.

A selection with a shape on the root has no board to point at, so the
URL and the copied link both leave out the board ids. Before, the
copied link kept the boards of the rest of the selection. The URL also
lists each board once now, and has no board-id for an empty selection.

AI-assisted-by: claude-opus-5-5
Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>

---------

Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>
Co-authored-by: Eva Marco <eva.marco@kaleidos.net>
2026-11-20 09:47:11 +01:00
Pablo Alba
6d0be9f47f 🐛 Undo a main text edit and its follow-up sync in one step
After a font size change on a main text, the main resizes itself in a
commit that stacks onto the edit's undo entry. That commit still took
the group its undo transaction was opened with, and the component sync
it starts inherited that group. So the sync became a separate undo
entry: the first Ctrl+Z undid only that sync, the copies were measured
again right away, and nothing visible changed. The user had to press
Ctrl+Z twice to undo the edit.

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

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

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

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

Closes #13207
Relates to #12721
Relates to #13065

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

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

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

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

Relates to #12721

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

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

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

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

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

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

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

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

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

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

Relates to #12721

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

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

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

Relates to #12721

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

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

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

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

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

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

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

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

Relates to #12721
Relates to #13065

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

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

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

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

Relates to #12721
Relates to #13065

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

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

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

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

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

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

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

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

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

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

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

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

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

AI-assisted-by: hy4-flash-free
2026-11-19 19:47:41 +01:00
Yamila Moreno
04a9aaac78 🔧 Close invalid pull requests (#13196)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 17:38:10 +01:00
Yamila Moreno
5c61273766
🔧 Close invalid pull requests (#13196)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 17:37:02 +01:00
Puneet Moger
90a9f6d398
🐛 Wrap long connected library names (#13057)
Co-authored-by: Eva Marco <eva.marco@kaleidos.net>
2026-11-19 16:37:05 +01:00
OowhitecatoO
ce1665c9f9
🐛 Fix Chinese browser language autodetection (#13157)
* 🐛 Fix Chinese browser language autodetection

* ♻️ Pass the browser language to autodetect

* ♻️ Share locale resolution between autodetect and set-locale
2026-11-19 16:35:55 +01:00
OowhitecatoO
9bc18b4f3d
🐛 Fix missing date locales and stale dates after switching language (#13158)
* 🐛 Fix Chinese locale for dates and relative times

* 🐛 Add missing Hindi and Serbian date locales

* 🐛 Reset date locale to English for languages without one

---------

Co-authored-by: Eva Marco <eva.marco@kaleidos.net>
2026-11-19 16:35:08 +01:00
Alejandro Alonso
3e697c2794
✨ Forward frontend audit events to host callbacks (#13175)
Hosts need a vendor-agnostic way to react to named audit events in the
browser (for example SaaS config.js). Penpot exposes
penpotAddEventCallback / penpotEventCallbacks, loads an early stub before
config.js, and invokes matching callbacks after make-event, without
coupling to any analytics SDK.

Closes #13091

AI-assisted-by: Composer
2026-11-19 16:02:45 +01:00
Marina López
b100a5e26f
✨ Add viewers so org owners can change member role (#13163) 2026-11-19 12:27:17 +01:00
penpot-renovate[bot]
210cbd6cc7
⬆️ Update DHI base images (#13170)
- dhi.io/debian-base trixie-debian13-dev@a249f09 (docker/images/Dockerfile.backend)
- dhi.io/debian-base trixie-debian13-dev@a249f09 (docker/images/Dockerfile.backend)
- dhi.io/debian-base trixie-debian13@aa05c07 (docker/imagemagick/Dockerfile)
- dhi.io/debian-base trixie-debian13-dev@a249f09 (docker/imagemagick/Dockerfile)
- dhi.io/debian-base trixie-debian13-dev@a249f09 (docker/devenv/Dockerfile)
- dhi.io/nginx 1.31.9-debian13-dev@ce6bf91 (docker/images/Dockerfile.frontend)

Signed-off-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com>
2026-11-19 12:12:02 +01:00
Andrey Antukh
ca1da39a35 🐛 Read the media and thumbnails of a package one at a time (#13024)
The analysis of a package reads the metadata of every media and
thumbnail of its container to attribute the shared objects to each
file. It read them all at once, one promise per entry, and the
container of a big file holds thousands of them: every read opens its
own decompression stream, and Chromium fails the whole analysis under
that load while Firefox keeps up. The failure is masked by zip.js with
a generic "Cannot close a ERRORED writable stream".

The references now go through an observable, one entry at a time, and a
reference that cannot be read leaves its file without a size instead of
failing the package: a number that misses one of the objects of the
file is worse than no number.

Closes #13022

AI-assisted-by: deepseek-v4.1-flash
2026-11-19 12:05:06 +01:00
Andrey Antukh
f7e61b8053 🔧 Disable admin console routing in devenv
Add the disable-admin-console flag to the backend devenv PENPOT_FLAGS.
The nginx entrypoint checks this flag to decide whether to proxy the
/admin-console path; without it, devenv configured a proxy to an
admin-console service that does not run there. This aligns backend
routing with the frontend, where the admin console is off by default
in devenv.

AI-assisted-by: hy4-flash-free
2026-11-19 10:50:41 +00:00
Andrey Antukh
a6d12c5c32 Merge branch 'staging' into develop 2026-11-19 11:38:22 +01:00
Alonso Torres
951ebbba6a
🐛 Fix problem with Penpot plugins being blocked (#13147) 2026-11-19 11:21:54 +01:00
Elena Torró
981fa06961
🐛 Keep fill copies laid out after a component sync in the WebGL render (#13154)
* 🐛 Keep fill copies laid out after a component sync in the WebGL render

Lay out other pages in CLJS and reflow nested layouts that keep their size.
Closes #13015

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

* ⚡ Skip the nested layout pass during WebGL drag previews

Gap, padding and margin drags keep the cost they had before the fix.
Relates to #13015

AI-assisted-by: claude-opus-5-5
2026-11-19 11:02:15 +01:00
Alonso Torres
b6db09e2fb
✨ Expose the instance URL and query params to plugins (#13018)
Plugins and the MCP could not learn which Penpot instance they run on,
so agents guessed the domain when they wrote links to files.

Add penpot.location with the instance base URL (baseUrl), the URL of
the current screen (href) and its query params (params). It works in
the dashboard and the workspace and requires content:read. Params that
carry secrets (share-id, the MCP authorize params, and any key ending
in token, secret or password) are left out, and href is rebuilt from
the remaining params so it never carries one.

The MCP instructions tell agents to use href instead of building links.
The plugin API test suite checks location against the open file, and
its API surface is regenerated from the current types.

Closes #13013

AI-assisted-by: claude-opus-5-5
2026-11-19 10:27:04 +01:00
Yamila Moreno
be7be634d9 🔧 Add exemption to linked issues workflow
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 10:21:30 +01:00
Yamila Moreno
03a4c73b62 🔧 Add exemption to linked issues workflow
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 10:21:13 +01:00
Yamila Moreno
2695434362 🔧 Prevent PRs without issue from merging
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 09:29:19 +01:00
Yamila Moreno
172a3589e8 🔧 Prevent PRs without issue from merging
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 09:28:57 +01:00
Eva Marco
bb87fe07de
🔧 Test unique layer names in the file builder (#13086)
* 🔧 Test unique layer names in the file builder

The builder read used names from :unames while track-used-name wrote
them to ::unames, so two boards without a name both ended up as
"Board". #12794 fixed the key. These tests cover it: two unnamed boards
get "Board" and "Board-1", and two names that clean to the same path
get "-1" on the second one. Both fail with the old key.

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

* 🔧 Test that component root names count as used names

#12794 also made add-component register the renamed main instance name.
A shape added later with the same name must get "-1". The test fails
without that track-used-name call.

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

* 🔧 Test per-page unique names and anonymous components

The builder tracks used names per page, so the same name on two pages
stays unchanged. A component without a name is called "anonymous".
Each test fails without the code it covers.

AI-assisted-by: claude-opus-5-5
2026-11-19 09:22:09 +01:00
Yamila Moreno
c1ad2194dc 🔧 Add PRs to status tech-review (#13152)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 08:26:22 +01:00
Yamila Moreno
8acb5a8439 🔧 Require milestone in PRs (#13129)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 08:26:16 +01:00
Yamila Moreno
690b32b163 🔧 Improve issue templates (#13126)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 08:26:08 +01:00
Yamila Moreno
c56acc7ff3 🔧 Require milestone to issues linked to a PR (#13133)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 08:26:01 +01:00
Yamila Moreno
c9b5ce7db3 🔧 Manage renovate PRs (#13131)
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
2026-11-19 08:25:50 +01:00
Andrey Antukh
fd785b8246
⚡ Stop resending deleted component objects on every touch (#12308)
* ⚡ Stop resending deleted component objects on every touch

`pcb/update-component` attached the whole `:objects` map of a deleted
component to every `mod-component` change, so a single component swap
re-sent thousands of shapes that the same batch already carried as
shape changes. In one measured swap the 49 maps with objects were 94%
of the request (6.3 MB), and only 27% of the 4.275 shapes they carried
differed from what the server had.

Now `mod-component` carries component metadata only, and shapes inside
a component travel as `:mod-obj` changes scoped with `:component-id`,
which is what the component sync already emits. An absent `:objects`
key means "leave the stored shapes alone", only an explicit `nil`
drops them, so metadata-only changes cannot wipe a deleted component.

The two repairs that fix shapes inside a component (shape-ref cycle
and duplicated swap slot) now emit one `:mod-obj` per shape; the two
that move or clear the `:objects` key keep the whole-map write behind
the new `:objects? true` option.

Same swap on the measured file: 6.328.307 to 382.571 bytes.

AI-assisted-by: space-bunny

* 🔧 Cover the mod-component objects contract with tests

`pcb/update-component` sends the `:objects` map only when the caller
passes `:objects? true`, and `ctkl/mod-component` reads an absent key as
"leave the stored shapes alone". Two repairs depend on that option, and
dropping it broke nothing visible: the change carried no `:objects`, the
applier kept the invalid component as is, and the suite stayed green.

Add one repair test per error code, including the deleted-component
branch that must keep the map empty, and a round-trip test for the
shape-ref cycle repair. That repair now emits one `:mod-obj` per shape
and had no coverage; the test pins the scoped `:component-id` and that no
shape is lost.

Reword the `update-component` docstring as well: it describes what the
option does to the change instead of listing its current callers, which
goes stale as soon as another caller uses it.

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

* 🔧 Harden the mod-component repair tests

Address the review of the previous commit.

The cycle test only rejected a shape-ref pointing to itself, so it would
have passed if the repair repointed the link instead of removing it, or
if it left the component links on the main root untouched. It now
compares the resulting objects map with the expected one.

The four tests only inspected the first change, so a duplicated change
went unnoticed. They now compare the full list of changes: an exact
vector for the two repairs that rewrite the map, and id frequencies for
the cycle repair, which emits one change per shape in no fixed order.

The deleted-component fixture now removes the main instance through
`tho/delete-shape`, the same change generator the editor uses, instead
of a hand-written `:del-obj`. The message that promised a restorable map
now says what the repair does: normalize the value to an empty map.

AI-assisted-by: deepseek-v4.1-flash
2026-11-18 23:18:28 +01:00
Andrey Antukh
7a64142cbc Merge remote-tracking branch 'origin/staging' into develop 2026-11-18 20:19:33 +01:00
Andrey Antukh
db1e2f7c9b Merge branch 'staging-2.19.x' into staging 2026-11-18 20:17:37 +01:00
Andrey Antukh
7916e5e073 📚 Clarify agent memory guidance
Promote Clojure design rules to a required core memory and simplify
the discovery guide. Correct test output redirection and RPC routes.

AI-assisted-by: gpt-6.1-terra
2026-11-18 19:14:00 +00:00
Andrey Antukh
9b24b6c7c9 📚 Improve agent workflow safeguards
Protect staged changes when rewriting commit messages and close plans
after verified commits. Clarify checks and remove the unused Taiga skill.

AI-assisted-by: gpt-6.1-terra
2026-11-18 19:14:00 +00:00
Andrey Antukh
7d5fef711c 📚 Refine plan and code review criteria
Make review criteria proportional to risk and project conventions.
Keep code reviews read-only, use existing test evidence and stable IDs.

AI-assisted-by: gpt-6.1-terra
2026-11-18 19:13:59 +00:00
Andrey Antukh
14a623da08 📚 Apply plan review improvements automatically
Apply clear review improvements to the plan and resolve consequential
decisions through the walkthrough before updating the plan metadata.

AI-assisted-by: gpt-6.1-terra
2026-11-18 19:13:59 +00:00
Andrey Antukh
e7732541c3 📚 Add follow-up verification to code reviews
Include remedies, tests and decisions in review findings. Preserve review
context in plans and offer to resume the reviewer after implementation.
Keep follow-up verification optional and report deferred findings clearly.

AI-assisted-by: gpt-6.1-terra
2026-11-18 19:13:59 +00:00