From 0f220f4af5d264293eecea2c2167b6d147e52017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Thu, 7 May 2026 17:56:33 +0800 Subject: [PATCH] fix: restore empty session launcher layout The repository launch controls should extend the existing empty-session composer, not replace the session layout. This restores the previous mascot, title, composer sizing, textarea, and run button while keeping the project, branch, and worktree controls attached directly beneath the input. Constraint: User requested the original session layout stay intact except for adding repository controls under the chat input Rejected: Keep the Codex-style centered launcher rewrite | it changed too much of the existing session surface Confidence: high Scope-risk: narrow Directive: Future changes to repository launch controls should treat EmptySession layout as fixed unless explicitly requested otherwise Tested: cd desktop && bun run test -- --run src/components/shared/DirectoryPicker.test.tsx src/pages/EmptySession.test.tsx src/__tests__/pages.test.tsx Tested: cd desktop && bun run lint Tested: bun run check:desktop Tested: agent-browser screenshot /tmp/cc-haha-layout-restored-selected.png on localhost:4790 Not-tested: root bun run verify not rerun for this narrow layout correction --- desktop/src/__tests__/pages.test.tsx | 10 +-- .../shared/RepositoryLaunchControls.tsx | 2 +- desktop/src/i18n/locales/en.ts | 4 +- desktop/src/i18n/locales/zh.ts | 4 +- desktop/src/pages/EmptySession.tsx | 66 ++++++++++--------- 5 files changed, 46 insertions(+), 40 deletions(-) diff --git a/desktop/src/__tests__/pages.test.tsx b/desktop/src/__tests__/pages.test.tsx index b6833951..24e38544 100644 --- a/desktop/src/__tests__/pages.test.tsx +++ b/desktop/src/__tests__/pages.test.tsx @@ -159,7 +159,7 @@ describe('Content-only pages render without errors', () => { expect(screen.queryByText('/internal-only')).not.toBeInTheDocument() }) - it('EmptySession renders the launch composer', async () => { + it('EmptySession renders mascot and composer', async () => { let container!: HTMLElement await act(async () => { container = render().container @@ -167,8 +167,8 @@ describe('Content-only pages render without errors', () => { await Promise.resolve() }) expect(container.querySelector('textarea')).toBeInTheDocument() - expect(container.innerHTML).toContain('What should we build?') - expect(container.innerHTML).toContain('Ask Claude anything') + expect(container.innerHTML).toContain('New session') + expect(container.innerHTML).toContain('Ask anything') }) it('EmptySession shows draft context usage before a session is created', async () => { @@ -235,11 +235,11 @@ describe('Content-only pages render without errors', () => { }) const { container } = render() // With empty messages, the hero is shown - expect(container.innerHTML).toContain('What should we build?') + expect(container.innerHTML).toContain('New session') // ChatInput has a textarea const textarea = container.querySelector('textarea') expect(textarea).toBeInTheDocument() - expect(textarea).toHaveAttribute('placeholder', 'Ask Claude anything. Type @ to mention files or tools') + expect(textarea).toHaveAttribute('placeholder', 'Ask anything...') expect(textarea).toHaveAttribute('rows', '2') expect(container.innerHTML).not.toContain('Preview') // Cleanup diff --git a/desktop/src/components/shared/RepositoryLaunchControls.tsx b/desktop/src/components/shared/RepositoryLaunchControls.tsx index 05c1c27c..524fc448 100644 --- a/desktop/src/components/shared/RepositoryLaunchControls.tsx +++ b/desktop/src/components/shared/RepositoryLaunchControls.tsx @@ -260,7 +260,7 @@ export function RepositoryLaunchControls({ return (
-
+
{loading && workDir && ( diff --git a/desktop/src/i18n/locales/en.ts b/desktop/src/i18n/locales/en.ts index 7257650a..57d030e5 100644 --- a/desktop/src/i18n/locales/en.ts +++ b/desktop/src/i18n/locales/en.ts @@ -679,9 +679,9 @@ export const en = { 'settings.general.webSearchSave': 'Save', // ─── Empty Session ────────────────────────────────────── - 'empty.title': 'What should we build?', + 'empty.title': 'New session', 'empty.subtitle': 'Start a fresh coding session. Claude is ready to help you build, debug, and architect your project.', - 'empty.placeholder': 'Ask Claude anything. Type @ to mention files or tools', + 'empty.placeholder': 'Ask anything...', 'empty.addFiles': 'Add files or photos', 'empty.slashCommands': 'Slash commands', 'empty.failedToCreate': 'Failed to create session', diff --git a/desktop/src/i18n/locales/zh.ts b/desktop/src/i18n/locales/zh.ts index e0299fab..90f03b90 100644 --- a/desktop/src/i18n/locales/zh.ts +++ b/desktop/src/i18n/locales/zh.ts @@ -681,9 +681,9 @@ export const zh: Record = { 'settings.general.webSearchSave': '保存', // ─── Empty Session ────────────────────────────────────── - 'empty.title': '我们该构建什么?', + 'empty.title': '新建会话', 'empty.subtitle': '开始一个新的编码会话。Claude 已准备好帮你构建、调试和架构你的项目。', - 'empty.placeholder': '向 Claude 询问任何事。输入 @ 使用文件或工具', + 'empty.placeholder': '随便问点什么...', 'empty.addFiles': '添加文件或图片', 'empty.slashCommands': '斜杠命令', 'empty.failedToCreate': '创建会话失败', diff --git a/desktop/src/pages/EmptySession.tsx b/desktop/src/pages/EmptySession.tsx index a41651c2..60e1f179 100644 --- a/desktop/src/pages/EmptySession.tsx +++ b/desktop/src/pages/EmptySession.tsx @@ -533,17 +533,25 @@ export function EmptySession() { return (
-
-
-

+
+
+ Claude Code Haha +

{t('empty.title')}

-
-
event.preventDefault()} - onDrop={handleDrop} - > +

+ {t('empty.subtitle')} +

+
+
+ +
+
+
event.preventDefault()} + onDrop={handleDrop} + > {fileSearchOpen && ( handleInputChange(event.target.value, event.target.selectionStart ?? event.target.value.length)} onKeyDown={handleKeyDown} onPaste={handlePaste} - className="min-h-[92px] flex-1 resize-none border-none bg-transparent py-4 text-[22px] leading-relaxed text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-tertiary)]" + className="flex-1 resize-none border-none bg-transparent py-2 leading-relaxed text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-tertiary)]" style={{ fontFamily: 'var(--font-body)' }} placeholder={t('empty.placeholder')} - rows={3} + rows={2} />
-
+
{plusMenuOpen && ( @@ -693,29 +701,27 @@ export function EmptySession() { />
-
- -
+ +