@@ -16,6 +16,7 @@ import { getAvatarColors, type LocalProject, useLayout } from "@/context/layout"
1616import { useNotification } from "@/context/notification"
1717import { usePermission } from "@/context/permission"
1818import { messageAgentColor } from "@/utils/agent"
19+ import { sessionTitle } from "@/utils/session-title"
1920import { sessionPermissionRequest } from "../session/composer/session-request-tree"
2021import { hasProjectPermissions } from "./helpers"
2122
@@ -101,42 +102,46 @@ const SessionRow = (props: {
101102 warmPress : ( ) => void
102103 warmFocus : ( ) => void
103104 cancelHoverPrefetch : ( ) => void
104- } ) : JSX . Element => (
105- < A
106- href = { `/${ props . slug } /session/${ props . session . id } ` }
107- class = { `flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${ props . dense ? "py-0.5" : "py-1" } ` }
108- onPointerDown = { props . warmPress }
109- onPointerEnter = { props . warmHover }
110- onPointerLeave = { props . cancelHoverPrefetch }
111- onFocus = { props . warmFocus }
112- onClick = { ( ) => {
113- props . setHoverSession ( undefined )
114- if ( props . sidebarOpened ( ) ) return
115- props . clearHoverProjectSoon ( )
116- } }
117- >
118- < div
119- class = "shrink-0 size-6 flex items-center justify-center"
120- style = { { color : props . tint ( ) ?? "var(--icon-interactive-base)" } }
105+ } ) => {
106+ const title = ( ) => sessionTitle ( props . session . title )
107+
108+ return (
109+ < A
110+ href = { `/${ props . slug } /session/${ props . session . id } ` }
111+ class = { `flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${ props . dense ? "py-0.5" : "py-1" } ` }
112+ onPointerDown = { props . warmPress }
113+ onPointerEnter = { props . warmHover }
114+ onPointerLeave = { props . cancelHoverPrefetch }
115+ onFocus = { props . warmFocus }
116+ onClick = { ( ) => {
117+ props . setHoverSession ( undefined )
118+ if ( props . sidebarOpened ( ) ) return
119+ props . clearHoverProjectSoon ( )
120+ } }
121121 >
122- < Switch fallback = { < Icon name = "dash" size = "small" class = "text-icon-weak" /> } >
123- < Match when = { props . isWorking ( ) } >
124- < Spinner class = "size-[15px]" />
125- </ Match >
126- < Match when = { props . hasPermissions ( ) } >
127- < div class = "size-1.5 rounded-full bg-surface-warning-strong" />
128- </ Match >
129- < Match when = { props . hasError ( ) } >
130- < div class = "size-1.5 rounded-full bg-text-diff-delete-base" />
131- </ Match >
132- < Match when = { props . unseenCount ( ) > 0 } >
133- < div class = "size-1.5 rounded-full bg-text-interactive-base" />
134- </ Match >
135- </ Switch >
136- </ div >
137- < span class = "text-14-regular text-text-strong min-w-0 flex-1 truncate" > { props . session . title } </ span >
138- </ A >
139- )
122+ < div
123+ class = "shrink-0 size-6 flex items-center justify-center"
124+ style = { { color : props . tint ( ) ?? "var(--icon-interactive-base)" } }
125+ >
126+ < Switch fallback = { < Icon name = "dash" size = "small" class = "text-icon-weak" /> } >
127+ < Match when = { props . isWorking ( ) } >
128+ < Spinner class = "size-[15px]" />
129+ </ Match >
130+ < Match when = { props . hasPermissions ( ) } >
131+ < div class = "size-1.5 rounded-full bg-surface-warning-strong" />
132+ </ Match >
133+ < Match when = { props . hasError ( ) } >
134+ < div class = "size-1.5 rounded-full bg-text-diff-delete-base" />
135+ </ Match >
136+ < Match when = { props . unseenCount ( ) > 0 } >
137+ < div class = "size-1.5 rounded-full bg-text-interactive-base" />
138+ </ Match >
139+ </ Switch >
140+ </ div >
141+ < span class = "text-14-regular text-text-strong min-w-0 flex-1 truncate" > { title ( ) } </ span >
142+ </ A >
143+ )
144+ }
140145
141146const SessionHoverPreview = ( props : {
142147 mobile ?: boolean
@@ -319,7 +324,7 @@ export const SessionItem = (props: SessionItemProps): JSX.Element => {
319324 fallback = {
320325 < Tooltip
321326 placement = { props . mobile ? "bottom" : "right" }
322- value = { props . session . title }
327+ value = { sessionTitle ( props . session . title ) }
323328 gutter = { 10 }
324329 class = "min-w-0 w-full"
325330 >
0 commit comments