diff --git a/src/components/conversations/search-command-dialog.tsx b/src/components/conversations/search-command-dialog.tsx index 8caa601..e3a01e5 100644 --- a/src/components/conversations/search-command-dialog.tsx +++ b/src/components/conversations/search-command-dialog.tsx @@ -142,7 +142,8 @@ export function SearchCommandDialog({ entry.relativePath ) const lastSlash = entry.relativePath.lastIndexOf("/") - const dir = lastSlash === -1 ? "" : entry.relativePath.slice(0, lastSlash) + const dir = + lastSlash === -1 ? "" : entry.relativePath.slice(0, lastSlash) matchers.push({ prefix: dir ? dir + "/" : "", matcher: ig().add(result.content), @@ -168,8 +169,7 @@ export function SearchCommandDialog({ if (!f.relativePath.startsWith(prefix)) continue const relPath = f.relativePath.slice(prefix.length) if (!relPath) continue - const testPath = - f.kind === "dir" ? `${relPath}/` : relPath + const testPath = f.kind === "dir" ? `${relPath}/` : relPath if (matcher.ignores(testPath)) { if (f.kind === "dir") ignoredDirs.add(f.relativePath) return false @@ -284,9 +284,7 @@ export function SearchCommandDialog({ ) const placeholder = - activeTab === "conversations" - ? t("placeholder") - : t("filePlaceholder") + activeTab === "conversations" ? t("placeholder") : t("filePlaceholder") return ( @@ -430,13 +427,11 @@ export function SearchCommandDialog({ onSelect={() => handleSelectFile(entry)} > {entry.kind === "dir" ? ( - + ) : ( )} - - {entry.name} - + {entry.name} {entry.relativePath} diff --git a/src/components/layout/aux-panel-file-tree-tab.tsx b/src/components/layout/aux-panel-file-tree-tab.tsx index 3f94295..09de0f0 100644 --- a/src/components/layout/aux-panel-file-tree-tab.tsx +++ b/src/components/layout/aux-panel-file-tree-tab.tsx @@ -2321,7 +2321,9 @@ export function FileTreeTab() { { e.preventDefault() - const input = (e.currentTarget as HTMLElement | null)?.querySelector("input") + const input = ( + e.currentTarget as HTMLElement | null + )?.querySelector("input") if (input) requestAnimationFrame(() => input.focus()) }} > @@ -2388,7 +2390,9 @@ export function FileTreeTab() { { e.preventDefault() - const input = (e.currentTarget as HTMLElement | null)?.querySelector("input") + const input = ( + e.currentTarget as HTMLElement | null + )?.querySelector("input") if (input) requestAnimationFrame(() => input.focus()) }} > diff --git a/src/components/layout/aux-panel.tsx b/src/components/layout/aux-panel.tsx index 7858410..35c5d5c 100644 --- a/src/components/layout/aux-panel.tsx +++ b/src/components/layout/aux-panel.tsx @@ -26,13 +26,15 @@ export function AuxPanel() { activeTab === "git_log" ) - // Sync mount flags when activeTab changes programmatically (e.g. revealInFileTree) + // Sync mount flags when activeTab changes programmatically (e.g. revealInFileTree). + /* eslint-disable react-hooks/set-state-in-effect */ useEffect(() => { if (!isOpen) return if (activeTab === "file_tree") setHasMountedFileTree(true) else if (activeTab === "changes") setHasMountedChanges(true) else if (activeTab === "git_log") setHasMountedGitLog(true) }, [isOpen, activeTab]) + /* eslint-enable react-hooks/set-state-in-effect */ const handleTabValueChange = useCallback( (value: string) => { diff --git a/src/components/settings/acp-agent-settings.tsx b/src/components/settings/acp-agent-settings.tsx index 4f2a54d..7a4becd 100644 --- a/src/components/settings/acp-agent-settings.tsx +++ b/src/components/settings/acp-agent-settings.tsx @@ -2040,10 +2040,7 @@ function hasComparableVersion( } function buildVersionCheck(agent: AcpAgentInfo): UiCheckItem | null { - if ( - agent.distribution_type !== "binary" && - agent.distribution_type !== "npx" - ) + if (agent.distribution_type !== "binary" && agent.distribution_type !== "npx") return null const remoteVersion = agent.registry_version ?? "unknown" @@ -2390,46 +2387,51 @@ export function AcpAgentSettings() { const runPreflight = useCallback( async (agentType: AgentType, forceRefresh?: boolean) => { - setChecking((prev) => ({ ...prev, [agentType]: true })) - try { - const [resultState, versionState] = await Promise.allSettled([ - acpPreflight(agentType, forceRefresh), - acpDetectAgentLocalVersion(agentType), - ]) + setChecking((prev) => ({ ...prev, [agentType]: true })) + try { + const [resultState, versionState] = await Promise.allSettled([ + acpPreflight(agentType, forceRefresh), + acpDetectAgentLocalVersion(agentType), + ]) - if (versionState.status === "fulfilled") { - setAgents((prev) => { - if (versionState.value === null) return prev - let changed = false - const next = prev.map((agent) => { - if (agent.agent_type !== agentType) return agent - if (agent.installed_version === versionState.value) return agent - changed = true - return { ...agent, installed_version: versionState.value } + if (versionState.status === "fulfilled") { + setAgents((prev) => { + if (versionState.value === null) return prev + let changed = false + const next = prev.map((agent) => { + if (agent.agent_type !== agentType) return agent + if (agent.installed_version === versionState.value) return agent + changed = true + return { ...agent, installed_version: versionState.value } + }) + return changed ? next : prev }) - return changed ? next : prev - }) - } + } - if (resultState.status === "fulfilled") { - setCheckState((prev) => ({ - ...prev, - [agentType]: { result: resultState.value }, - })) - } else { - const message = - resultState.reason instanceof Error - ? resultState.reason.message - : String(resultState.reason) + if (resultState.status === "fulfilled") { + setCheckState((prev) => ({ + ...prev, + [agentType]: { result: resultState.value }, + })) + } else { + const message = + resultState.reason instanceof Error + ? resultState.reason.message + : String(resultState.reason) + setCheckState((prev) => ({ + ...prev, + [agentType]: { error: message }, + })) + } + } catch (err) { + const message = err instanceof Error ? err.message : String(err) setCheckState((prev) => ({ ...prev, [agentType]: { error: message } })) + } finally { + setChecking((prev) => ({ ...prev, [agentType]: false })) } - } catch (err) { - const message = err instanceof Error ? err.message : String(err) - setCheckState((prev) => ({ ...prev, [agentType]: { error: message } })) - } finally { - setChecking((prev) => ({ ...prev, [agentType]: false })) - } - }, []) + }, + [] + ) const runAllPreflight = useCallback( async (agentTypes: AgentType[]) => { @@ -2790,10 +2792,7 @@ export function AcpAgentSettings() { await runNpxAction(agent, "upgrade") return } - if ( - action.kind === "uninstall_binary" || - action.kind === "uninstall_npx" - ) { + if (action.kind === "uninstall_binary" || action.kind === "uninstall_npx") { setUninstallConfirmAgent(agent) return }