* ✨ Honor trusted alternate origins for backend links and OIDC
Add PENPOT_TRUSTED_ORIGINS, an optional list of bare scheme://host[:port]
alternate origins. A request whose Origin matches (exact, trimmed and
lowercased) uses that origin as the base for links generated while serving
it: emails, asset URLs, audit and webhook link fields, and redirects.
Unlisted origins, requests without Origin, and background or server-to-server
work keep the canonical public-uri (fail-closed). Malformed entries warn at
startup and never match.
Stamp the trusted origin on the request with a global http middleware that
binds config public-uri for the request extent; expose the chain as
root-middleware so tests assert it runs before auth and errors. Build every
backend link through the canonical cf/get-public-uri.
Carry the origin in the signed OIDC state (auth and organization SSO) so the
callback, a navigation without Origin, re-applies it with with-public-uri for
the token-exchange redirect_uri and every redirect, including logout. Verify
the state token once per callback and reuse the claims; build redirect URIs
with ensure-path-slash plus join and append-query-param for hash routes. A
removed origin does not invalidate states signed before it (up to four hours).
Bring MCP OAuth into scope: wrap its routes, stage the origin in the Redis
request record at authorize time, and re-apply it in decision so issuer,
resource, the approval redirect and the code-exchange iss agree on one base.
Keep the log-capture watch installed while waiting for the async rejection
record in the save tests; a watch removed first lost late records and read
nil. Add a delayed-executor regression test that makes the race deterministic
and document the rule in the backend testing memory.
Closes#11625
AI-assisted-by: deepseek-v4.1-flash
AI-assisted-by: qwen3.7-plus
AI-assisted-by: gpt-5.6-luna
AI-assisted-by: muse-spark-1.3-contributor
* ✨ Serve trusted alternate origins across frontend and backend
Let one installation serve a canonical domain plus trusted alternate
origins, without letting request headers pick arbitrary link bases.
The backend normalizes `PENPOT_TRUSTED_ORIGINS` on load: it drops malformed
entries with a warning and warns about HTTP origins outside localhost. It
selects the first trusted origin from `X-Penpot-Origin`, then `Origin`, and
applies only scheme, host and port to the public URI, keeping the configured
path. MCP OAuth keeps the canonical base because its authorize navigation
has no usable origin.
The frontend reads the same list from `config.js`, filled by the container
entrypoint, and selects the browser origin only on an exact match. It sends
`X-Penpot-Origin` on RPC calls (including GETs and multipart) and OIDC
initiation, not on asset, font or external requests. SSE captures the request
bindings, and export jobs store the effective base so the download link uses
it after the request ends. A closed export creation schema excludes
`:public-uri`, which the backend adds only after validation.
Register the OIDC callback for each alias. Removing an alias does not stop
already signed OIDC state, queued mail or export jobs from using it.
Add regression tests across backend, frontend and the nginx entrypoint, and
document the proxy setup, worker upgrade and rollback, and alias retirement.
Refs #11625
AI-assisted-by: hy4-flash-free
AI-assisted-by: gpt-6-luna
AI-assisted-by: gpt-6.2-sol
* ✨ Add an options button to color assets
Color assets could only be renamed, edited, duplicated or deleted from
the right-click menu, which tablet users can't open. Add a three-dot
options button, like the one on typography assets, that opens the same
menu below the button. It shows on hover and focus, and stays visible on
devices without hover.
Closes#12618
AI-assisted-by: Claude Opus 5.5
* 🐛 Keep the color asset options button reachable by keyboard
The options button was hidden with visibility, which also takes it out
of the tab order, so :focus-within could never reveal it from the
keyboard. Hide it with opacity instead, so Tab reaches the button and
shows it.
Open the menu through one helper for both the right click and the
button, so both keep clearing the selection first.
AI-assisted-by: Claude Opus 5.5
* 🐛 Toggle the color asset menu and fix its row and focus
---------
Co-authored-by: Luis de Dios <luis.dedios@kaleidos.net>
* 🐛 Show the full library name in a tooltip when it is cut
Long library names are cut with an ellipsis in the Libraries modal and
in the Assets panel, with no way to read the full name, so libraries
that share a long prefix cannot be told apart.
A new truncated-text* component shows the text and, only while CSS cuts
it, wraps it in the DS tooltip with the full text. A ResizeObserver
checks the size again when the box changes; it follows the node that the
tooltip mounts, so the tooltip also goes away when the text fits again.
The Libraries modal (new and legacy layouts) and the library titles in
the Assets panel use it.
Closes#13223
AI-assisted-by: claude-opus-5-5
* 🐛 Keep a cut library name visible inside its tooltip
The DS tooltip trigger sets line-height: 0. A cut name inside it
inherited that value and collapsed, so the Assets panel hid the name of
a long shared library. The trigger of truncated-text* now inherits the
line height of its parent through an inline style; a class would tie
with the trigger class and depend on the order of the stylesheets.
AI-assisted-by: claude-opus-5-5
* 🐛 Add opt-in MCP JSON replies and deliver pending outcomes on shutdown
Stateless legacy POST requests can opt in to a single correlated JSON reply
with PENPOT_MCP_JSON_RESPONSE=true; SSE remains the default.
Shutdown now rejects pending plugin tasks before closing HTTP
connections and gives in-flight requests a bounded grace period to send
their replies, so a tool call interrupted by shutdown reports an
unknown outcome instead of a dropped stream (both JSON and SSE).
Tool execution failures now set isError on the MCP result.
Refs #12497
AI-assisted-by: claude-opus-5-5
* 📎 Give the 100-round JSON reply test room on loaded CI machines
AI-assisted-by: claude-opus-5-5
* ✨ Add nitrate methods to bring owned teams into an organization
Nitrate lets an organization owner add the teams they own, outside any
organization, from the Admin Console. Three management methods give it
what it needs:
- get-owned-teams-detail lists the owned, non-default teams of the
current profile with the get-teams-detail fields plus member ids, so
Nitrate can count members new to the organization.
- count-organization-team-invitations-for-non-members counts, per team,
the pending invitations for people outside the organization.
- send-organization-setup-sso-emails-for-team sends the SSO email to
the people an added team brings in, as add-team-to-organization does.
get-teams-detail now shares its row query with the new method.
AI-assisted-by: claude-opus-5-5
* ♻️ Rename the team detail row helper apart from its method
The private helper shared by get-teams-detail and get-owned-teams-detail
had the same name as the get-teams-detail RPC method, which read as one
calling the other. It is now get-teams-detail-rows.
AI-assisted-by: claude-opus-5-5
* 🔧 Test empty lists in the invitation count
Cover count-organization-team-invitations-for-non-members at the
method boundary: an empty team-ids list gives no counts, and an empty
member-ids list, or one whose profiles give no email, counts every
pending invitation of the requested teams.
AI-assisted-by: claude-opus-5-5
* 🐛 Keep trailing spaces in WASM text bounds
Skia's longest_line() and line widths leave out the spaces at the end
of a line, so auto-width texts lost their trailing spaces in the
selrect, and the tight text bounds cut them off too. Fonts that draw
a glyph for spaces, like Zilla Slab Highlight, showed the gap.
- Measure auto-width text with max_intrinsic_width(), which keeps
trailing spaces.
- Extend each line's tight bounds with the rects of its whole range,
trailing spaces included.
Closes#12998
AI-assisted-by: claude-opus-5-5
* 🐛 Paint trailing spaces in WASM text
Skia lays out the spaces at the end of a line but never paints them.
Fonts that draw a glyph for spaces, like Zilla Slab Highlight, lost
those glyphs on the WebGL renderer.
- End each paragraph that ends in whitespace with a zero-size
placeholder. The spaces are no longer trailing, so Skia measures and
paints them with the right glyphs and paints.
- Add it to the fill and stroke builders alike, so their layouts match.
- Leave it out when it would wrap onto a line of its own in a fixed or
auto-height box, which would add an empty line. A probe layout per
paragraph decides this, cached per content version and box width.
Closes#12998
AI-assisted-by: claude-opus-5-5
Point the public CSS export to the generated file and test its build.
Clarify component restoration and cover the deleted-file path. Update
integration test documentation for the release bundle.
AI-assisted-by: gpt-6.1-terra
Add `gh.py create-pr` to create pull requests with automatic base detection,
optional issue linking and support for project and draft options. Normalize
and validate detected base branches, and report the created URL if issue
linking fails. Update the skill and workflow documentation, and cover the
command and base detection with tests.
AI-assisted-by: hy4-flash-free
* 🐛 Restore the WASM stack pointer after a failed call (#12978)
A failed render-wasm call traps without popping its shadow-stack frames.
Each failure leaked stack until it overwrote static data, and from then on
every call trapped as wasm-critical. h/call now saves the stack pointer
before the call and restores it on failure.
Closes#12977
Related to #12906
AI-assisted-by: claude-opus-5-5
* 🐛 Fix render-wasm panic when an auto layout has only absolute children
An auto flex or grid layout whose children were all absolute shrank to
zero, and a rotated shape below it got a matrix that cannot be inverted,
which panicked in `_propagate_modifiers`. Skip auto-size when there is
no content, as CLJS does. A matrix that still cannot be inverted is now
a recoverable error, which shows a toast instead of the error page.
Closes#12763
AI-assisted-by: claude-opus-5-5
* 🐛 Count hidden children in render-wasm grid auto-size
A grid takes its size from its tracks, so, like CLJS, it skips auto-size
only when every child is absolute. Flex still skips hidden children,
since its line building leaves them out.
Refs #12763
AI-assisted-by: claude-opus-5-5
Hovering a grid frame requested a full render. That clears the
canvas and walks every visible tile even though the overlay is
only UI. show_grid and hide_grid now re-present the last frame.
Warn that recovery may discard unsaved edits instead of implying that
reopening is the only recovery path. Update the API docs and test.
AI-assisted-by: gpt-6.1-terra
Correct session, upload and validation boundaries and consolidate
related testing and frontend recovery guidance by task.
AI-assisted-by: gpt-6.1-terra
Distinguish removing shape assignments from removing cells and clarify
the development overlap helper's actual empty-map check.
AI-assisted-by: gpt-6.1-terra
Build legacy migration fixtures from the datafied library to avoid
ClojureScript inference warnings without changing the test cases.
AI-assisted-by: gpt-6.1-terra
Show the existing interactive test command in help and documentation,
and check that help only names package scripts that exist.
AI-assisted-by: gpt-6.1-terra
Distinguish detaching a token source from absorbing its library and
record when a direct set change clears active themes.
AI-assisted-by: gpt-6.1-terra
Keep the save lifecycle guidance together under a direct name and
update references across the client and server guidance.
AI-assisted-by: gpt-6.1-terra
Unify token model and workspace behavior, update activation semantics,
and keep general schema coercion in a separate memory.
AI-assisted-by: gpt-6.1-terra
Document preview cleanup on gesture end and unmount alongside commit
and cancellation boundaries in a directly named memory.
AI-assisted-by: gpt-6.1-terra
Keep construction, application, compaction, and schema validation in
one memory and update frontend and backend references.
AI-assisted-by: gpt-6.1-terra
Bring geometry invariants and numeric precision together while keeping
component sync comparisons in the component memory.
AI-assisted-by: gpt-6.1-terra
Bring component and variant behavior, referential repair, and diagnosis
together while keeping schema validation and change mechanics separate.
AI-assisted-by: gpt-6.1-terra
Keep touched and geometry boundaries and document the live shape lookup
that prevents swaps from acting on stale positions.
AI-assisted-by: gpt-6.1-terra
Split common file change and repair rules into focused memories and
link each topic directly from the common module guide.
AI-assisted-by: gpt-6.1-terra
Keep runtime selection, state lookup, and temporary instrumentation
constraints without assuming a specific MCP integration is available.
AI-assisted-by: gpt-6.1-terra
Organize frontend notes by task and correct viewer validation and
dashboard message topic details to match the current implementation.
AI-assisted-by: gpt-6.1-terra
Separate CLJS components, styles, the shared UI package, and the text
editor so each guide has a direct entry point and current build details.
AI-assisted-by: gpt-6.1-terra
Document generated locale modules and watcher behavior in the focused
translation memory instead of keeping stale UI instructions.
AI-assisted-by: gpt-6.1-terra
A grid takes its size from its tracks, so, like CLJS, it skips auto-size
only when every child is absolute. Flex still skips hidden children,
since its line building leaves them out.
Refs #12763
AI-assisted-by: claude-opus-5-5
An auto flex or grid layout whose children were all absolute shrank to
zero, and a rotated shape below it got a matrix that cannot be inverted,
which panicked in `_propagate_modifiers`. Skip auto-size when there is
no content, as CLJS does. A matrix that still cannot be inverted is now
a recoverable error, which shows a toast instead of the error page.
Closes#12763
AI-assisted-by: claude-opus-5-5
A failed render-wasm call traps without popping its shadow-stack frames.
Each failure leaked stack until it overwrote static data, and from then on
every call trapped as wasm-critical. h/call now saves the stack pointer
before the call and restores it on failure.
Closes#12977
Related to #12906
AI-assisted-by: claude-opus-5-5
Follow-up to #13210, from its review. The warning and error message
tests now echo the translation arguments, so they fail when the value
goes missing from the message. The generic shape attributes also check
sizing, opacity and rotation, and the group renaming cases talk about
group membership rather than the group's name in the path.
The token tests now share one `tr` stub instead of three copies.
Signed-off-by: Florian Schroedl <flo.schroedl@gmail.com>
Co-authored-by: Eva Marco <eva.marco@kaleidos.net>
WASM errors are thrown as an ex-info whose cause is the original failure
(the trap, `RuntimeError: unreachable`, `memory access out of bounds`,
`Aborted(OOM)`). The CLJS `format-throwable` printed only the ex-data and
the stack, so the report said where a WASM call failed but never why.
Add a "Caused by:" block with the cause message, printed on its own since
only V8 starts `.stack` with it, followed by its formatted data and stack.
Relates to #12910
AI-assisted-by: claude-opus-5-5
Splitting off some refactoring from other renderer work that I thought would be
useful. Callers of mask_id should check is_masked_group first, so this rolls
the two into one. Whilst we're here, it also removes the reference from the
Uuid type (`Option<Uuid?> -> Option<Uuid>`). It's cheap to copy and a few call
sites will need to copy it to satisfy the borrow checker anyway.