diff --git a/desktop/src/pages/ActiveSession.test.tsx b/desktop/src/pages/ActiveSession.test.tsx index c1ac306d..00a9a4cb 100644 --- a/desktop/src/pages/ActiveSession.test.tsx +++ b/desktop/src/pages/ActiveSession.test.tsx @@ -958,6 +958,63 @@ describe('ActiveSession task polling', () => { expect(useTabStore.getState().activeTabId).toBe(terminalTab?.sessionId) }) + it('keeps the docked terminal usable on a new empty session', () => { + const sessionId = 'empty-terminal-session' + + useSessionStore.setState({ + sessions: [{ + id: sessionId, + title: 'Empty Terminal Session', + createdAt: '2026-04-10T00:00:00.000Z', + modifiedAt: '2026-04-10T00:00:00.000Z', + messageCount: 0, + projectPath: '/tmp/project-root', + workDir: '/tmp/project-root', + workDirExists: true, + }], + activeSessionId: sessionId, + isLoading: false, + error: null, + }) + useTabStore.setState({ + tabs: [{ sessionId, title: 'Empty Terminal Session', type: 'session', status: 'idle' }], + activeTabId: sessionId, + }) + useChatStore.setState({ + sessions: { + [sessionId]: { + messages: [], + chatState: 'idle', + connectionState: 'connected', + streamingText: '', + streamingToolInput: '', + activeToolUseId: null, + activeToolName: null, + activeThinkingId: null, + pendingPermission: null, + pendingComputerUsePermission: null, + tokenUsage: { input_tokens: 0, output_tokens: 0 }, + streamingResponseChars: 0, + elapsedSeconds: 0, + statusVerb: '', + slashCommands: [], + agentTaskNotifications: {}, + elapsedTimer: null, + }, + }, + }) + useTerminalPanelStore.getState().openPanel(sessionId) + + render() + + expect(screen.getByTestId('active-session-chat-column')).toHaveClass('min-h-0') + expect(screen.getByTestId('empty-session-hero')).toHaveClass('min-h-0') + expect(screen.getByTestId('empty-session-hero')).toHaveClass('pb-6') + expect(screen.getByTestId('empty-session-hero')).not.toHaveClass('pb-32') + expect(screen.getByTestId('session-terminal-panel')).toHaveStyle({ height: '420px' }) + expect(screen.getByTestId('terminal-resize-handle')).toHaveAttribute('aria-valuemax', '760') + }) + it('keeps the docked terminal mounted when the panel is hidden', async () => { const sessionId = 'terminal-hide-session' diff --git a/desktop/src/pages/ActiveSession.tsx b/desktop/src/pages/ActiveSession.tsx index 39cd5cc5..45f63d32 100644 --- a/desktop/src/pages/ActiveSession.tsx +++ b/desktop/src/pages/ActiveSession.tsx @@ -335,6 +335,7 @@ export function ActiveSession() { const streamingText = sessionState?.streamingText ?? '' const activeGoal = sessionState?.activeGoal ?? null const isEmpty = messages.length === 0 && !streamingText && (session?.messageCount ?? 0) === 0 + const compactEmptyHero = isEmpty && showTerminalPanel const isHistoryLoading = !isMemberSession && (session?.messageCount ?? 0) > 0 && @@ -370,7 +371,7 @@ export function ActiveSession() {
{isMemberSession && (
@@ -418,11 +419,17 @@ export function ActiveSession() { )} {isEmpty ? ( -
+
{isMemberSession ? ( <> - smart_toy + smart_toy

{memberInfo?.status === 'running' ? `${memberInfo.role} ${t('teams.working')}` @@ -431,11 +438,15 @@ export function ActiveSession() { ) : ( <> - Claude Code Haha -

+ Claude Code Haha +

{t('empty.title')}

-

+

{t('empty.subtitle')}

@@ -543,7 +554,7 @@ export function ActiveSession() {