Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Adds undo/redo for all state-mutating actions in the conflict resolver web UI: branch selection, delete cell, accept-all, content editing, cell drag-drop, row reordering, and checkbox toggles.

Core: useUndoRedo hook (src/web/client/useUndoRedo.ts)

  • Snapshot-based undo/redo timeline with deep cloning, max 100 entries
  • Exposes pushAction, undo, redo, jumpTo for arbitrary history navigation

UI: Header controls

  • SVG undo/redo buttons + dropdown toggle in the header bar
  • History dropdown listing all actions with labels, relative timestamps, and active/undone visual states
  • Click-outside-to-close behavior

Keyboard shortcuts

  • Ctrl+Z / Ctrl+Shift+Z / Ctrl+Y, skipped when focus is in textarea/input
  • Gated by new mergeNB.ui.undoRedoKeyboardShortcuts setting (default: true)

Undoable actions

  • Per-row: Use Base/Current/Incoming, Delete Cell
  • Bulk: Accept All Base/Current/Incoming
  • Content editing (debounced — captures pre-edit snapshot before first keystroke in each typing burst)
  • Cell drag-drop between rows, row reorder drag-drop
  • Checkbox toggles (renumber execution counts, mark as resolved)

Settings pipeline

package.jsonsettings.tsresolver.tswebTypes.tsWebConflictPanel.ts → client types.tsApp.tsxConflictResolver prop

Screenshot

Undo/Redo UI with History Dropdown

Original prompt

For all possible tasks in the conflict resolver web UI, create an undo/redo action. These will be clickable buttons on the header, as well as bind it to ctrl z and ctrl shift z by default (add a setting)

A (non exhaustive, probably) list of such actions are: picking a branch/delete, taking all of one branch, switching branches, etc. Check this out for yourself, and make sure the list is complete before you are done. You are expected to carefully parse through the code in order to make sure this is true.

I suggest you simply make some kind of history/timeline dropdown from the header. Keep this in the same style as the rest of the UI.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 7, 2026 02:21
…settings

- Create useUndoRedo React hook for state history management
- Integrate undo/redo into all undoable actions: branch selection, delete cell,
  accept all, cell drag-drop, row reorder, checkbox toggles, content editing
- Add undo/redo buttons and history timeline dropdown to header
- Add Ctrl+Z / Ctrl+Shift+Z keyboard shortcuts (skipped in textarea/input)
- Add mergeNB.ui.undoRedoKeyboardShortcuts setting in package.json
- Add CSS styles matching existing dark theme

Co-authored-by: Avni2000 <77120766+Avni2000@users.noreply.github.com>
- Replace Unicode arrow characters with inline SVGs for cross-platform rendering
- Fix debounced content edit to capture pre-edit snapshot (before first keystroke)
- Add clarifying comment to pushUndoable function

Co-authored-by: Avni2000 <77120766+Avni2000@users.noreply.github.com>
Copilot AI changed the title [WIP] Add undo and redo actions to conflict resolver UI Add undo/redo with history timeline to conflict resolver UI Feb 7, 2026
Copilot AI requested a review from Avni2000 February 7, 2026 02:30
@Avni2000 Avni2000 marked this pull request as ready for review February 7, 2026 02:35
@Avni2000
Copy link
Owner

Avni2000 commented Feb 8, 2026

Closing, didn't work very well at first try. Second iteration is in #50

@Avni2000 Avni2000 closed this Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants