Skip to content

feat: Add open/close all Godley tables menu items. For feature #173.#657

Merged
highperformancecoder merged 2 commits into
masterfrom
feature-173-open-all-godley-tables
May 26, 2026
Merged

feat: Add open/close all Godley tables menu items. For feature #173.#657
highperformancecoder merged 2 commits into
masterfrom
feature-173-open-all-godley-tables

Conversation

@highperformancecoder

@highperformancecoder highperformancecoder commented May 26, 2026

Copy link
Copy Markdown
Owner

This change is Reviewable

Summary by CodeRabbit

  • New Features

    • Added "Open All Godley Tables" and "Close All Godley Tables" to the Edit menu for batch opening/closing of Godley tables.
    • Double-clicking a Godley icon now opens its Godley table window.
  • Bug Fixes

    • Context menu actions updated to reliably open individual Godley tables and to trigger the new open/close-all commands.

Review Change Stack

Copilot AI review requested due to automatic review settings May 26, 2026 06:19
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4744c8d3-15e4-4a47-ab68-594c6e2c2b74

📥 Commits

Reviewing files that changed from the base of the PR and between 149a5d1 and 04d2bda.

📒 Files selected for processing (3)
  • gui-js/apps/minsky-electron/src/app/managers/CommandsManager.ts
  • gui-js/apps/minsky-electron/src/app/managers/ContextMenuManager.ts
  • model/minsky.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • model/minsky.h

📝 Walkthrough

Walkthrough

Adds backend enumeration and named-item resolution for Godley tables, exposes an async TypeScript bridge, refactors CommandsManager to open/close Godley tables by ID, and wires bulk Open/Close actions into the application Edit menu and Godley context menu.

Changes

Godley Table Bulk Operations

Layer / File(s) Summary
Backend: allGodleyTables and itemFromNamedItem support
model/minsky.h, model/minsky.cc
New C++ methods: allGodleyTables() returns IDs of GodleyIcon instances; itemFromNamedItem(name) resolves named items and lazily populates namedItems on first lookup failure.
Frontend-backend bridge: async allGodleyTables wrapper
gui-js/libs/shared/src/lib/backend/minsky.ts
Added async Minsky.allGodleyTables() that delegates to backend via $callMethod('allGodleyTables').
Command handlers: double-click dispatch and bulk Godley operations
gui-js/apps/minsky-electron/src/app/managers/CommandsManager.ts
handleDoubleClick routes ClassType.GodleyIcon to openGodleyTable(itemInfo.id); openAllGodleyTables()/closeAllGodleyTables() iterate minsky.allGodleyTables(); openGodleyTable(id: string) builds the widget URL with itemId=${id} and tracks windows by id.
Menu UI integration: Edit menu and context menu updates
gui-js/apps/minsky-electron/src/app/managers/ApplicationMenuManager.ts, gui-js/apps/minsky-electron/src/app/managers/ContextMenuManager.ts
ApplicationMenuManager adds "Open All Godley Tables" and "Close All Godley Tables" to the Edit menu. ContextMenuManager updated to call CommandsManager.openGodleyTable(itemInfo.id) and adjusted click-handler syntax for bulk commands.

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • highperformancecoder/minsky#592: Related changes to GodleyIcon context/menu handling and click flows; overlaps in context-menu wiring and Godley open/close behavior.

"A rabbit hops through Godley's glade,
opening tables in a tidy parade.
With clicks and IDs the windows align,
bulk open and close—order divine! 🐇📊"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding menu items to open and close all Godley tables, which is the primary objective across multiple files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature-173-open-all-godley-tables

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 and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gui-js/apps/minsky-electron/src/app/managers/CommandsManager.ts`:
- Around line 894-897: openAllGodleyTables currently calls openGodleyTable(id)
without awaiting it, causing fire-and-forget async calls and possible unhandled
rejections; update openAllGodleyTables to await the async opens (either
sequentially with "for ... of" + await openGodleyTable(id) or concurrently with
Promise.all over minsky.allGodleyTables().map(id => openGodleyTable(id))) and
ensure errors are propagated/handled so unhandled rejections are avoided.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fb3e2587-e75f-416f-9509-e7474ca49f6d

📥 Commits

Reviewing files that changed from the base of the PR and between 255ad12 and 149a5d1.

📒 Files selected for processing (6)
  • gui-js/apps/minsky-electron/src/app/managers/ApplicationMenuManager.ts
  • gui-js/apps/minsky-electron/src/app/managers/CommandsManager.ts
  • gui-js/apps/minsky-electron/src/app/managers/ContextMenuManager.ts
  • gui-js/libs/shared/src/lib/backend/minsky.ts
  • model/minsky.cc
  • model/minsky.h

Comment thread gui-js/apps/minsky-electron/src/app/managers/CommandsManager.ts

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.

Pull request overview

This PR adds UI commands and backend support to open/close Godley table windows in bulk, as well as refactors Godley-table opening to be ID-based.

Changes:

  • Added a backend API to enumerate Godley table IDs and exposed it to the JS/Electron client.
  • Added “Open All Godley Tables” / “Close All Godley Tables” actions to the application menu and Godley context menu.
  • Updated Godley table opening logic to operate on item IDs and to (re)populate namedItems when needed.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
model/minsky.h Declares allGodleyTables() and moves itemFromNamedItem() to an out-of-line definition.
model/minsky.cc Implements itemFromNamedItem() fallback population and adds allGodleyTables() implementation.
gui-js/libs/shared/src/lib/backend/minsky.ts Exposes allGodleyTables() to the TypeScript client wrapper.
gui-js/apps/minsky-electron/src/app/managers/ContextMenuManager.ts Adds context menu entries for opening/closing all Godley tables and adjusts single-table open behavior.
gui-js/apps/minsky-electron/src/app/managers/CommandsManager.ts Adds bulk open/close commands and refactors Godley opening to accept an ID.
gui-js/apps/minsky-electron/src/app/managers/ApplicationMenuManager.ts Adds application menu items for opening/closing all Godley tables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gui-js/apps/minsky-electron/src/app/managers/CommandsManager.ts Outdated
Comment thread gui-js/apps/minsky-electron/src/app/managers/CommandsManager.ts
Comment thread gui-js/apps/minsky-electron/src/app/managers/ContextMenuManager.ts Outdated
Comment thread model/minsky.h Outdated
Comment thread model/minsky.cc
@highperformancecoder
highperformancecoder merged commit b5041f0 into master May 26, 2026
7 checks passed
@highperformancecoder
highperformancecoder deleted the feature-173-open-all-godley-tables branch May 26, 2026 23:59
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