| ... | @@ -31,6 +31,7 @@ interface FileBrowserPanelProps { | ... | @@ -31,6 +31,7 @@ interface FileBrowserPanelProps { |
| 31 | /** Bumped when the same path should be revealed again (e.g. re-opened from search). */ | 31 | /** Bumped when the same path should be revealed again (e.g. re-opened from search). */ |
| 32 | selectedPathRevealId: number; | 32 | selectedPathRevealId: number; |
| 33 | onOpenFile: (relativePath: string) => void; | 33 | onOpenFile: (relativePath: string) => void; |
| | 34 | onRefreshSelectedFile?: () => void; |
| 34 | } | 35 | } |
| 35 | | 36 | |
| 36 | const TREE_UNSAFE_CSS = ` | 37 | const TREE_UNSAFE_CSS = ` |
| ... | @@ -105,6 +106,7 @@ export default function FileBrowserPanel({ | ... | @@ -105,6 +106,7 @@ export default function FileBrowserPanel({ |
| 105 | selectedPath, | 106 | selectedPath, |
| 106 | selectedPathRevealId, | 107 | selectedPathRevealId, |
| 107 | onOpenFile, | 108 | onOpenFile, |
| | 109 | onRefreshSelectedFile, |
| 108 | }: FileBrowserPanelProps) { | 110 | }: FileBrowserPanelProps) { |
| 109 | const { resolvedTheme } = useTheme(); | 111 | const { resolvedTheme } = useTheme(); |
| 110 | const composerRef = useComposerHandleContext(); | 112 | const composerRef = useComposerHandleContext(); |
| ... | @@ -254,6 +256,10 @@ export default function FileBrowserPanel({ | ... | @@ -254,6 +256,10 @@ export default function FileBrowserPanel({ |
| 254 | } | 256 | } |
| 255 | search.setValue(value); | 257 | search.setValue(value); |
| 256 | }; | 258 | }; |
| | 259 | const handleRefresh = () => { |
| | 260 | entriesQuery.refresh(); |
| | 261 | onRefreshSelectedFile?.(); |
| | 262 | }; |
| 257 | | 263 | |
| 258 | useEffect(() => { | 264 | useEffect(() => { |
| 259 | if (previousTreePathsRef.current === treePaths) return; | 265 | if (previousTreePathsRef.current === treePaths) return; |
| ... | @@ -354,7 +360,7 @@ export default function FileBrowserPanel({ | ... | @@ -354,7 +360,7 @@ export default function FileBrowserPanel({ |
| 354 | 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" | 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" |
| 355 | data-surface-subheader | 361 | data-surface-subheader |
| 356 | > | 362 | > |
| 357 | <RefreshFilesButton isPending={entriesQuery.isPending} onRefresh={entriesQuery.refresh} /> | 363 | <RefreshFilesButton isPending={entriesQuery.isPending} onRefresh={handleRefresh} /> |
| 358 | <FileSearchField | 364 | <FileSearchField |
| 359 | name="project-files-search" | 365 | name="project-files-search" |
| 360 | ariaLabel={`Search ${projectName} files`} | 366 | ariaLabel={`Search ${projectName} files`} |