Skip to content

1.2.0

Choose a tag to compare

@github-actions github-actions released this 27 May 21:39
· 87 commits to main since this release

Unified cross-mode undo/redo. Tree mode and source mode now share a single 100-deep text-based history. Cmd/Ctrl+Z and Cmd/Ctrl+Shift+Z work in both modes; switching between tree and source no longer wipes the undo stack.

Changed

  • Unified history: every change — tree-mode mutation or source-mode text edit — pushes the pre-state TEXT onto a single shared stack. Undo/redo restore that text and refresh the active mode.
  • Mode-switch no longer clears the undo history.
  • Source mode no longer keeps a separate CodeMirror-local undo stack; the unified history captures every doc change. Trade-off: Cmd+Z in source mode now undoes per onChange event (roughly per keystroke) rather than via CodeMirror's character-grouping heuristic. In practice this is similar granularity.

Internal

  • History is now generic (History<T>). JsonFileView uses History<string> instead of the previous tree-only History<HistoryState>. The old HistoryState interface is gone; the new API takes and returns the raw T.
  • Plugin command IDs renamed: undo-tree-editundo-edit, redo-tree-editredo-edit. Hotkey bindings are unchanged.
  • 4 new integration tests in JsonFileView.undo.test.ts covering source-mode undo, source→tree cross-mode undo, tree→source cross-mode undo, and the canUndo / canRedo mode-independence guarantee.
  • Test count: 369 → 373 (existing tree-history tests reused as-is via generic typing).