Skip to content

Restore undo and redo in Godley popups - #1018

Open
highperformancecoder with Copilot wants to merge 6 commits into
masterfrom
copilot/sf-1366-fix-undo-redo-godley-popup
Open

highperformancecoder with Copilot wants to merge 6 commits into
masterfrom
copilot/sf-1366-fix-undo-redo-godley-popup

Conversation

Copilot AI commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Godley popup edits were not consistently recorded in the popup’s table history, leaving Undo and Redo ineffective in JavaScript and Tcl/Tk interfaces.

  • History: Capture edits from cell changes, keyboard and mouse input, clipboard actions, and row or column operations. Preserve redo states until a new edit branches history.
  • Popup refresh: Update the restored table and refresh the JavaScript popup after Undo or Redo.
godley.popup.addFlowByRow(row)
godley.popup.undo(1)   # undo
godley.popup.undo(-1)  # redo

This change is Reviewable

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c380c4cf-381c-4dd9-9f6f-6b4eabdfa456

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix undo/redo functionality in Godley popup Restore undo and redo in Godley popups Oct 18, 2026
@highperformancecoder

Copy link
Copy Markdown
Owner

@copilot undo works, but not redo.

Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>

Copilot AI commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@copilot undo works, but not redo.

Fixed in 4268541: table refresh after undo could normalize blank initial-condition cells and invalidate the redo snapshot. The restored snapshot is now preserved exactly, with regression coverage added.

@highperformancecoder

Copy link
Copy Markdown
Owner

@CodeRabbit review

@highperformancecoder
highperformancecoder marked this pull request as ready for review October 20, 2026 01:30
Copilot AI balanced review requested due to automatic review settings October 20, 2026 01:30
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review skipped.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@highperformancecoder

Copy link
Copy Markdown
Owner

@CodeRabbit rereview

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

@highperformancecoder I’ll trigger a full re-review of all changes, with particular attention to redo behavior in Godley popups.

⚠️ Action not completed

Review skipped.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved undo correctness issues can lose edits, restore inconsistent state, and invalidate redo history.

5 open issues
What changed in this PR

Restores Godley popup Undo/Redo for JavaScript and Tcl/Tk interfaces, addressing #804.

Changes:

  • Records cell, clipboard, mouse, keyboard, and structural edits in popup history.
  • Preserves redo history until a new edit and refreshes restored tables.
  • Adds regression coverage for undo, redo, and history branching.
File Description
test/​00/​godleyTable.sh Adds popup history regression tests.
model/​godleyTableWindow.cc Records edits and revises history restoration.
model/​godleyIcon.cc Captures history before cell and row changes.
gui-js/​libs/​ui-components/​src/​lib/​godley-widget-view/​godley-widget-view.component.ts Records HTML row and column operations.
gui-js/​apps/​minsky-electron/​src/​app/​managers/​GodleyMenuManager.ts Refreshes popups after Undo and Redo.

Review effort: Balanced

Comment on lines +201 to +202
await godley.popup.undo(1);
GodleyMenuManager.refresh(window);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in dbec42327: Undo/Redo now routes through the renderer, commits the active cell edit, then invokes backend history navigation and refresh.

Comment thread model/godleyIcon.cc
void GodleyIcon::moveCell(const MoveCellArgs& args)
{
if (!table.cellInTable(args.srcRow, args.srcCol) || !table.cellInTable(args.destRow, args.destCol)) return;
popup.pushHistory();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 486227f: cross-column moves now record one history transaction while both cell updates still perform linked-column balancing. Added an Undo regression test.

Comment thread model/godleyTableWindow.cc Outdated
Comment thread model/godleyTableWindow.cc Outdated
m_godleyIcon.table=restoredTable;
m_godleyIcon.update();
m_godleyIcon.table=restoredTable;
adjustWidgets();
@highperformancecoder

Copy link
Copy Markdown
Owner

@CodeRabbit - why are you skipping the review?

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

⚙️ CodeRabbit configuration inspected

Length of output: 98174


@highperformancecoder The two requests returned different levels of detail:

  • review: The response cited incremental-review restrictions. This command does not re-review already reviewed commits and applies only when automatic reviews are paused.
  • rereview: The response said only “Review skipped.” I checked the configuration, but the result contains no execution diagnostics that explain this skip.

Automatic and incremental reviews are enabled. No path, title, label, or username exclusion filters are configured.

My earlier reply announced a full re-review, but the action did not complete. Sorry for the confusion. Please try @coderabbitai full review. If that also skips without a reason, contact CodeRabbit support with the link to #1018 so they can inspect the execution logs.

You are interacting with an AI system.

@highperformancecoder

Copy link
Copy Markdown
Owner

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review skipped.

Copilot AI and others added 2 commits October 20, 2026 04:01
Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
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.

[SF#1366] undo/redo not working in Godley popup

3 participants