24921 Commits

Author SHA1 Message Date
alonso.torres
10388a6b77 🐛 Hide the Selected text group once text edit mode ends
Pressing Escape in the text editor with the language options open left
the "Selected text" group on screen. Leaving edit mode renders the
options again while the WASM editor still holds its selection: the
editor component disposes it later, when it unmounts, and nothing
renders the options after that unless the text changed.

The WASM selection now only counts while the store still has the text in
edit mode, which Escape clears first.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:23 +01:00
alonso.torres
1b7b980f1f 🐛 Outline a text only once its font is loaded
Converting a text to a path right after changing its font traced the
fallback face: the outline came from WASM while the new font was still
being fetched. Plugin `flatten` and the Flatten menu share this path, so
both were affected, with any font and any writing mode.

With the WASM renderer, the conversion now waits until the faces of the
texts it converts are stored or have failed, lays those texts out again
and then outlines them, reading the page as it is then. The wait gives up
after 10 seconds. It is tracked as `:font` reflow work, so
`waitForLayoutUpdate` and the MCP tools wait for the conversion. Without
a pending font the conversion still runs at once.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:23 +01:00
alonso.torres
2dc1912af2 🐛 Stop Western digits from overlapping inside a warichu note
A warichu sub-line stacked its upright glyphs by their horizontal
advance. A half-width digit is taller than it is wide, so `39` in a
note drew its two digits on top of each other. Kanji numerals are a full
em wide and hid the problem. Tate-chu-yoko never applied inside a note,
so `digits2` made no difference.

Each note glyph now advances by its upright flow advance, the rule
upright cells of the main text already used: the font's `vmtx` advance,
or else its horizontal advance floored to an em for Latin and digits. The
note's extent and its painter share the rule through
`ShapedRun::upright_cluster_advance`.

Tate-chu-yoko stays off inside a note: its digits stand one by one, as
kanji numerals do. A combined pair would leave each digit a quarter em
wide in a half-size sub-line, and could not cross the note's split into
two sub-lines.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
03edbe8876 🐛 Keep Latin upright under upright orientation in all fonts
Upright vertical runs were shaped with both `vert` and `vrt2`. On top of
the vertical forms, `vrt2` swaps proportional glyphs such as Latin for
forms already turned on their side. Shippori Mincho and BIZ UDMincho map
Latin that way, so their Latin stayed sideways under text-orientation:
upright. Noto Sans JP and Noto Serif JP do not, which hid the problem.

Shape upright runs with `vert` only, as browsers do. Sideways runs are
rotated by the layout, so mixed text does not need `vrt2`. For Noto Sans
JP and Noto Serif JP the glyphs of kana, kanji and CJK punctuation are
the same with or without `vrt2`.

Add a Shippori Mincho subset as a test font.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
2fec140216 📚 Note how text reflow signals hold layout waits
A text reflow signal keeps the text pending until a resize or
measurement starts, so a signal that no resize follows makes
`waitForLayoutUpdate` time out. The note names where the signal is
decided and the prop that a commit path laying out its own texts passes.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
2c3dfa9a83 🐛 Keep a word space between adjacent Western readings
A reading longer than its base grows the base to the reading's width,
and neighbouring readings get no overhang room, so per-character Pinyin
or Jyutping wider than its characters ran into the next reading
("gwong2dung1waa2").

A reading without upright characters that sits beside another reading
now claims an eighth of a ruby em at each end when its base grows, in
horizontal and vertical text. Kana and Han readings stay solid.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
e618f3a47f 📚 Say which languages render each CJK text member
Each language keeps the CJK attributes it does not render, so they come
back when the text takes that language again. The Plugin API accepted
and reported them without saying that they had no effect, such as
`textCombineUpright` on a Chinese text or `writingMode` on a text with
no language. Each member now names the languages that render it.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
232fdd7d33 🐛 Settle layout waits after a text becomes fixed or is resized
A text update raised the text reflow signal whenever the text was
auto-sized before the update, and the wait then held the text until a
WASM resize started. Nothing resizes a text that the update makes fixed,
and a commit of WASM modifiers has already laid its texts out, so
`waitForLayoutUpdate` timed out after `Text.resize` or a drag resize.

- The signal reads the grow type after the update: only an auto-sized
  text waits for a WASM resize.
- `apply-wasm-modifiers` marks its commit with `:text-reflow? false`.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
d796255597 🐛 Keep the text editor from taking clicks outside the text
The editor overlay reserves a viewport of room for the text to grow
during an IME composition, and that room caught every pointer event, so
a middle-button pan or a click to the right or below the text never
reached the viewport. The overlay keeps its size, and its clip, which
also limits hit testing, now covers only the text.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
243502d77c 🐛 Name Chinese readings Pinyin or Zhuyin in every text option
- The readings group of the Language view and its hide switch read
  Pinyin, Zhuyin or, when a text mixes both, Readings, instead of Ruby.
- The options toggle of the pinyin input and the options button of the
  text selection menu read Pinyin options.
- The text selection menu shows no presentation options for zhuyin,
  whose size and position are fixed, as the sidebar already does.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
8c6ce999d9 🐛 Fix Mainland punctuation spacing in a Traditional Chinese font
Mainland spacing trims the right half of a stop's em, where its font
leaves it blank. A Traditional Chinese face draws ,。:; centred, so
the trimmed stop drifted from the text before it and crowded the next
mark. The layout now measures where the font draws each stop and trims
a centred one by a quarter em on each side, as Hong Kong spacing does.

Add a Noto Serif TC subset as a test font.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
b7496c5901 🐛 Fix background blur in PDF export
The blurred backdrop is drawn in page space keeping the scale of the
PDF canvas. Reset to identity, it was drawn about four times too small
at the page corner, so the blur did not show.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
57366071ef 🐛 Keep the page loading blur until text fonts are ready
The page reveal waits for the fonts its texts still load, lays the texts
out again and renders them, so CJK texts no longer show missing glyph
boxes on first paint. The wait ends after 3 seconds, and a page change
drops the reveal of the previous page.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
4c9000c4bc 🐛 Fix Chinese emphasis marks and vertical commas
- Horizontal emphasis marks under the text attach to the em box, not
  to the tight rect, which CJK faces stretch past it. They were drawn
  about a line low and seemed to mark other words.
- In vertical text, Chinese commas and stops of a font with no vertical
  forms stay upright: centred for Taiwan and Hong Kong, in the top
  right corner for Mainland. Colon and semicolon are centred.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
a9a5bc6081 ✨ Show writing mode in the Language view and name readings
- The Layout group of the Language view shows the writing mode,
  orientation and Distribute row, as the Text section does.
- The reading item of the text selection menu reads Furigana for
  Japanese, Pinyin or Zhuyin for Chinese, with a glyph that matches
  (あ, 拼, ㄅ) instead of the hiragana for every language.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
c6dd9ec13c 🐛 Fix CJK export, vertical text shadows and text resize anchors
- Exports lay out the active CJK content, as the workspace does, so
  attributes the text language does not use are not rendered.
- Vertical text paints only its silhouette, widened by center and outer
  strokes, in the drop shadows of its container, and renders its inner
  shadows. The SVG renderer paints it opaque in container shadows.
- Horizontal text keeps its top-left corner when its size changes;
  vertical text keeps the edge its vertical alignment sets, also when
  the draft-js editor commits its size.

AI-assisted-by: claude-opus-5-5
2026-11-27 17:36:22 +01:00
alonso.torres
69b77cef11 ✨ Expose CJK text layout in the Plugin API
Text shapes and text ranges read and write the CJK attributes, among them
the language (`lang`), writing mode, orientation, readings and emphasis
marks. Update the plugin types, the changelog and the API test suite.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Closes #13257

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

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

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

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

Closes #13323

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

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

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

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

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

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

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

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

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

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

AI-assisted-by: hy4-flash-free

♻️ Require an explicit secret key and tighten key files

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

AI-assisted-by: hy4-flash-free

* 🐛 Align service secret key configuration

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

AI-assisted-by: gpt-6.1-terra

* 🐛 Normalize key files consistently across services

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

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

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

Closes #13338

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

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

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

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

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

Closes #13353

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

* 🐛 Repair collapsed layout children

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

AI-assisted-by: composer

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

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

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

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

---------

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

Closes #13255

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

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

Closes #13250

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

* 🐛 Keep values unchanged when leaving a number input untouched

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

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

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

* 🐛 Keep untouched and mixed number inputs unchanged on leave

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

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

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

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

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

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

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

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

* 🐛 Fix the pointer-map review findings

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

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

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

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

* 🐛 Avoid orphan fragments during save migrations

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

AI-assisted-by: gpt-6-luna

* 🐛 Prevent save migration tests from masking failures

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

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

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

Closes #12578

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

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

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

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

* 🐛 Check the squashed geometry in the transform overflow test

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

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

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

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

* ✨ Add a local runner for pull request reviews

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

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

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

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

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

* 🔧 Default OpenCode reviews to high effort

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

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

---------

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

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

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

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

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

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

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

* 📚 Note that toggling guides also hides board guides

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

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

---------

Co-authored-by: Roshan Ramani <roshanramani.dev@gmail.com>
2026-11-25 14:19:35 +01:00
Eva Marco
edd487cddd
🐛 Normalize legacy svg attrs of pasted shapes (#13334)
* 🐛 Normalize legacy svg attrs of pasted shapes

Shapes copied from a version before 2.20 can hold camelCase svg attrs,
for example :strokeLinejoin. Files get them normalized by migration
0037 when they load, but clipboard data skips the migrations, so the
closed SvgAttrs schema rejected the pasted shape and the whole paste was
cancelled.

Move the shape normalization of migration 0037 to csvg/normalize-shape
and run it on every pasted shape in paste-shapes.

Closes #13327

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

* 📚 Name the shared svg repair in the data model checklist

From the review: the checklist still named the withdrawn migration 0035
as the svg repair site. Point it to csvg/normalize-shape, used by
migration 0037 and by paste-shapes.

AI-assisted-by: claude-opus-5-5
2026-11-25 13:58:36 +01:00
Eva Marco
efe420e3e4
✨ Count the trips of a throttled update loop before reporting it (#12941)
* ✨ Count the trips of a throttled update loop before reporting it

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

Relates #12580

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

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

Review asked for no new functions with a ! suffix.

AI-assisted-by: claude-opus-5-5
2026-11-25 13:52:15 +01:00