Theme Builder
Click the swatches to repaint the preview card, then undo and redo your changes. The history is a #[Persist] array: server state per tab, with no signals.
$this->historyIdx, redo increments it. History truncation on branch is a single array_slice.$this->history entry every render.#ffffff
#6366f1
#1e293b
#e2e8f0
#f59e0b
Welcome! This preview card reflects your current theme in real time, every color stored and rendered on the server.
Signals
history
array server only initial: [default theme] #[Persist] undo/redo stack. Per-tab instance state, not a signal, never sent to the client.
historyIdx
int server only initial: 0 #[Persist] index of the active history entry. Undo/redo move this pointer.
Actions
setColor
Reads ?slot= and ?color= params, validates against the swatch whitelist, pushes to history, calls $ctx->sync().
undo
Decrements $this->historyIdx and re-renders via $ctx->sync().
redo
Increments $this->historyIdx and re-renders via $ctx->sync().
reset
Resets history to the single default theme entry.
Views
theme_builder.html.twig
Preview uses inline CSS from the current history entry. The demo block re-renders on each action.