Fix stale save metadata handling#33
Conversation
Co-authored-by: Codex <noreply@openai.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
There was a problem hiding this comment.
Code Review
This pull request refactors file operations in the application by introducing a centralized readOpenFileFromDisk helper to load file contents and metadata, updating file saving and reloading logic, and improving the error toast UI with alert roles and styling. The review feedback suggests optimizing readOpenFileFromDisk by executing readFile and statFile in parallel with Promise.all, and improving UI responsiveness during saves by updating the open files state before awaiting the file refresh process.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e327d74b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR improves correctness of save conflict detection by ensuring open/reloaded tabs and post-save state use fresh on-disk metadata (instead of potentially stale tree-scan entries), and it updates error toast presentation to be a top-right alert-style message with an icon.
Changes:
- Read file contents + metadata from disk when opening/restoring/reloading tabs so conflict checks use the loaded file’s actual on-disk version.
- After writes, refresh saved tab metadata via a direct
statFile()rather than relying on the workspace scan result. - Rework error toasts to be an alert-style UI element (top-right, icon + text) and update tests accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/styles.css | Repositions/restyles the toast to be a top-right alert with danger styling and icon support. |
| src/App.tsx | Introduces disk-based open/reload metadata refresh and updates toast rendering to role="alert" with an icon. |
| src/App.test.tsx | Adjusts statFile mocking and adds coverage to validate fresh metadata usage + alert-style toast behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Codex <noreply@openai.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
Summary
Test plan