Repository navigation
Add support for saving / saving as - #597
Conversation
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🔵 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
There was a problem hiding this comment.
🔵 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


Fixes #594.