24618 Commits

Author SHA1 Message Date
alonso.torres
9368c83dca ✨ Make plugin writes fail while the workspace is read-only
A read-only workspace (saves failing, a user who cannot edit, a version
preview) only hid the editing tools: plugins, the MCP among them, still
changed shapes, and those edits were never saved. Every plugin write now
throws a read-only error, whatever the throwValidationErrors flag, the
same way a write to a removed shape does.

`check-permission` with a write permission runs the new `check-writable`,
which covers most writers. Writers without a permission check (most
context methods such as create*, group, align or flatten, the z-order
methods, applyTypography on a text range, removing a ruler guide) call it
themselves, and shape setters get it through `check-shape-writable`.
Reads, comments and undo blocks keep working, so a block opened before a
lock still closes.

The MCP instructions tell the agent what the read-only error means.
2026-11-05 23:59:32 +01:00
alonso.torres
c8ef46a0a4 💄 Put the team organization update handler on its own line
`ptk/UpdateEvent` of `handle-change-team-organization` sat on the same
line as the end of its watch body.
2026-11-05 23:59:32 +01:00
alonso.torres
8ef3ba628d 🐛 Keep the workspace open when closing the v2 text editor
Closing the v2 text editor with Escape could crash the workspace. The
text options panel renders once more with the editor it saw last, after
closing has disposed it, and reading the style of a disposed editor
throws.

The panel now takes the values from the shape when the editor is gone.
2026-11-05 23:59:32 +01:00
alonso.torres
6426b17c9c 🐛 Fix small save bugs found by the rollback test plan
- Ending a drag inside the frame the shapes already belong to sent an
  empty reparent save and bumped the revision. The move commits only
  when some shape changes parent.
- When a user restored a version, other sessions reloaded the file with
  no notice. They now see a dialog naming who restored which version
  (by its name, else its date), saying that later changes are no longer
  in the file and, when they had changes not saved yet, that those were
  lost.
- Exports drawn in the browser (PDF, SVG, and PNG when the WASM renderer
  draws it) and duplicating a file from the dashboard started at once,
  so an export could show changes a pending save then rejected, and a
  copy could miss queued edits. Both wait for the file's pending saves.
  A client export warns that it includes unsaved changes; a copy warns
  that it misses them.
2026-11-05 23:59:32 +01:00
alonso.torres
94c05589cf 🐛 Keep the UI in step with a rollback
A rollback can remove or change shapes the UI still refers to.

- The selection drops shapes that are gone and the color picker that
  edited them closes.
- The undo history is cut at the reverted action; it stays when no
  entry holds a reverted change. Undo and redo commits carry real undo
  changes and the history index they moved from, so a reverted Ctrl+Z
  puts the change and the index back.
- An open path edition whose shape the rollback changed closes without
  saving the editor's stale copy. The v2 text editor loads the reverted
  text again; the WASM editor already showed it.
- The Alt measurements look the hovered shape up in the current data.
- Plugin setters, resize() and rotate() on a removed shape throw
  "Shape not found", whatever the plugin's throwValidationErrors flag.
2026-11-05 23:59:32 +01:00
alonso.torres
cb26e8a39b ✨ Keep autosave and the workspace alive when saves fail
- A save that failed on a short platform failure (a lost or refused
  database connection, lack of resources, a server shutting down, a
  serialization failure or deadlock, a socket or HTTP timeout, a host
  that did not resolve, an interruption) answered 500, which stops
  autosave. It now answers 503, which the frontend retries. Other I/O
  and database errors keep answering 500, timeouts 504.
- A save answered not-found no longer replaces the workspace with the
  access page. It is a terminal save error: the workspace stays open
  with the failed save notice, report and reload link. When edit rights
  are lost, the notice says how many changes could not be saved.
- A library sync marked the library synced three seconds later,
  whatever happened to its save. A rejected sync was undone but stayed
  marked: copies stayed out of date and the "updates available" notice
  never came back. The mark now waits for the save, a rollback of the
  sync brings the notice back, and a failed mark (e.g. the user just
  became a viewer) is logged instead of leaving the workspace.
- While saves fail the workspace is read-only. The view-mode banner
  says editing is disabled because changes can't be saved, with the
  Inspect banner's size and bold lead and no Done button. Users can
  still switch pages, pan, zoom and inspect. The lock lifts when a save
  lands and brings back the mode the user had or picked meanwhile; the
  WebGL context lock keeps the workspace read-only if it lasts longer.
  The lock lives in app.main.data.persistence.lock.
- A viewer is never locked. A role change that leaves the user a viewer
  keeps the edits that lost permission, queued and on screen, and shows
  the count notice again. The role change that brings edit rights back
  releases them and rolls them back on screen, as a rejected save would.
  Any other terminal failure is released by the next role change or file
  opened.

The debug faults `io` (socket timeout, 503) and `eof` (500) cover both
sides of the I/O rule.
2026-11-05 23:59:32 +01:00
alonso.torres
f4b20ed08f 🐛 Revert whole user actions in a rollback
A rollback reverts whole undo groups, across files and saves, so that
no user action is left half done. Some actions still split:

- An action that commits several times inside one undo transaction
  (e.g. applying a token to several shapes) gave each commit its own
  group, so a rejection could revert part of it: shapes ended up linked
  to a token whose value was never applied. An undo transaction now
  opens with a commit group that every commit made inside it takes.
- The commit that undoes saved commits of a rejected action joined an
  open transaction's group, so a later rejection there reverted the
  undo too. It gets a group of its own.
- Emptying the open transaction during a rollback dropped its group, so
  its later commits were no longer one unit. It keeps its group.
- Waiting for a save ended as soon as the queue emptied, while later
  commits could still wait in the buffer. Waiters now also wait for an
  empty buffer.

A test covers a token action of three commits in one save whose third
commit is rejected.
2026-11-05 23:59:32 +01:00
alonso.torres
989f68abfd ♻️ Share the change helpers of the update-file tests
The update-file tests each built the same rect change and the same
change that fails while applied. The rect change moves to the test
helpers as th/add-rect-change and the failing one gets a named helper.
The test of a database failure during the retry no longer counts calls
to process-changes: it fails every attempt that leaves the failing
commit out.
2026-11-05 23:59:32 +01:00
alonso.torres
2f3b928a60 ⚡ Check the schema of only the pages a save touches
update-file checked the schema of the whole file on every save, which
loads and decodes every page even when the changes touch one. On files
with several pages that was most of the time of a save.

validate-file-schema-affected! checks the file data with the pages index
reduced to the pages the changes modify; the data outside pages is still
checked whole, and a change type it does not know makes it check the
whole file. update-file uses it for the strict and the soft schema check.

A save of 10 commits on a file of 10 pages of 2k shapes goes from ~1.1 s
to ~240 ms; a single page file costs the same.
2026-11-05 23:59:32 +01:00
alonso.torres
4f42ab1d2d ✨ Keep the valid commits of a save that fails validation
A save whose changes failed validation was rejected as a whole: autosave
stopped, the edits made after it piled up unsent, and a reload lost
them all, the valid ones included.

The frontend now sends each commit of a save as its own group with its
commit id (:changes-with-metadata). When applying and validating all of
them at once fails, the backend searches by bisection for the first
commit that fails, keeps the commits before it and answers with
:rejected (that commit and every later one). Only the kept changes are
stored, snapshotted and broadcast, so other users never see the rejected
ones. Flat :changes and groups without ids stay all-or-nothing; database
and network errors still fail the whole request. A rejection without an
error type is reported as an internal error.

The frontend rolls the file back to what the server holds: it undoes
every pending commit of that file, applies again the remote changes that
arrived meanwhile, and redoes the kept commits. Undoing only the
rejected commits would write stale values over a peer's later change to
the same attribute. The rejected and later commits leave the queue, the
buffer and the undo history, and a warning that hides after ten seconds
tells the user. The pure bookkeeping lives in
app.main.data.persistence.commits.

The pending notice of a commit the rollback dropped no longer leaves the
save status at pending, which made "Pin this version" hang and fail.

Debug tools drive these cases by hand: debug.commitInvalidChange() makes a
save fail validation, holdSaves() delays the answers, failNextSave() and
failNextRollback() fail them on purpose (backend flag debug-save-faults),
and persistenceState() shows the queue.
2026-11-05 23:59:32 +01:00
alonso.torres
ef4d66c3aa 🐛 Apply remote changes under buffered local edits too
A remote commit undoes the pending local commits, applies the remote
changes and replays the local ones, so the local file ends like the
server will: remote first, local last. Only queued commits took part;
the ones still waiting in the persistence buffer (up to ~3s of edits)
stayed under the remote change. When both touched the same attribute,
the remote value won locally but lost on the server.

The buffer now lives in the store ([:persistence :buffer]) instead of
an rx buffer, so the rebase can reach it. A flush merges it per file
into queue entries that keep the list of commits they carry, and the
leave-page guard reads buffer and queue from the store. A buffer left
by a previous session is queued when persistence starts.
2026-11-05 23:59:32 +01:00
Andrey Antukh
45721bd836 🌐 Rehash and validate translations 2026-11-05 23:21:26 +01:00
Andrey Antukh
7d596f8197
🌐 Add translations for: French (Canada)
Currently translated at 92.5% (2185 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/fr_CA/
2026-11-05 22:20:21 +00:00
Andrey Antukh
fb49a992b0
🌐 Add translations for: Hindi
Currently translated at 73.3% (1731 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/hi/
2026-11-05 22:20:19 +00:00
Andrey Antukh
ebedd604e8
🌐 Add translations for: Swedish
Currently translated at 94.7% (2238 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/sv/
2026-11-05 22:20:18 +00:00
Andrey Antukh
c5a29c69e8
🌐 Add translations for: Serbian
Currently translated at 48.0% (1135 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/sr/
2026-11-05 22:20:16 +00:00
Andrey Antukh
5fcc1e375e
🌐 Add translations for: Yoruba
Currently translated at 41.1% (972 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/yo/
2026-11-05 22:20:14 +00:00
Andrey Antukh
dda0445314
🌐 Add translations for: Malay
Currently translated at 22.4% (530 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/ms/
2026-11-05 22:20:12 +00:00
Andrey Antukh
3576248fb0
🌐 Add translations for: Hausa
Currently translated at 43.7% (1032 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/ha/
2026-11-05 22:20:11 +00:00
Andrey Antukh
79b1e6e8ab
🌐 Add translations for: Dutch
Currently translated at 94.7% (2238 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/nl/
2026-11-05 22:20:09 +00:00
Andrey Antukh
21172c4f0e
🌐 Add translations for: Latvian
Currently translated at 67.8% (1603 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/lv/
2026-11-05 22:20:07 +00:00
Andrey Antukh
fa7834c508
🌐 Add translations for: Korean
Currently translated at 73.3% (1731 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/ko/
2026-11-05 22:20:05 +00:00
Andrey Antukh
cd2c4332f3
🌐 Add translations for: Ukrainian (ukr_UA)
Currently translated at 75.3% (1779 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/ukr_UA/
2026-11-05 22:20:04 +00:00
Andrey Antukh
0d80598ada
🌐 Add translations for: Croatian
Currently translated at 57.0% (1348 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/hr/
2026-11-05 22:20:02 +00:00
Andrey Antukh
24a191edd7
🌐 Add translations for: Portuguese (Portugal)
Currently translated at 56.2% (1327 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/pt_PT/
2026-11-05 22:20:00 +00:00
Andrey Antukh
f5fce6c5c5
🌐 Add translations for: Czech
Currently translated at 56.8% (1342 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/cs/
2026-11-05 22:19:59 +00:00
Andrey Antukh
0b72372e5d
🌐 Add translations for: Basque
Currently translated at 41.6% (984 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/eu/
2026-11-05 22:19:57 +00:00
Andrey Antukh
855352743a
🌐 Add translations for: Japanese
Currently translated at 94.6% (2235 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/ja/
2026-11-05 22:19:56 +00:00
Andrey Antukh
50d58566cb
🌐 Add translations for: Polish
Currently translated at 40.9% (967 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/pl/
2026-11-05 22:19:54 +00:00
Andrey Antukh
8651e58aed
🌐 Add translations for: Italian
Currently translated at 79.2% (1870 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/it/
2026-11-05 22:19:52 +00:00
Andrey Antukh
50c716a0ae
🌐 Add translations for: Persian
Currently translated at 93.3% (2205 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/fa/
2026-11-05 22:19:50 +00:00
Andrey Antukh
5fa7edb8e3
🌐 Add translations for: Chinese (Traditional Han script)
Currently translated at 92.9% (2194 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/zh_Hant/
2026-11-05 22:19:48 +00:00
Andrey Antukh
fae5036252
🌐 Add translations for: Hebrew
Currently translated at 80.0% (1889 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/he/
2026-11-05 22:19:47 +00:00
Andrey Antukh
cd95407035
🌐 Add translations for: Indonesian
Currently translated at 61.0% (1441 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/id/
2026-11-05 22:19:45 +00:00
Andrey Antukh
82be9680b2
🌐 Add translations for: Arabic
Currently translated at 40.7% (961 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/ar/
2026-11-05 22:19:44 +00:00
Andrey Antukh
b27df30e36
🌐 Add translations for: Romanian
Currently translated at 70.5% (1666 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/ro/
2026-11-05 22:19:42 +00:00
Andrey Antukh
bca9dfe906
🌐 Add translations for: German
Currently translated at 79.6% (1880 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/de/
2026-11-05 22:19:40 +00:00
Andrey Antukh
7351bac796
🌐 Add translations for: Portuguese (Brazil)
Currently translated at 50.3% (1188 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/pt_BR/
2026-11-05 22:19:39 +00:00
Andrey Antukh
3df670f291
🌐 Add translations for: Chinese (Simplified Han script)
Currently translated at 85.9% (2030 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/zh_Hans/
2026-11-05 22:19:36 +00:00
Andrey Antukh
8292320e30
🌐 Add translations for: Turkish
Currently translated at 94.7% (2238 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/tr/
2026-11-05 22:19:35 +00:00
Andrey Antukh
5c6f3ddb8b
🌐 Add translations for: Russian
Currently translated at 95.4% (2254 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/ru/
2026-11-05 22:19:33 +00:00
Andrey Antukh
b58fa9b1bd
🌐 Add translations for: French
Currently translated at 94.7% (2238 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/fr/
2026-11-05 22:19:31 +00:00
Andrey Antukh
0032642399
🌐 Add translations for: Spanish
Currently translated at 99.6% (2352 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/es/
2026-11-05 22:19:29 +00:00
Andrey Antukh
2f19f68296
🌐 Add translations for: Catalan
Currently translated at 93.2% (2201 of 2361 strings)

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/ca/
2026-11-05 22:19:27 +00:00
Hosted Weblate
8a59ffd886
🌐 Update translation files
Updated by "Cleanup translation files" hook in Weblate.

Translation: Penpot/frontend
Translate-URL: https://hosted.weblate.org/projects/penpot/frontend/
2026-11-05 22:45:28 +01:00
Hosted Weblate
0c3a5de957
🌐 Merge branch 'origin/develop' into Weblate. 2026-11-05 22:45:23 +01:00
Andrey Antukh
97fe51e08b Merge remote-tracking branch 'origin/staging' into develop 2026-11-05 22:43:31 +01:00
andrés gonzález
84e0b33b74
📚 Explain what to do after losing access to an account (#12866)
Add a section to Your account for cloud users who can no longer sign
in, for example after their Google account was suspended. It points them
to support@penpot.app, lists what to send so support can confirm the
account is theirs, and suggests exporting important files.

AI-assisted-by: claude-opus-5-5
2026-11-05 22:30:20 +01:00
Elena Torró
afc40a3309
🐛 Refresh wasm heap views after allocations and wasm calls (#12833)
Growing the heap detaches typed views taken before an alloc or a call.
Take them after, so reads and writes never hit a detached buffer.
2026-11-05 18:09:59 +01:00
Elena Torró
a32f5a9811
⚡ Index fonts by family when fixing deleted fonts on page load (#12853) 2026-11-05 17:51:42 +01:00