Text typed with an IME took the style of the character before it, not
the size or other style just chosen at the caret, though the sidebar kept
showing the chosen one. Composition start dropped the pending caret
style.
The caret position is now kept at composition start, and the commit
gives the composed text the pending style, as plain typing does. Nothing
touches the store or the composing element until the composition ends.
AI-assisted-by: claude-opus-5-5
A character right after a horizontal warichu note vanished when line
adjustment squeezed the line (push-in first, the default): it was laid
out about 0.01px wide.
Skia's `getText()` finalizes the paragraph builder, and that drops the
style block just pushed for a span that holds no text yet. The squeeze
reads the builder text right after that push, so the start of the span
joined the block before it: after a note, the near-zero style of the
note's anchor. The span style is now pushed again after the read.
AI-assisted-by: claude-opus-5-5
Assigning `characters` gave the new text the style of the first span,
its reading and warichu note included, so one reading spread to every
character. The new text now drops them: they annotate their own
characters, not a style.
Removing a reading with `''` left an empty string that plugins read as
`ruby: ""`. A blank reading now reads `null`.
The HTML text renderers, used by generated code, `generateMarkup` and
the browser text, did not mark paragraphs with their language. Each
paragraph with one now carries `lang`, so browsers pick the localized
glyph forms and line breaking.
The Plugin API test suite covers every CJK member of Text and
TextRange: defaults, language tags, paragraph-wide range attrs,
`distribute`, Chinese annotations, mixed values, adding and removing
readings, the single-span rejection and invalid values. A live-only test
flattens a vertical CJK text. `api-surface.json` lists the CJK members.
AI-assisted-by: claude-opus-5-5
The MCP API docs were generated before the CJK text members existed, and
the overview never mentioned them, so a client found them only by dumping
the whole Text type and learned from each member that nothing renders
without `lang`.
The overview gains a CJK section: set `lang` first, which languages draw
each member, whole-shape versus range members, the single-span rule of
readings and warichu notes, Zhuyin input, vertical `growType`, range
indices and how to check the result, with an example.
The Text and TextRange docs give the Zhuyin syllable format, the default
emphasis positions, what a text span is and how `growType` works in
vertical text, and the `createText` example passes its text.
`api_types.yml` is regenerated from them.
AI-assisted-by: claude-opus-5-5
Typed text always went into an existing span and took its reading and
warichu note with it: selecting all and typing, deleting everything and
typing again, or typing right after a reading extended it to the new
characters.
Text typed at either edge of a reading or warichu note now goes to the
neighbouring plain span, or to a new span with the same style and no
annotation. Inside a reading, including between spans that share one,
it keeps the reading. A span emptied by a deletion or an Enter at its
edge drops its annotation, and overtype at the end of a reading replaces
the text after it.
The editor export marks those spans with `d`, and the frontend drops
their `:ruby`, `:ruby-group` and `:warichu` when it merges the content.
Readings WASM does not draw, hidden ones or those the text language
leaves out, reach it as flag 8, so typed text stays out of them too.
AI-assisted-by: claude-opus-5-5
Opening a file showed a blank page until every font its texts use had
loaded, up to 3 seconds: the page reveal waited for all of them. Now the
page shows at once, and only a text whose font is still loading stays off
the canvas, until its own faces are stored or have failed. Past 3 seconds
from the first text held, every text shows, in a fallback face if its
font is still missing, and is laid out again when the font arrives.
WASM keeps the flag per shape and skips drawing such a text, its shadows
included, except in exports and thumbnails. Only a page load holds texts:
editing, thumbnails and component renders draw them as before.
The fonts of a page also start loading with each batch of shapes sent to
WASM, rather than after the whole page was sent and first drawn.
AI-assisted-by: claude-opus-5-5
The reading options of the whole text, in the Furigana group, sit among
the other rows of the language view and need no box. The box now marks
them only when the ⋮ button of a selection opens them below its reading
input.
AI-assisted-by: claude-opus-5-5
The language view follows the review of the demo build:
- A divider sets each group apart. Clearance is always a Layout option.
- The reading field takes the format's name as placeholder, an eye button
hides the readings, and its options open in place, two to a row, until
the button is pressed again or the selection changes.
- The readings group of the whole text takes the same style and shows
only while no text is selected. Japanese calls readings furigana, and
side reads Over / right or Under / left in both writing modes.
- Japanese tate-chu-yoko joins the writing mode row, with the digit
count in its own row; warichu and combine get labelled rows.
- Chinese emphasis marks are selection options only. Readings default
to zhuyin in Taiwan and Hong Kong while the selection can take it.
- Korean texts given the language break by word, now "By word". Texts
that already have a wrapping, or none, keep it.
AI-assisted-by: claude-opus-5-5
A vertical column was never narrower than 12px times the line height:
the largest font size of the paragraph was seeded with 12, so a column
of text from 4 to 12px measured the same, about 17px at a line height
of 1.4, where a horizontal line of 4px text measures 6px.
The largest span now sets the column alone; 12px is only the size of a
paragraph without spans.
AI-assisted-by: claude-opus-5-5
Setting `align` on a text range through the plugin API stored the value
on the range's spans, while the renderers read it from the paragraph, so
it was saved but never drawn, in horizontal and vertical text alike. The
range `direction` setter had the same fault and wrote a `:direction` key
that nothing reads at all.
Both now go to the whole paragraphs the range touches, as the language
already did, and their getters read those paragraphs: spans of a new
text carry the default values, which used to hide the paragraph ones.
AI-assisted-by: claude-opus-5-5
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
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
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
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
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
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
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
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
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
- 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
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
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
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
- 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
- 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
- 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
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
- 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
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
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
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
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
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
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
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
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
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
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
* 🐛 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
* 🐛 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
* ✨ 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
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
* 🐛 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
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>
* 🐛 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
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