You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add loading-state close actions for chat file previews and full-screen file editor loading
abort in-flight file content requests when the preview is closed or unmounted
lazy-load the chat preview editor and show a suspense fallback while it initializes
Testing
npm run typecheck
npm run build
Notes
Vite build still reports that CodeEditor remains statically imported elsewhere, so the dynamic import in chat does not currently split it into a separate chunk.
This change makes the first file-open path slower, not faster. ChatInterface now lazy-loads CodeEditor, but the actual file read still starts from CodeEditor's useEffect after that module mounts. That turns the flow into: click file -> wait for editor module -> start readFile/getFileContentBlob. For the reported issue (opening files from chat is very slow), this is a regression in the critical path rather than an improvement.
The new close button only cancels in-flight file reads after CodeEditor has already loaded. The Suspense fallback can hide the preview UI, but it cannot cancel the lazy module load itself. So if the visible delay is dominated by editor initialization, this PR still does not let the user close the real loading work; it only closes the shell around it.
Build output also shows Vite warning that CodeEditor is still statically imported elsewhere, so the dynamic import here does not currently split it into a separate chunk. That makes the performance benefit even less likely.
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
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.
Summary
Testing
Notes
CodeEditorremains statically imported elsewhere, so the dynamic import in chat does not currently split it into a separate chunk.