@@ -5,13 +5,6 @@ export type SessionHeaderMetaItem = {
55 content : ReactNode
66}
77
8- /**
9- * The bar above a conversation. On the desktop the window header already names
10- * the session (and its trail, for a run page), so callers there pass no
11- * `title`: the bar is then a single line of what the title used to sit on —
12- * badges first, then the metadata — and the actions centred beside it. Only
13- * the phone, whose top bar has no room for metadata, still passes one.
14- */
158export function SessionChatHeader ( {
169 title,
1710 compact = false ,
@@ -21,64 +14,53 @@ export function SessionChatHeader({
2114 metadata = [ ] ,
2215 children,
2316} : {
24- title ? : string
17+ title : string
2518 compact ?: boolean
2619 leading ?: ReactNode
2720 titleAddon ?: ReactNode
2821 actions ?: ReactNode
2922 metadata ?: SessionHeaderMetaItem [ ]
3023 children ?: ReactNode
3124} ) {
32- const metadataRow = metadata . length > 0 || ( ! title && titleAddon ) ? (
33- < div
34- data-testid = "session-header-meta"
35- className = { `flex min-w-0 items-center gap-2 overflow-hidden whitespace-nowrap text-xs text-[var(--color-text-tertiary)] [&_svg]:shrink-0 ${ title ? 'mt-[3px]' : 'min-h-7' } ` }
36- >
37- { ! title ? titleAddon : null }
38- { metadata . map ( ( item , index ) => (
39- < Fragment key = { item . key } >
40- { index > 0 ? (
41- < span aria-hidden = "true" className = "h-[3px] w-[3px] shrink-0 rounded-full bg-[var(--color-text-tertiary)]" />
42- ) : null }
43- { item . content }
44- </ Fragment >
45- ) ) }
46- </ div >
47- ) : null
48-
4925 return (
5026 < div
5127 data-testid = "session-header"
5228 className = { [
5329 'w-full border-b border-[var(--color-border)]' ,
54- title
55- ? compact ? 'px-4 py-2.5' : 'px-7 py-3.5'
56- : compact ? 'px-4 py-1.5' : 'px-7 py-2' ,
30+ compact ? 'px-4 py-2.5' : 'px-7 py-3.5' ,
5731 ] . join ( ' ' ) }
5832 >
5933 < div className = "mx-auto w-full min-w-0 max-w-[var(--chat-content-max-width)]" >
6034 { /* Top-aligned so a goal / team strip below the meta line does not drag
61- the actions down; with a title they are offset to centre on title +
62- meta, without one the meta line and the actions share a 28px row. */ }
35+ the actions down; they are offset to centre on title + meta. */ }
6336 < div className = "flex min-w-0 items-start gap-4" >
6437 { leading }
6538 < div className = "min-w-0 flex-1" >
66- { title ? (
67- < div className = "flex min-w-0 items-center gap-2" >
68- < h1
69- className = "min-w-0 truncate text-[15px] font-semibold leading-[1.35] tracking-[-0.01em] text-[var(--color-text-primary)]"
70- style = { { fontFamily : 'var(--font-headline)' } }
71- title = { title }
72- >
73- { title }
74- </ h1 >
75- { titleAddon }
39+ < div className = "flex min-w-0 items-center gap-2" >
40+ < h1
41+ className = "min-w-0 truncate text-[15px] font-semibold leading-[1.35] tracking-[-0.01em] text-[var(--color-text-primary)]"
42+ style = { { fontFamily : 'var(--font-headline)' } }
43+ title = { title }
44+ >
45+ { title }
46+ </ h1 >
47+ { titleAddon }
48+ </ div >
49+ { metadata . length > 0 ? (
50+ < div className = "mt-[3px] flex min-w-0 items-center gap-2 overflow-hidden whitespace-nowrap text-xs text-[var(--color-text-tertiary)] [&_svg]:shrink-0" >
51+ { metadata . map ( ( item , index ) => (
52+ < Fragment key = { item . key } >
53+ { index > 0 ? (
54+ < span aria-hidden = "true" className = "h-[3px] w-[3px] shrink-0 rounded-full bg-[var(--color-text-tertiary)]" />
55+ ) : null }
56+ { item . content }
57+ </ Fragment >
58+ ) ) }
7659 </ div >
7760 ) : null }
78- { metadataRow }
7961 { children }
8062 </ div >
81- { actions ? < div className = { ` flex shrink-0 items-center gap-2 ${ title ? ' pt-1' : 'min-h-7' } ` } > { actions } </ div > : null }
63+ { actions ? < div className = " flex shrink-0 items-center gap-2 pt-1" > { actions } </ div > : null }
8264 </ div >
8365 </ div >
8466 </ div >
0 commit comments