Skip to content

Refresh open files from disk#34

Merged
GordonBeeming merged 2 commits into
mainfrom
gb/open-file-disk-sync
Jun 24, 2026
Merged

Refresh open files from disk#34
GordonBeeming merged 2 commits into
mainfrom
gb/open-file-disk-sync

Conversation

@GordonBeeming

Copy link
Copy Markdown
Owner

Summary

  • Reload clean open tabs when their backing files change on disk.
  • Prompt before reloading dirty tabs when the disk version changed.
  • Keep disk checks lightweight by statting open files before reading contents.

Test plan

  • npm test -- src/App.test.tsx
  • ./run-tests.sh

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: GitButler <gitbutler@gitbutler.com>
@GordonBeeming GordonBeeming marked this pull request as ready for review June 24, 2026 08:50
Copilot AI review requested due to automatic review settings June 24, 2026 08:50

@gemini-code-assist gemini-code-assist Bot 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.

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.

Comment thread src/App.tsx

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.

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.

Comment thread src/App.tsx
Comment thread src/App.tsx
Comment thread src/App.test.tsx

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread src/App.tsx Outdated
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>
@GordonBeeming GordonBeeming merged commit 26d82ed into main Jun 24, 2026
2 of 4 checks passed
@GordonBeeming GordonBeeming deleted the gb/open-file-disk-sync branch June 24, 2026 12:07
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