@@ -860,6 +860,11 @@ export function Session() {
860860 </ Match >
861861 < Match when = { message . role === "assistant" } >
862862 < AssistantMessage
863+ user = {
864+ messages ( ) . findLast (
865+ ( item ) => item . id === ( message as AssistantMessage ) . parentID ,
866+ ) as UserMessage
867+ }
863868 last = { lastAssistant ( ) ?. id === message . id }
864869 message = { message as AssistantMessage }
865870 parts = { sync . data . part [ message . id ] ?? [ ] }
@@ -993,7 +998,7 @@ function UserMessage(props: {
993998 )
994999}
9951000
996- function AssistantMessage ( props : { message : AssistantMessage ; parts : Part [ ] ; last : boolean } ) {
1001+ function AssistantMessage ( props : { message : AssistantMessage ; parts : Part [ ] ; last : boolean ; user : UserMessage } ) {
9971002 const local = useLocal ( )
9981003 const { theme } = useTheme ( )
9991004 const ctx = use ( )
@@ -1038,13 +1043,15 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
10381043 >
10391044 < box paddingLeft = { 3 } >
10401045 < text marginTop = { 1 } >
1041- < span style = { { fg : local . agent . color ( props . message . mode ) } } > { Locale . titlecase ( props . message . mode ) } </ span > { " " }
1042- < span style = { { fg : theme . textMuted } } >
1043- { props . message . modelID }
1044- { ctx . showTimestamps ( ) &&
1045- props . message . time . completed &&
1046- ` · ${ Locale . todayTimeOrDateTime ( props . message . time . completed ) } ` }
1047- </ span >
1046+ < span style = { { fg : local . agent . color ( props . message . mode ) } } > ▣</ span > { " " }
1047+ < span style = { { fg : theme . text } } > { Locale . titlecase ( props . message . mode ) } </ span > { " " }
1048+ < span style = { { fg : theme . textMuted } } > ⬝{ props . message . modelID } </ span >
1049+ < Show when = { props . message . time . completed } >
1050+ < span style = { { fg : theme . textMuted } } >
1051+ { " " }
1052+ ⬝{ Locale . duration ( props . message . time . completed ! - props . user . time . created ) }
1053+ </ span >
1054+ </ Show >
10481055 </ text >
10491056 </ box >
10501057 </ Match >
0 commit comments