From 0d73007c3f1c7fd37f4610c76fd95ea54f5f4f39 Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Wed, 11 Feb 2026 22:46:22 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BB=E3=83=83=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=8C=E8=A6=8B=E3=81=A4=E3=81=8B=E3=82=89=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AB=20info=20=E3=83=A1=E3=83=83?= =?UTF-8?q?=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/__tests__/sessionSelector.test.ts | 8 ++++++++ src/features/interactive/sessionSelector.ts | 2 ++ src/shared/i18n/labels_en.yaml | 1 + src/shared/i18n/labels_ja.yaml | 1 + 4 files changed, 12 insertions(+) diff --git a/src/__tests__/sessionSelector.test.ts b/src/__tests__/sessionSelector.test.ts index 9bb7941..87c3a43 100644 --- a/src/__tests__/sessionSelector.test.ts +++ b/src/__tests__/sessionSelector.test.ts @@ -19,10 +19,17 @@ vi.mock('../shared/prompt/index.js', () => ({ selectOption: (...args: [string, unknown[]]) => mockSelectOption(...args), })); +const mockInfo = vi.fn<(message: string) => void>(); + +vi.mock('../shared/ui/index.js', () => ({ + info: (...args: [string]) => mockInfo(...args), +})); + vi.mock('../shared/i18n/index.js', () => ({ getLabel: (key: string, _lang: string, params?: Record) => { if (key === 'interactive.sessionSelector.newSession') return 'New session'; if (key === 'interactive.sessionSelector.newSessionDescription') return 'Start a new conversation'; + if (key === 'interactive.sessionSelector.noSessions') return 'No sessions found'; if (key === 'interactive.sessionSelector.messages') return `${params?.count} messages`; if (key === 'interactive.sessionSelector.lastResponse') return `Last: ${params?.response}`; if (key === 'interactive.sessionSelector.prompt') return 'Select a session'; @@ -44,6 +51,7 @@ describe('selectRecentSession', () => { expect(result).toBeNull(); expect(mockSelectOption).not.toHaveBeenCalled(); + expect(mockInfo).toHaveBeenCalledWith('No sessions found'); }); it('should return null when user selects __new__', async () => { diff --git a/src/features/interactive/sessionSelector.ts b/src/features/interactive/sessionSelector.ts index c7fd611..f353a70 100644 --- a/src/features/interactive/sessionSelector.ts +++ b/src/features/interactive/sessionSelector.ts @@ -8,6 +8,7 @@ import { loadSessionIndex, extractLastAssistantResponse } from '../../infra/claude/session-reader.js'; import { selectOption, type SelectOptionItem } from '../../shared/prompt/index.js'; import { getLabel } from '../../shared/i18n/index.js'; +import { info } from '../../shared/ui/index.js'; /** Maximum number of sessions to display */ const MAX_DISPLAY_SESSIONS = 10; @@ -53,6 +54,7 @@ export async function selectRecentSession( const sessions = loadSessionIndex(cwd); if (sessions.length === 0) { + info(getLabel('interactive.sessionSelector.noSessions', lang)); return null; } diff --git a/src/shared/i18n/labels_en.yaml b/src/shared/i18n/labels_en.yaml index 5826eb6..c5fea74 100644 --- a/src/shared/i18n/labels_en.yaml +++ b/src/shared/i18n/labels_en.yaml @@ -40,6 +40,7 @@ interactive: prompt: "Resume from a recent session?" newSession: "New session" newSessionDescription: "Start a fresh conversation" + noSessions: "No resumable sessions were found. Starting a new session." lastResponse: "Last: {response}" messages: "{count} messages" previousTask: diff --git a/src/shared/i18n/labels_ja.yaml b/src/shared/i18n/labels_ja.yaml index 8239e7d..bbd4e38 100644 --- a/src/shared/i18n/labels_ja.yaml +++ b/src/shared/i18n/labels_ja.yaml @@ -40,6 +40,7 @@ interactive: prompt: "直近のセッションを引き継ぎますか?" newSession: "新しいセッション" newSessionDescription: "新しい会話を始める" + noSessions: "引き継げるセッションが見つかりませんでした。新しいセッションで開始します。" lastResponse: "最後: {response}" messages: "{count}メッセージ" previousTask: