File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Box , Text , useStdout } from 'ink' ;
22import { useCallback , useState } from 'react' ;
33
4+ import { UI } from '../constants' ;
45import { listSessions , type SessionMetadata } from '../utils/session' ;
56import { SelectPrompt , SelectPromptHint } from './SelectPrompt' ;
67
@@ -32,7 +33,7 @@ const SESSION_LABEL_PADDING = 4;
3233
3334function truncate ( value : string , maxLength : number ) : string {
3435 return value . length > maxLength
35- ? `${ value . slice ( 0 , maxLength - 1 ) . trimEnd ( ) } … `
36+ ? `${ value . slice ( 0 , maxLength - 1 ) . trimEnd ( ) } ${ UI . ELLIPSIS } `
3637 : value ;
3738}
3839
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ export const PROMPT_PREFIX = '> ';
33export const AGENT_MARGIN_X = 2 ;
44export const MARKDOWN_HR_CHARACTER = '─' ;
55export const DIAMOND = '❖' ;
6+ export const ELLIPSIS = '…' ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { join } from 'node:path';
1111
1212import { v7 as uuidv7 } from 'uuid' ;
1313
14- import { CONFIG , ROLE } from '../constants' ;
14+ import { CONFIG , ROLE , UI } from '../constants' ;
1515import type { Message } from './ollama' ;
1616
1717const SESSIONS_DIRECTORY = join ( CONFIG . DIRECTORY , 'sessions' ) ;
@@ -110,7 +110,7 @@ function deriveTitle(message: Message): string {
110110 }
111111
112112 return normalized . length > TITLE_MAX_LENGTH
113- ? normalized . slice ( 0 , TITLE_MAX_LENGTH - 1 ) . trimEnd ( ) + '…'
113+ ? normalized . slice ( 0 , TITLE_MAX_LENGTH - 1 ) . trimEnd ( ) + UI . ELLIPSIS
114114 : normalized ;
115115}
116116
Original file line number Diff line number Diff line change 1+ import { UI } from '../../../constants' ;
2+
13/**
24 * Strip HTML tags from a string
35 */
@@ -31,6 +33,6 @@ export function cleanText(value: string): string {
3133 */
3234export function truncate ( value : string , maxLength : number ) : string {
3335 return value . length > maxLength
34- ? `${ value . slice ( 0 , maxLength - 1 ) . trimEnd ( ) } … `
36+ ? `${ value . slice ( 0 , maxLength - 1 ) . trimEnd ( ) } ${ UI . ELLIPSIS } `
3537 : value ;
3638}
You can’t perform that action at this time.
0 commit comments