Ungrouping a board in a grid main whose copies are ungrouped alike took
two Ctrl+Z to undo: the first only moved the copies' children back. The
layout update after the ungroup stacks onto its history entry with an
undo group of its own, which the entry records among the groups stacked
into it. The component sync that update causes commits later under that
group without stacking, and `append-undo` gave it a new entry when the
matching entry was the latest. Undo walks entries by their own undo
group, so the new entry was undone alone.
Such a commit now joins the entry that holds its group among the stacked
ones. Commits of one group in a row still keep their entries, which undo
walks together.
Tests: `workspace-undo-test/a-delayed-commit-joins-the-entry-its-group-
was-stacked-into` (fails before the fix), `adjacent-commits-of-one-group-
keep-their-entries`, and the frontend generated `generated-an-ungroup-in-
a-grid-main-undoes-in-one-step`.
ClojureScript only; the benchmark covers JVM code and is not run.
AI-assisted-by: claude-opus-5-5
The Phase 4 bug hunt: random component programs, an independent model
of what they should leave, and the regression programs of what they
found. The production fixes they found are the commits before this one,
each with its regression programs; this commit holds the test harness,
the rest of the tests and the memories they grew with. A regression
program that needs the harness runs once this commit is in.
- Generation (composable gen): worlds of components, nested copies,
variants, libraries (stale and dependent), flex and grid layouts and
texts; operations for structure, geometry, styles, texts, layout items,
grid tracks and cells, swaps, variant switches, update main, reset,
detach, library edits and syncs, undo and redo; shrinking, coverage
accounting per operation kind, and PENPOT_GEN_SEED, PENPOT_GEN_NUM
and PENPOT_GEN_HISTORIES to choose the seed, the number of programs
and their length.
- The oracle: invariants on touched groups, overrides, refs, settled
versus full sync, design snapshots and the model values, with its
own model of authored intent (shadow, geometry, grid and variant
rules) instead of production's results.
- The frontend replays generated programs through the workspace events
and the completion contract, with undo and redo checks.
- The oracle unit tests, the test runners' registrations, the golden
masters recorded again where a fix changed them, and the memories of
the component sync contract and its tests.
Harness only; the benchmark is not run.
Also in this commit:
- Adapt develop's variant set and reload tests to this branch. Develop's tests
of transforming a component into a variant set call the event with the set's
id and expect the defining commit to hold only the main. Here the transform
builds the whole set, its second member included, in one commit:
transform-in-variant takes an optional variant id, and the tests expect both
members in that commit.
- Restore the requires and test wiring the rebase merges dropped.
- Generate variant property edits and added variants. The random programs
switched between the members of a variant set but never changed the set.
AI-assisted-by: claude-opus-5-5
* ⚡ Keep the translation flag on undo and redo of a move
Previously undos and redos always forced a component sync + thumbnail
rerender for every component touched even if the underlying commits were just
translations. This propagates the translation flag to undos and redos and
propagates it to commit-changes. An entry merged from several undos/redos is
a translation only if all of its undos/redos are translations.
This reduces a UI freeze when undoing a move of a board with 453 components
from 2.42s -> 0.22s.
AI-assisted-by: claude-sonnet-5-5
* :translation? -> :translation
---------
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
Reloading the open file (a peer's restore, the fallback of a rollback)
runs initialize-workspace again without leaving the workspace. The
streams the first run started kept running next to the new ones, so a
commit added one undo entry per reload and each notification was
handled twice. The old subscription also sent its unsubscribe after the
new subscribe, which ended the new one on the server.
A new initialize-workspace, text reflow, shape layout or notification
subscription stops the one before it, and a subscription replaced by
one to the same file sends no unsubscribe.
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.
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.