Polish the PR, minor improvements

This commit is contained in:
Alexander Farber 2025-12-13 14:35:40 +01:00
parent 7a97fcd5f1
commit 4930a24d07
No known key found for this signature in database
6 changed files with 42 additions and 28 deletions

View file

@ -10,6 +10,7 @@ import { SessionService, getGitBranch } from '@qwen-code/qwen-code-core';
import { theme } from '../semantic-colors.js';
import { useDialogSessionPicker } from '../hooks/useDialogSessionPicker.js';
import { SessionListItemView } from './SessionListItem.js';
import { t } from '../../i18n/index.js';
export interface ResumeSessionDialogProps {
cwd: string;
@ -59,10 +60,10 @@ export function ResumeSessionDialog({
padding={1}
>
<Text color={theme.text.primary} bold>
Resume Session
{t('Resume Session')}
</Text>
<Box paddingY={1}>
<Text color={theme.text.secondary}>Loading sessions...</Text>
<Text color={theme.text.secondary}>{t('Loading sessions...')}</Text>
</Box>
</Box>
);
@ -78,10 +79,13 @@ export function ResumeSessionDialog({
{/* Header */}
<Box marginBottom={1}>
<Text color={theme.text.primary} bold>
Resume Session
{t('Resume Session')}
</Text>
{picker.filterByBranch && currentBranch && (
<Text color={theme.text.secondary}> (branch: {currentBranch})</Text>
<Text color={theme.text.secondary}>
{' '}
{t('(branch: {{branch}})', { branch: currentBranch })}
</Text>
)}
</Box>
@ -91,8 +95,10 @@ export function ResumeSessionDialog({
<Box paddingY={1}>
<Text color={theme.text.secondary}>
{picker.filterByBranch
? `No sessions found for branch "${currentBranch}"`
: 'No sessions found'}
? t('No sessions found for branch "{{branch}}"', {
branch: currentBranch ?? '',
})
: t('No sessions found')}
</Text>
</Box>
) : (
@ -130,10 +136,10 @@ export function ResumeSessionDialog({
<Text color={theme.text.accent} bold>
B
</Text>
{' to toggle branch · '}
{t(' to toggle branch') + ' · '}
</>
)}
{'↑↓ to navigate · Enter to select · Esc to cancel'}
{t('to navigate · Enter to select · Esc to cancel')}
</Text>
</Box>
</Box>

View file

@ -22,9 +22,9 @@ export interface SessionListItemViewProps {
showScrollDown: boolean;
maxPromptWidth: number;
/**
* Prefix characters to use for selected, scroll up, and scroll down states.
* Defaults to ['> ', '^ ', 'v '] (dialog style).
* Use ['> ', '^ ', 'v '] for dialog or ['> ', '^ ', 'v '] for standalone.
* Prefix characters for selection indicator and scroll hints.
* Dialog style uses '> ', '^ ', 'v ' (ASCII).
* Standalone style uses special Unicode characters.
*/
prefixChars?: {
selected: string;

View file

@ -10,6 +10,7 @@ import { SessionService, getGitBranch } from '@qwen-code/qwen-code-core';
import { theme } from '../semantic-colors.js';
import { useSessionPicker } from '../hooks/useStandaloneSessionPicker.js';
import { SessionListItemView } from './SessionListItem.js';
import { t } from '../../i18n/index.js';
// Exported for testing
export interface SessionPickerProps {
@ -109,7 +110,7 @@ export function SessionPicker({
{/* Header row */}
<Box paddingX={1}>
<Text bold color={theme.text.primary}>
Resume Session
{t('Resume Session')}
</Text>
</Box>
@ -126,8 +127,10 @@ export function SessionPicker({
<Box paddingY={1} justifyContent="center">
<Text color={theme.text.secondary}>
{picker.filterByBranch
? `No sessions found for branch "${currentBranch}"`
: 'No sessions found'}
? t('No sessions found for branch "{{branch}}"', {
branch: currentBranch ?? '',
})
: t('No sessions found')}
</Text>
</Box>
) : (
@ -169,10 +172,10 @@ export function SessionPicker({
>
B
</Text>
{' to toggle branch · '}
{t(' to toggle branch') + ' · '}
</>
)}
{'↑↓ to navigate · Esc to cancel'}
{t('to navigate · Esc to cancel')}
</Text>
</Box>
</Box>