diff --git a/src/main/desktop-shell-menu.ts b/src/main/desktop-shell-menu.ts index 67c6622f..85f8aa64 100644 --- a/src/main/desktop-shell-menu.ts +++ b/src/main/desktop-shell-menu.ts @@ -18,7 +18,7 @@ export interface DesktopShellMenuDependencies { isDev: boolean; onCheckForUpdates: () => Promise; onBackupProfile: () => Promise; - onShortcut: (action: "toggle-command-palette" | "toggle-console" | "refresh") => void; + onShortcut: (action: "toggle-command-palette" | "refresh") => void; getMainWindow: () => BrowserWindow | null; ensureWindow: () => Promise; requestQuitWithConfirmation: () => Promise; @@ -117,11 +117,6 @@ export function createDesktopShellMenu(deps: DesktopShellMenuDependencies) { accelerator: "CmdOrCtrl+K", click: () => onShortcut("toggle-command-palette"), }, - { - label: "Toggle Console", - accelerator: "CmdOrCtrl+`", - click: () => onShortcut("toggle-console"), - }, { label: "Refresh Data", accelerator: "CmdOrCtrl+R", diff --git a/src/main/desktop-shell-window.ts b/src/main/desktop-shell-window.ts index 0647c480..4dde0bb6 100644 --- a/src/main/desktop-shell-window.ts +++ b/src/main/desktop-shell-window.ts @@ -27,7 +27,7 @@ export interface DesktopShellWindowDependencies { onRequestQuit: () => void; onCheckForUpdates: () => Promise; onBackupProfile: () => Promise; - onShortcut: (action: "toggle-command-palette" | "toggle-console" | "refresh") => void; + onShortcut: (action: "toggle-command-palette" | "refresh") => void; notify: (options: NotificationOptions) => void; getActiveRunCount: () => number; } diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 13e8303f..63912924 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -1,5 +1,5 @@ import { useCallback, useMemo, type ReactNode } from "react"; -import { CircleNotch, TerminalWindow } from "./components/ui/icons"; +import { CircleNotch } from "./components/ui/icons"; import { LocaleContext, TranslationContext, type TranslationFn } from "./i18n"; import type { AppLocale } from "@shared/locale"; import { CompanyOnboarding } from "./components/company-onboarding/OnboardingWizard"; @@ -7,7 +7,6 @@ import TitleBar from "./components/TitleBar"; import ToastContainer from "./components/Toast"; import { SidebarView } from "./views/SidebarView"; import { SectionContentView } from "./views/SectionContentView"; -import { ConsoleView } from "./views/ConsoleView"; import { CommandPaletteView } from "./views/CommandPaletteView"; import { useAppStore } from "./state/store"; import { useUIController } from "./hooks/useUIController"; @@ -49,7 +48,6 @@ export function App() { const error = useAppStore((s) => s.error); const setError = useAppStore((s) => s.setError); const setSelectedRunId = useAppStore((s) => s.setSelectedRunId); - const setConsoleOpen = useAppStore((s) => s.setConsoleOpen); const navigateTo = useAppStore((s) => s.navigateTo); const showCustomTitleBar = window.agentCompany.platform !== "darwin"; @@ -60,7 +58,6 @@ export function App() { const result = await window.agentCompany.startTaskRun({ companyId: company.currentCompany.id, taskId }); if (!result.ok) { setError(result.error.message); return; } setSelectedRunId(result.data); - setConsoleOpen(true); await company.refresh(); // eslint-disable-next-line react-hooks/exhaustive-deps -- Zustand setters and company.refresh are stable }, [company.currentCompany, company.refresh]); @@ -189,18 +186,6 @@ export function App() {

{ui.navItems.find((item) => item.id === ui.section)?.label ?? ui.t(`nav.${ui.section}`)}

-
- -
@@ -209,18 +194,6 @@ export function App() { error={error} pageTransition={ui.pageTransition} /> - - void; onCancelRun: (runId: string) => Promise | void; onOpenLogPath: (path: string) => Promise | void; - onOpenConsole: (runId: string) => void; } export function RunCenter({ @@ -27,7 +26,6 @@ export function RunCenter({ onSelectRun, onCancelRun, onOpenLogPath, - onOpenConsole, }: RunCenterProps) { const t = useT(); const [statusFilter, setStatusFilter] = useState<"all" | RunRecord["status"]>("all"); @@ -109,7 +107,6 @@ export function RunCenter({ agentMap={agentMap} workspaceMap={workspaceMap} logState={logState} - onOpenConsole={onOpenConsole} onCancelRun={onCancelRun} onOpenLogPath={onOpenLogPath} onReloadLog={reloadLogs} diff --git a/src/renderer/components/runs/RunDetail.tsx b/src/renderer/components/runs/RunDetail.tsx index 4268a577..f0942c60 100644 --- a/src/renderer/components/runs/RunDetail.tsx +++ b/src/renderer/components/runs/RunDetail.tsx @@ -1,7 +1,6 @@ import { ArrowClockwise, FolderOpen, - Lightning, ListChecks, WarningCircle, } from "../ui/icons"; @@ -18,7 +17,6 @@ interface RunDetailProps { agentMap: Map; workspaceMap: Map; logState: RunLogState; - onOpenConsole: (runId: string) => void; onCancelRun: (runId: string) => Promise | void; onOpenLogPath: (path: string) => Promise | void; onReloadLog: () => void; @@ -40,7 +38,6 @@ export function RunDetail({ taskMap, agentMap, logState, - onOpenConsole, onCancelRun, onOpenLogPath, onReloadLog, @@ -54,23 +51,16 @@ export function RunDetail({
+ action={ + isActiveStatus(selectedRun.status) ? ( onOpenConsole(selectedRun.id)} + label={t("runs.cancelRun")} + tone="danger" + icon={WarningCircle} + onClick={() => void onCancelRun(selectedRun.id)} /> - {isActiveStatus(selectedRun.status) ? ( - void onCancelRun(selectedRun.id)} - /> - ) : null} -
- )} + ) : undefined + } >
diff --git a/src/renderer/hooks/useDesktopEvents.ts b/src/renderer/hooks/useDesktopEvents.ts index 0f3eb8fc..2ef2fb18 100644 --- a/src/renderer/hooks/useDesktopEvents.ts +++ b/src/renderer/hooks/useDesktopEvents.ts @@ -141,7 +141,6 @@ export function useDesktopEvents( } if (event.type === "shortcut") { if (event.action === "toggle-command-palette") store.getState().toggleCommandPalette(); - if (event.action === "toggle-console") store.getState().toggleConsole(); if (event.action === "refresh") void refreshRef.current(); return; } diff --git a/src/renderer/hooks/useUIController.ts b/src/renderer/hooks/useUIController.ts index efcd4a33..391d9a24 100644 --- a/src/renderer/hooks/useUIController.ts +++ b/src/renderer/hooks/useUIController.ts @@ -79,7 +79,6 @@ export function useUIController() { const { section, - consoleOpen, sidebarCollapsed, companySwitcherOpen, confirmDeleteCompanyId, @@ -92,7 +91,6 @@ export function useUIController() { } = useAppStore( useShallow((s) => ({ section: s.section, - consoleOpen: s.consoleOpen, sidebarCollapsed: s.sidebarCollapsed, companySwitcherOpen: s.companySwitcherOpen, confirmDeleteCompanyId: s.confirmDeleteCompanyId, @@ -106,7 +104,6 @@ export function useUIController() { ); const { setSection, - setConsoleOpen, setSidebarCollapsed, setCompanySwitcherOpen, setConfirmDeleteCompanyId, @@ -189,8 +186,6 @@ export function useUIController() { navItems, section, setSection, - consoleOpen, - setConsoleOpen, sidebarCollapsed, setSidebarCollapsed, companySwitcherOpen, @@ -225,8 +220,6 @@ export function useUIController() { navItems, section, setSection, - consoleOpen, - setConsoleOpen, sidebarCollapsed, setSidebarCollapsed, companySwitcherOpen, diff --git a/src/renderer/i18n/en.ts b/src/renderer/i18n/en.ts index 20cf5bbd..c8a916c9 100644 --- a/src/renderer/i18n/en.ts +++ b/src/renderer/i18n/en.ts @@ -41,8 +41,6 @@ export const en: Record = { "app.commandPalette": "Command palette", "app.refresh": "Refresh", "app.console": "Console", - "app.hideConsole": "Hide console", - "app.showConsole": "Show console", "app.collapse": "Collapse", "app.expand": "Expand", "app.noResults": "No results for", @@ -296,9 +294,6 @@ export const en: Record = { "common.started": "Started", "common.finished": "Finished", "common.cost": "Cost", - "common.openLog": "Open log", - "common.noRunSelected": "No run selected", - "common.waitingForLog": "Waiting for log output...", "common.sections": "Sections", "common.agents": "Agents", "common.tasks": "Tasks", @@ -307,9 +302,6 @@ export const en: Record = { "common.projects": "Projects", // ── Console panel ── - "console.title": "Console", - "console.noRuns": "No runs", - "console.close": "Close console", // ── Entity labels (command palette sections) ── "entity.sections": "Sections", @@ -795,7 +787,6 @@ export const en: Record = { "runs.noRunsMatch": "No runs match this filter", "runs.noRunsMatchDetail": "Try another filter.", "runs.runDetail": "Run detail", - "runs.openConsole": "Open console", "runs.cancelRun": "Cancel run", "runs.noSummary": "No summary yet", "runs.unknownAgent": "Unknown agent", diff --git a/src/renderer/i18n/zh.ts b/src/renderer/i18n/zh.ts index 6ad31bf3..4cda27ef 100644 --- a/src/renderer/i18n/zh.ts +++ b/src/renderer/i18n/zh.ts @@ -41,8 +41,6 @@ export const zh: Record = { "app.commandPalette": "命令面板", "app.refresh": "刷新", "app.console": "控制台", - "app.hideConsole": "隐藏控制台", - "app.showConsole": "显示控制台", "app.collapse": "收起", "app.expand": "展开", "app.noResults": "未找到匹配结果", @@ -296,9 +294,6 @@ export const zh: Record = { "common.started": "开始时间", "common.finished": "结束时间", "common.cost": "费用", - "common.openLog": "打开日志", - "common.noRunSelected": "未选择运行", - "common.waitingForLog": "等待日志输出...", "common.sections": "版块", "common.agents": "智能体", "common.tasks": "任务", @@ -307,9 +302,6 @@ export const zh: Record = { "common.projects": "项目", // ── 控制台面板 ── - "console.title": "控制台", - "console.noRuns": "暂无运行", - "console.close": "关闭控制台", // ── 实体标签(命令面板分类) ── "entity.sections": "版块", @@ -795,7 +787,6 @@ export const zh: Record = { "runs.noRunsMatch": "没有匹配此筛选条件的运行", "runs.noRunsMatchDetail": "换个筛选试试。", "runs.runDetail": "运行详情", - "runs.openConsole": "打开控制台", "runs.cancelRun": "取消运行", "runs.noSummary": "暂无摘要", "runs.unknownAgent": "未知智能体", diff --git a/src/renderer/state/slices/navigation.ts b/src/renderer/state/slices/navigation.ts index b5c16352..48c489aa 100644 --- a/src/renderer/state/slices/navigation.ts +++ b/src/renderer/state/slices/navigation.ts @@ -7,7 +7,6 @@ export interface NavigationSlice { commandPaletteOpen: boolean; commandPaletteSearch: string; selectedPaletteIndex: number; - consoleOpen: boolean; sidebarCollapsed: boolean; companySwitcherOpen: boolean; setSection: (section: SectionId) => void; @@ -15,8 +14,6 @@ export interface NavigationSlice { toggleCommandPalette: () => void; setCommandPaletteSearch: (search: string) => void; setSelectedPaletteIndex: (index: number) => void; - setConsoleOpen: (open: boolean) => void; - toggleConsole: () => void; setSidebarCollapsed: (collapsed: boolean) => void; toggleSidebar: () => void; setCompanySwitcherOpen: (open: boolean) => void; @@ -34,7 +31,6 @@ export const createNavigationSlice: StateCreator< commandPaletteOpen: false, commandPaletteSearch: "", selectedPaletteIndex: 0, - consoleOpen: false, sidebarCollapsed: false, companySwitcherOpen: false, setSection: (section) => @@ -66,14 +62,6 @@ export const createNavigationSlice: StateCreator< set((state) => { state.selectedPaletteIndex = index; }), - setConsoleOpen: (open) => - set((state) => { - state.consoleOpen = open; - }), - toggleConsole: () => - set((state) => { - state.consoleOpen = !state.consoleOpen; - }), setSidebarCollapsed: (collapsed) => set((state) => { state.sidebarCollapsed = collapsed; @@ -98,7 +86,6 @@ export const createNavigationSlice: StateCreator< else if (section === "approvals") state.selectedApprovalId = entityId; else if (section === "runs") { state.selectedRunId = entityId; - state.consoleOpen = true; } else if (section === "goals") state.selectedGoalId = entityId; else if (section === "projects") state.selectedProjectId = entityId; else if (section === "connectors") state.selectedConnectorId = entityId; @@ -116,7 +103,6 @@ export const createNavigationSlice: StateCreator< if (matchingRun) { state.selectedRunId = matchingRun.id; state.selectedTaskId = matchingRun.taskId; - state.consoleOpen = true; return; } state.selectedTaskId = entityId; diff --git a/src/renderer/views/ConsoleView.tsx b/src/renderer/views/ConsoleView.tsx deleted file mode 100644 index 6809f468..00000000 --- a/src/renderer/views/ConsoleView.tsx +++ /dev/null @@ -1,128 +0,0 @@ -import { useMemo } from "react"; -import { AnimatePresence, motion } from "framer-motion"; -import { FolderOpen, TerminalWindow, X } from "../components/ui/icons"; -import type { RunRecord } from "@shared/types"; -import { ActionButton, Select, StatusPill } from "../components/ui"; -import { formatMoney, formatTime } from "../lib/formatters"; -import { useAppStore } from "../state/store"; - -// Run summaries that indicate the run is no longer active; these entries -// should not appear in the console run selector. -const SHUTDOWN_SUMMARY = "Application shut down."; -const WORKER_CRASH_SUMMARY = "Worker process crashed."; - -interface ConsoleViewProps { - consoleOpen: boolean; - setConsoleOpen: (value: boolean) => void; - selectedRun: RunRecord | null; - setSelectedRunId: (id: string | null) => void; - runs: RunRecord[]; - logBufferRef: React.RefObject>; - openPathWithFeedback: (path: string) => Promise; - panelTransition: { duration: number; ease?: readonly [number, number, number, number] } | { duration: number }; - t: (key: string) => string; -} - -export function ConsoleView({ - consoleOpen, - setConsoleOpen, - selectedRun, - setSelectedRunId, - runs, - logBufferRef, - openPathWithFeedback, - panelTransition, - t, -}: ConsoleViewProps) { - const logRevision = useAppStore((s) => s.logRevision); - const logBuffer = useMemo( - () => (selectedRun ? logBufferRef.current[selectedRun.id] ?? "" : ""), - // logRevision is intentionally part of deps: it bumps on every run-log - // push into the ref, forcing this memo (and this component) to re-evaluate - // the ref contents on re-render. - // eslint-disable-next-line react-hooks/exhaustive-deps - [selectedRun, logRevision, logBufferRef], - ); - const runSelectOptions = useMemo(() => { - const activeRuns = runs.filter( - (run) => run.summary !== SHUTDOWN_SUMMARY && run.summary !== WORKER_CRASH_SUMMARY, - ); - return activeRuns.length > 0 - ? activeRuns.map((run) => ({ value: run.id, label: run.summary || `Run ${run.id.slice(0, 8)}` })) - : [{ value: "", label: t("console.noRuns") }]; - }, [runs, t]); - return ( - - {consoleOpen ? ( - -
-
- - {t("console.title")} -
-
-