diff --git a/apps/server/src/wsServer.ts b/apps/server/src/wsServer.ts index 0c074b734..2b2a26880 100644 --- a/apps/server/src/wsServer.ts +++ b/apps/server/src/wsServer.ts @@ -54,7 +54,11 @@ import { pickFolderNative } from "./nativeFolderPicker.ts"; import { GitManager } from "./git/Services/GitManager.ts"; import { TerminalManager } from "./terminal/Services/Manager.ts"; import { Keybindings } from "./keybindings"; -import { clearWorkspaceIndexCache, listWorkspaceDirectory, searchWorkspaceEntries } from "./workspaceEntries"; +import { + clearWorkspaceIndexCache, + listWorkspaceDirectory, + searchWorkspaceEntries, +} from "./workspaceEntries"; import { OrchestrationEngineService } from "./orchestration/Services/OrchestrationEngine"; import { ProjectionSnapshotQuery } from "./orchestration/Services/ProjectionSnapshotQuery"; import { OrchestrationReactor } from "./orchestration/Services/OrchestrationReactor"; @@ -853,28 +857,22 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return< let fileTreeDebounceTimer: ReturnType | null = null; - const fileTreeWatcher = fs.watch( - cwd, - { recursive: true }, - (_eventType, filename) => { - if (!filename) return; - - // Ignore changes inside noisy directories - const normalized = String(filename).replaceAll("\\", "/"); - const firstSegment = normalized.split("/")[0]; - if (firstSegment && IGNORED_WATCHER_DIRS.has(firstSegment)) return; - - // Debounce rapid consecutive changes into a single push - if (fileTreeDebounceTimer) clearTimeout(fileTreeDebounceTimer); - fileTreeDebounceTimer = setTimeout(() => { - fileTreeDebounceTimer = null; - clearWorkspaceIndexCache(cwd); - void Effect.runPromise( - pushBus.publishAll(WS_CHANNELS.projectFileTreeChanged, { cwd }), - ); - }, FILE_TREE_DEBOUNCE_MS); - }, - ); + const fileTreeWatcher = fs.watch(cwd, { recursive: true }, (_eventType, filename) => { + if (!filename) return; + + // Ignore changes inside noisy directories + const normalized = String(filename).replaceAll("\\", "/"); + const firstSegment = normalized.split("/")[0]; + if (firstSegment && IGNORED_WATCHER_DIRS.has(firstSegment)) return; + + // Debounce rapid consecutive changes into a single push + if (fileTreeDebounceTimer) clearTimeout(fileTreeDebounceTimer); + fileTreeDebounceTimer = setTimeout(() => { + fileTreeDebounceTimer = null; + clearWorkspaceIndexCache(cwd); + void Effect.runPromise(pushBus.publishAll(WS_CHANNELS.projectFileTreeChanged, { cwd })); + }, FILE_TREE_DEBOUNCE_MS); + }); yield* Effect.addFinalizer(() => Effect.sync(() => { diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index dcd8a5d8d..bc997220d 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -5169,10 +5169,7 @@ export default function ChatView({ threadId }: ChatViewProps) { > {pendingUserInputs.length === 0 && ( <> - + - - {expiresIn !== null ? ( -

- {expiresIn > 0 ? <>Expires in {formatTime(expiresIn)} : <>Refreshing...} -

- ) : null} +

+ Copy the pairing link and paste it into the mobile app. +

) : loading ? ( -
-

Generating...

-
+

Generating pairing link...

) : null} ); diff --git a/apps/web/src/wsNativeApi.ts b/apps/web/src/wsNativeApi.ts index b9edb2e5b..30fd34301 100644 --- a/apps/web/src/wsNativeApi.ts +++ b/apps/web/src/wsNativeApi.ts @@ -25,9 +25,7 @@ const prReviewSyncUpdatedListeners = new Set<(payload: PrReviewSyncUpdatedPayloa const prReviewRepoConfigUpdatedListeners = new Set< (payload: PrReviewRepoConfigUpdatedPayload) => void >(); -const projectFileTreeChangedListeners = new Set< - (payload: ProjectFileTreeChangedPayload) => void ->(); +const projectFileTreeChangedListeners = new Set<(payload: ProjectFileTreeChangedPayload) => void>(); const transportStateListeners = new Set<(state: TransportState) => void>(); /** diff --git a/packages/contracts/src/ipc.ts b/packages/contracts/src/ipc.ts index 95af215e4..3f7e1ed0e 100644 --- a/packages/contracts/src/ipc.ts +++ b/packages/contracts/src/ipc.ts @@ -316,9 +316,7 @@ export interface NativeApi { writeFile: (input: ProjectWriteFileInput) => Promise; readFile: (input: ProjectReadFileInput) => Promise; deleteEntry: (input: ProjectDeleteEntryInput) => Promise; - onFileTreeChanged: ( - callback: (payload: ProjectFileTreeChangedPayload) => void, - ) => () => void; + onFileTreeChanged: (callback: (payload: ProjectFileTreeChangedPayload) => void) => () => void; }; shell: { openInEditor: (cwd: string, editor: EditorId) => Promise;