penpot/frontend
alonso.torres 2a210bddc8 ✨ Build variant actions and update main changes in common
Several actions built their changes in frontend events, step by step,
each step its own commit, so the pure runner could not run them and
one undo could revert half an action.

- Renaming a variant member in the layers panel sent three events,
  each in its own undo transaction: update the properties from the
  typed formula, remove the properties no member gives a value, and
  set or clear the member's error. One undo reverted only the last.
  clvp/generate-rename-member builds the three steps in one changes
  (with generate-update-properties and
  generate-remove-empty-properties), and dwv/rename-member commits it
  once with the same analytics events.
  update-properties-names-and-values goes; remove-empty-properties and
  update-error stay for the design tab.
- Transforming a component into a variant sent about fourteen events,
  and combining components as variants that transform and eight more.
  clv/generate-transform-in-variant and
  clv/generate-combine-as-variants build those steps as one changes,
  from the generators common already had, and the events commit them
  once. The flex layout initializer moves to common as
  cls/layout-initializer. Combine still sizes the board with two
  frontend dimension updates inside its undo transaction: the
  frontend applies them through modifiers, which common has no step
  for.
- update-component split the changes of an update main (the copy's,
  marked :local-change?, from the main's, which may belong to a
  library) with two transducers; cll/split-local-changes does it. Its
  undo-group argument, never passed, goes, and the main's library is
  the copy head's :component-file, which it looked up through the
  file data only to read its id back.
- dwv/valid-variant-switch? read the libraries from the state and
  repeated the lookup of clv/find-switch-target. clv/valid-switch?
  takes the libraries and asks find-switch-target; the plugin's
  switchVariant and the frontend test call it.

Behavior changes:
- One undo after a rename of a member, a transform or a combine
  reverts all of it. After a transform, it reverted only the sync of
  the copies' names (F6 in case AT); its pins go.
- The transform no longer sends the "create-board" analytics event of
  the board it creates around the main.

In the composable suites, renaming a member in the layers panel,
removing the empty properties and setting a member's error are
variant property edits both runners run, and case AW joins the JVM
set. Its rename node drives the real layers-panel rename, which
removes the empty properties too, so the step that removed them goes.
The golden masters are recorded again for AW (the JVM one gains the
case, the frontend one loses that step) and for AT (its final states
no longer list the F6 undo failures).

AI-assisted-by: claude-opus-5-5
2026-10-28 15:53:06 +01:00
..
2026-10-28 15:53:05 +01:00
2026-10-07 10:41:29 +02:00