Repository navigation
Conversation
3 of 6 tasks
Contributor
Author
|
Replaced by #57915 (server-side file watches instead of polling). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #
Type of change
What does this PR do?
Files open in the right-hand sidebar now update when they change on disk, whether the agent, your editor, or git changed them.
The app already rereads open files on
filesystem.changed. But since #41096 the server only watches the VCS HEAD file, so in practice that event never fires for workspace files. This PR doesn't add a server watcher. It refreshes from the client instead:SessionFileViewrereads the visible file tab every 2s, but only while the tab is visible in its pane and the window isn't hidden. It also rereads once when the tab becomes visible. The interval is cleared when the tab is hidden or closed, the window is hidden, or the view unmounts.fs.readsendsETag/no-cache, so most of these rereads come back as 304s.session.tool.successandsession.tool.failedon the directory's event stream trigger one reread of every open file tab. A 250ms debounce collapses a burst of tool calls into a single reread. This covers background tabs, not just the shown one.loading, so the viewer keeps showing the old content (or its existing not-found message) until the new reply lands. No more "Loading…" flash. The code view already keeps its scroll position and selection when the content object changes (see the existing "rereads a file each time an artifact link opens it" e2e test).Limits:
How did you verify your code works?
bun typecheckinpackages/appandpackages/gui-extensionsbun run lint:changed origin/betasameFileContentcases topackages/app/src/workspaces/files/artifact.test.tsand ran that fileScreenshots / recordings
N/A. The content updates in place, with no other UI change.
Checklist