Skip to content

Add support for saving / saving as - #597

Merged
agarny merged 14 commits into
opencor:mainfrom
agarny:issue594
Nov 5, 2026
Merged

agarny merged 14 commits into
opencor:mainfrom
agarny:issue594

Conversation

@agarny

@agarny agarny commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #594.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved save races can discard newer edits during Save As or save-and-close and leave the active tab pointing to an outdated path.

3 open issues
What changed in this PR

Adds Save and Save As support to OpenCOR’s desktop and web applications for #594, connecting editable views to file persistence and unsaved-change prompts.

Changes:

  • Adds editor registration, modified-tab indicators, save commands, and replacement confirmation.
  • Adds browser file-handle support, recent-file reopening, and save prompts before closing, quitting, or restarting.
  • Updates release versions, dependencies, and TypeScript inclusion of the changelog.
File Description
tsconfig.web.json Includes changelog JSON in the web project.
tsconfig.node.json Includes changelog JSON in the Node project.
src/​renderer/​src/​components/​views/​CellDLEditorView.vue Registers editable contents and tracks saved revisions; displays editor limitations.
src/​renderer/​src/​components/​OpenCOR.vue Connects save actions, recent files, and shutdown/reload prompts.
src/​renderer/​src/​components/​MainMenu.vue Adds web save, download, and reopen commands.
src/​renderer/​src/​components/​dialogs/​YesNoCancelQuestionDialog.vue Adds a cancellable confirmation dialog.
src/​renderer/​src/​components/​dialogs/​UpdateAvailableDialog.vue Delegates reload handling to the parent for save confirmation.
src/​renderer/​src/​components/​ContentsComponent.vue Implements saving, tab renaming, replacement prompts, and modified-file handling.
src/​renderer/​src/​common/​viewRegistry.ts Adds file-editor registration and save-state contracts.
src/​renderer/​src/​common/​electronApi.ts Defines desktop save and close-confirmation APIs.
src/​renderer/​src/​common/​constants.ts Shares the recent-file limit.
src/​renderer/​src/​common/​common.ts Adds save-picker detection and HTML escaping.
src/​renderer/​src/​common/​celldlEditorHost.ts Tracks diagram edits and undo/redo activity.
src/​renderer/​package.json Updates renderer version and dependencies.
src/​renderer/​bun.lock Records updated renderer dependencies.
src/​preload/​index.ts Exposes save and close-confirmation messaging.
src/​main/​MainWindow.ts Adds desktop file writes, save dialogs, and shutdown confirmation.
src/​main/​MainMenu.ts Adds desktop Save and Save As menu items.
src/​main/​index.ts Registers save and close-confirmation message handlers.
package.json Updates desktop version and dependencies.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two critical issues remain: the main-process save endpoint permits unauthorized arbitrary-path writes, and concurrent in-place saves can let an older snapshot overwrite newer data after the UI reports it saved.

2 open issues
3 resolved since last review

Review effort: Lite

Comment thread src/main/MainWindow.ts Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Active critical and moderate issues remain: save authorization is not revoked when files close, and canonical paths can be rejected during tab cleanup and reopen tracking.

2 open issues
2 resolved since last review

Review effort: Lite

Comment thread src/main/MainWindow.ts Resolved
Comment thread src/main/index.ts Resolved
@agarny
agarny requested a lite review from Copilot November 5, 2026 03:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because a critical hidden finding identifies a potentially permanent save capability that could enable unauthorized file overwrites when Save As is not committed.

No open issues 🎉

2 resolved since last review

Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because the change has multiple critical edge-case risks involving unsynchronized close handling and incorrect file-tab or handle identity, which could cause edits to be lost or saved to the wrong file.

No open issues 🎉

Review effort: Lite

@agarny
agarny merged commit 3a614d5 into opencor:main Nov 5, 2026
9 checks passed
@agarny
agarny deleted the issue594 branch November 5, 2026 04:17
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.

Add support for saving / saving as

2 participants