Auto-refresh the active tab's panels (silent, non-disturbing)

Local panels are fs.watched (LocalDirWatcher + setWatchedDirs -> pathRefresh);
remote panels poll every 3s. New refresh({silent}) skips the loading/busy
flags and touches no DOM, snapshotting sessionId+cwd to discard results if the
user navigated mid-flight. Only the active tab is live; switching tabs
refreshes the new pair. A future on/off setting is left as commented
breadcrumbs. Docs updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 14:03:35 +02:00
co-authored by Claude Fable 5
parent 260e2d64b2
commit ee5a9e13e6
10 changed files with 206 additions and 15 deletions
+3
View File
@@ -44,6 +44,9 @@ export type AppRPC = {
params: { sessionId: string; path: string | null }; // null -> home dir
response: Result<{ path: string; entries: FileEntry[] }>;
};
// Local dirs to fs.watch for auto-refresh (the active tab's local panels);
// a change pushes pathRefresh. Remote panels are polled UI-side instead.
setWatchedDirs: { params: { dirs: string[] }; response: Result };
mkdir: { params: { sessionId: string; path: string }; response: Result };
createFile: { params: { sessionId: string; path: string }; response: Result };
rename: {
+5
View File
@@ -95,6 +95,10 @@ export interface AppSettings {
editor: "builtin" | "custom";
/** Full path to the external editor .app; empty = OS default application. */
editorApp: string;
// Auto-refresh the active tab's panels (local watched, remote polled). Always
// on for now; uncomment (+ the settings.service and tab-bar breadcrumbs, and
// gate the poll/watch in panels.service) to expose a toggle later.
// autoRefresh: boolean;
}
export const DEFAULT_SETTINGS: AppSettings = {
@@ -110,6 +114,7 @@ export const DEFAULT_SETTINGS: AppSettings = {
autoClearCompleted: true,
editor: "builtin",
editorApp: "",
// autoRefresh: true,
};
export function effectiveConcurrency(settings: AppSettings): number {