The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 15:15 UTC
fix(web): refresh open file with the file tree (#7490)
Wout Stiens committed
Aug 19, 2026 at 20:23 UTC
4347f14b89ed66777ae16def278fd44575ab499b
2 files changed
+8
-1
apps/web/src/components/files/FileBrowserPanel.tsx
+7
-1
@@ -31,6 +31,7 @@ interface FileBrowserPanelProps {
31
/** Bumped when the same path should be revealed again (e.g. re-opened from search). */
32
selectedPathRevealId: number;
33
onOpenFile: (relativePath: string) => void;
34
+ onRefreshSelectedFile?: () => void;
35
}
36
37
const TREE_UNSAFE_CSS = `
@@ -105,6 +106,7 @@ export default function FileBrowserPanel({
106
selectedPath,
107
selectedPathRevealId,
108
onOpenFile,
109
+ onRefreshSelectedFile,
110
}: FileBrowserPanelProps) {
111
const { resolvedTheme } = useTheme();
112
const composerRef = useComposerHandleContext();
@@ -254,6 +256,10 @@ export default function FileBrowserPanel({
256
}
257
search.setValue(value);
258
};
259
+ const handleRefresh = () => {
260
+ entriesQuery.refresh();
261
+ onRefreshSelectedFile?.();
262
+ };
263
264
useEffect(() => {
265
if (previousTreePathsRef.current === treePaths) return;
@@ -354,7 +360,7 @@ export default function FileBrowserPanel({
360
className="flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent"
361
data-surface-subheader
362
>
357
- <RefreshFilesButton isPending={entriesQuery.isPending} onRefresh={entriesQuery.refresh} />
363
+ <RefreshFilesButton isPending={entriesQuery.isPending} onRefresh={handleRefresh} />
364
<FileSearchField
365
name="project-files-search"
366
ariaLabel={`Search ${projectName} files`}
apps/web/src/components/files/FilePreviewPanel.tsx
+1
@@ -1080,6 +1080,7 @@ export default function FilePreviewPanel({
1080
selectedPath={relativePath}
1081
selectedPathRevealId={revealRequestId}
1082
onOpenFile={onOpenFile}
1083
+ {...(relativePath && !isImage ? { onRefreshSelectedFile: file.refresh } : {})}
1084
/>
1085
</aside>
1086
) : null}