The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(desktop): stop reveal-focus test importing the whole app in a hook
teknium1e8acdc5fc899
diff --git a/apps/desktop/src/app/contrib/controller.tsx b/apps/desktop/src/app/contrib/controller.tsxindex 72b55229c18..dcea6430496 100644--- a/apps/desktop/src/app/contrib/controller.tsx+++ b/apps/desktop/src/app/contrib/controller.tsx@@ -49,7 +49,6 @@ import {PanelBottom,PanelTop,SlidersHorizontal,- Terminal,Upload,Users,Zap@@ -106,7 +105,7 @@ import {import { AppContextMenu } from '../context-menu/app-context-menu'import { HudShell } from '../hud/hud-shell'import { $terminalTakeover, setTerminalTakeover } from '../right-sidebar/store'-import { toggleTerminalPane } from '../right-sidebar/terminal/reveal-focus'+import { terminalPaletteToggle } from '../right-sidebar/terminal/reveal-focus'import { $workspaceIsPage, WORKSPACE_PAGE_HEADER_AREA } from '../routes'import { BASIC_TREE, DEFAULT_TREE, registerLayoutPresets } from './layout-presets'@@ -598,22 +597,8 @@ bindToolPaneCollapse(// Without the statusbar, the rail is the only way to switch profiles or gateways.$profiles.subscribe(profiles => setModeContext({ profileCount: profiles.length }))$connectionsRegistry.subscribe(registry => setModeContext({ connectionCount: registry?.connections.length ?? 0 }))-// ⌘K door onto the same pane the keybind and statusbar pill flip — was a-// one-way "open" row under Go to, so it never showed on/off and couldn't hide.-// Reads the TREE like every other pane toggle: `$terminalTakeover` stays true-// behind a stacked sibling tab or a minimized zone, which would light the row-// "on" for a terminal that isn't on screen.-registry.register(- paletteToggle({- id: 'view.showTerminal',- label: 'Toggle terminal',- action: 'view.showTerminal',- icon: Terminal,- keywords: ['terminal', 'shell', 'console', 'pty'],- get: () => isPaneVisible('terminal'),- set: () => toggleTerminalPane()- })-)+// ⌘K door onto the same pane the keybind and statusbar pill flip.+registry.register(terminalPaletteToggle)// Logs are ⌘K-ONLY chrome: the pane contribution EXISTS only while $logsOpen// is on. Off (the default) keeps logs out of the registry and the treediff --git a/apps/desktop/src/app/right-sidebar/terminal/reveal-focus.test.ts b/apps/desktop/src/app/right-sidebar/terminal/reveal-focus.test.tsindex bacc9a7e95d..3674e267e65 100644--- a/apps/desktop/src/app/right-sidebar/terminal/reveal-focus.test.ts+++ b/apps/desktop/src/app/right-sidebar/terminal/reveal-focus.test.ts@@ -9,10 +9,20 @@ vi.mock('@/themes/context', () => ({import { PALETTE_AREA, type PaletteContribution } from '@/app/command-palette/contrib'import { useKeybinds } from '@/app/hooks/use-keybinds'-import { setTerminalTakeover } from '@/app/right-sidebar/store'+import { $terminalTakeover, setTerminalTakeover } from '@/app/right-sidebar/store'+import { terminalPaletteToggle } from '@/app/right-sidebar/terminal/reveal-focus'import { useStatusbarItems } from '@/app/shell/hooks/use-statusbar-items'-import { collapseTreePane, isPaneVisible, revealTreePane, setPaneCollapsed } from '@/components/pane-shell/tree/store'+import { group, split } from '@/components/pane-shell/tree/model'+import {+ $layoutTree,+ bindToolPaneCollapse,+ collapseTreePane,+ isPaneVisible,+ revealTreePane,+ setPaneCollapsed+} from '@/components/pane-shell/tree/store'import { registry } from '@/contrib/registry'+import { $showsAdvancedChrome } from '@/store/interface-mode'// Ctrl+`, the ⌘K row, and the statusbar pill reveal the terminal. That reveal// must make the on-screen xterm the keyboard target, and the claim has to@@ -22,8 +32,42 @@ const wrapper = ({ children }: { children: ReactNode }) => createElement(MemoryRlet unmountKeybinds: (() => void) | undefined-beforeAll(async () => {- await import('@/app/contrib/controller')+// The contrib controller owns this wiring in the app, but importing it pulls+// the whole app graph (every pane, bundled plugin, HUD) into a hook: minutes of+// cold transform under the parallel ui run, which blew the 30s hook timeout in+// CI. Wire the terminal slice here through the same production functions and+// the same palette row the controller registers.+beforeAll(() => {+ registry.registerMany([+ {+ area: 'panes',+ data: { placement: 'main', uncloseable: true },+ id: 'workspace',+ render: () => null,+ title: 'workspace'+ },+ {+ area: 'panes',+ data: { placement: 'bottom', lifecycleKeepAlive: true },+ id: 'terminal',+ render: () => null,+ title: 'terminal'+ },+ terminalPaletteToggle+ ])+ $layoutTree.set(+ split('column', [+ group(['workspace'], { active: 'workspace', id: 'grp-main' }),+ group(['terminal'], { active: 'terminal', id: 'grp-terminal' })+ ])+ )+ bindToolPaneCollapse(+ 'terminal',+ $terminalTakeover,+ () => setTerminalTakeover(false),+ () => setTerminalTakeover(true),+ $showsAdvancedChrome+ )})beforeEach(() => {diff --git a/apps/desktop/src/app/right-sidebar/terminal/reveal-focus.ts b/apps/desktop/src/app/right-sidebar/terminal/reveal-focus.tsindex 5d073fec81c..6f56e24471f 100644--- a/apps/desktop/src/app/right-sidebar/terminal/reveal-focus.ts+++ b/apps/desktop/src/app/right-sidebar/terminal/reveal-focus.ts@@ -1,4 +1,6 @@+import { paletteToggle } from '@/app/command-palette/contrib'import { isPaneVisible, togglePaneVisible } from '@/components/pane-shell/tree/store'+import { Terminal } from '@/lib/icons'import { isFocusWithin } from '@/lib/keybinds/combo'const TERMINAL_FOCUS_SCOPE = '[data-terminal]'@@ -56,3 +58,23 @@ export function toggleTerminalPane(): void {focusRevealedTerminal()}}++/**+ * ⌘K door onto the same pane the keybind and statusbar pill flip — was a+ * one-way "open" row under Go to, so it never showed on/off and couldn't hide.+ * Reads the TREE like every other pane toggle: `$terminalTakeover` stays true+ * behind a stacked sibling tab or a minimized zone, which would light the row+ * "on" for a terminal that isn't on screen.+ *+ * Lives here, not inline in the contrib controller, so the reveal-focus test+ * drives the real row without importing the whole app graph.+ */+export const terminalPaletteToggle = paletteToggle({+ id: 'view.showTerminal',+ label: 'Toggle terminal',+ action: 'view.showTerminal',+ icon: Terminal,+ keywords: ['terminal', 'shell', 'console', 'pty'],+ get: () => isPaneVisible('terminal'),+ set: () => toggleTerminalPane()+})