Refresh open files from disk#34
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 implements automatic disk state checking for open files, prompting users when a dirty file has changed on disk and updating clean files in the background or upon window refocus. Feedback on the changes highlights a potential race condition in the asynchronous checkOpenFileDiskState function, where relying on a stale file reference after statFile resolves could cause incorrect behavior if the file was closed or modified in the meantime; re-querying the latest state from openFilesRef.current is recommended.
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.
Pull request overview
Adds automatic detection of on-disk changes for currently open editor tabs, reloading clean tabs and prompting users before discarding dirty edits when the disk version changes.
Changes:
- Introduces periodic + focus/visibility-triggered disk stat checks for open tabs, with auto-reload for clean tabs.
- Adds a richer “pending reload” state to distinguish manual vs external-disk-change reload prompts.
- Extends App shell tests to cover refocus reloads, external-change prompts, and background updates.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/App.tsx |
Adds disk-change polling/focus checks and reload/prompt flows for open tabs. |
src/App.test.tsx |
Adds tests for reloading/updating open tabs when disk metadata changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32dc032fa7
ℹ️ 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".
Address reviewer comments: - Re-read latest open tab state before prompting or clean reloads - Ignore disk polling while the same file is being saved - Make the background disk update test timer-controlled Co-authored-by: Codex <noreply@openai.com>
Summary
Test plan