Skip to content

feat(live): add undo and redo for visual previews - #26

Merged
Hugo-JC merged 7 commits into
mainfrom
feat/live-preview-history
Nov 10, 2026
Merged

Hugo-JC merged 7 commits into
mainfrom
feat/live-preview-history

Conversation

@Hugo-JC

@Hugo-JC Hugo-JC commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add a bounded, session-only history for Live DOM preview operations.
  • Add Undo and Redo controls to the workbench.
  • Support Ctrl/Cmd + Z and Ctrl/Cmd + Shift + Z outside editable controls.
  • Preserve native browser undo when the Live history has no operation to handle.
  • Coalesce consecutive edits to the same element/property into one history step.
  • Clear redo after a new edit and preserve exact absent-vs-empty class/style attributes.
  • Record property, class and reset operations.
  • Add focused tests for multi-element history ordering, redo invalidation, coalescing, limits, explicit clear and exact DOM attribute restoration.
  • Document the interaction contract in the Live Inspector guide and skill.

Related validation fixes discovered by CI

  • Include the licenses directory in the CLI installer test fixture because the distribution builder requires all declared resource roots.
  • Allow licenses/ resources in installer manifests, matching the roots already bundled by the distribution builder.

These are required to make the repository's existing distribution checks and tarball smoke test pass.

Safety and scope

  • History stores DOM attribute snapshots in memory only.
  • It does not write source files, persist data or add dependencies.
  • Closing Live continues to restore original attributes by default.
  • History is capped at 100 operations per session.

Validation

  • tsc --noEmit: passed.
  • Vitest: 147 tests passed across 30 test files.
  • npm run check: passed.
  • CLI distribution checks and isolated tarball smoke test: passed.
  • GitHub Actions matrix: passed on Ubuntu, macOS and Windows with Node 20 and 24.

Manual review

Please perform a quick browser smoke test in a Vite development project:

  1. Select an element and apply radius, padding, color and class changes.
  2. Undo and redo across more than one selected element.
  3. Confirm shortcuts do not intercept typing in inputs or contenteditable elements.
  4. Reset an element, undo the reset, then close Live and confirm original DOM attributes are restored.

@Hugo-JC
Hugo-JC marked this pull request as ready for review November 10, 2026 11:13
@Hugo-JC
Hugo-JC requested a review from Hugo-PC21 November 10, 2026 11:35
@Hugo-JC Hugo-JC added bug Something isn't working accessibility Barrier affecting people with disabilities CI labels Nov 10, 2026
@Hugo-JC
Hugo-JC merged commit 8309198 into main Nov 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Barrier affecting people with disabilities bug Something isn't working CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant