@@ -133,7 +133,7 @@ import { isRecord } from "../../util/record"
133133import { parseTodos } from "../../util/todo"
134134import { createHistoryPrepend } from "./history"
135135import { context , use , type PendingAction } from "./render-context"
136- import { INLINE_TOOL_ICON_WIDTH , InlineToolRow , ReasoningPart , TextPart , toolDisplay } from "./message-parts"
136+ import { INLINE_TOOL_ICON_WIDTH , InlineToolRow , ReasoningPart , TextPart , toolDisplay , useRowGutter } from "./message-parts"
137137import { defaultVerbosity , type GroupKind , type SessionEntry } from "./grouping/session"
138138import { SessionGroupView } from "./group-view"
139139import { useEntryAnchor } from "./anchor-view"
@@ -1870,6 +1870,7 @@ function TurnTokenUsage(props: {
18701870 previousCache ?: CacheUsage
18711871 message : ( messageID : string ) => SessionMessageInfo | undefined
18721872} ) {
1873+ const gutter = useRowGutter ( )
18731874 const config = useConfig ( )
18741875 const theme = useTheme ( )
18751876 const renderer = useRenderer ( )
@@ -1925,7 +1926,7 @@ function TurnTokenUsage(props: {
19251926 } )
19261927 return (
19271928 < Show when = { Boolean ( config . data . debug ?. turn_tokens ) && steps ( ) . length > 0 } >
1928- < box paddingLeft = { 3 } flexDirection = "column" >
1929+ < box paddingLeft = { gutter ( ) } flexDirection = "column" >
19291930 < box
19301931 flexDirection = "row"
19311932 onMouseOver = { ( ) => setHover ( true ) }
@@ -2026,6 +2027,7 @@ function turnTokenToolSummary(tool: SessionMessageAssistantTool) {
20262027}
20272028
20282029function BackgroundToolHint ( props : { messages : SessionMessageInfo [ ] } ) {
2030+ const gutter = useRowGutter ( )
20292031 const theme = useTheme ( )
20302032 const shortcut = Keymap . useShortcut ( "session.background" )
20312033 const running = createMemo ( ( ) => {
@@ -2049,7 +2051,7 @@ function BackgroundToolHint(props: { messages: SessionMessageInfo[] }) {
20492051 return (
20502052 < Show when = { visible ( ) && shortcut ( ) } >
20512053 { ( value ) => (
2052- < box marginTop = { 1 } paddingLeft = { 3 } flexShrink = { 0 } >
2054+ < box marginTop = { 1 } paddingLeft = { gutter ( ) } flexShrink = { 0 } >
20532055 < text fg = { theme . text . muted } >
20542056 Press < span style = { { fg : theme . text . base } } > { value ( ) } </ span > to move running work to the background
20552057 </ text >
@@ -2100,9 +2102,10 @@ function SessionMessageView(props: { message: SessionMessageInfo }) {
21002102}
21012103
21022104function ExecutionError ( props : { error : NonNullable < Extract < SessionMessageInfo , { type : "idle" } > [ "error" ] > } ) {
2105+ const gutter = useRowGutter ( )
21032106 const theme = useTheme ( )
21042107 return (
2105- < box paddingLeft = { 3 } >
2108+ < box paddingLeft = { gutter ( ) } >
21062109 < text fg = { theme . text . feedback . error . base } > Error: { errorMessage ( props . error ) } </ text >
21072110 </ box >
21082111 )
@@ -2159,6 +2162,7 @@ function SessionPartView(props: {
21592162}
21602163
21612164function AssistantFooter ( props : { message : SessionMessageAssistant } ) {
2165+ const gutter = useRowGutter ( )
21622166 const ctx = use ( )
21632167 const config = useConfig ( )
21642168 const data = useData ( )
@@ -2184,7 +2188,7 @@ function AssistantFooter(props: { message: SessionMessageAssistant }) {
21842188 < Show when = { props . message . error && ! interrupted ( ) && ! props . message . retry } >
21852189 < Switch
21862190 fallback = {
2187- < box paddingLeft = { 3 } >
2191+ < box paddingLeft = { gutter ( ) } >
21882192 < text fg = { theme . text . feedback . error . base } > Error: { errorMessage ( props . message . error ) } </ text >
21892193 </ box >
21902194 }
@@ -2196,7 +2200,7 @@ function AssistantFooter(props: { message: SessionMessageAssistant }) {
21962200 </ Switch >
21972201 </ Show >
21982202 < AssistantRetry retry = { props . message . retry } />
2199- < box paddingLeft = { 3 } marginTop = { props . message . retry || ( props . message . error && ! interrupted ( ) ) ? 1 : 0 } >
2203+ < box paddingLeft = { gutter ( ) } marginTop = { props . message . retry || ( props . message . error && ! interrupted ( ) ) ? 1 : 0 } >
22002204 < text >
22012205 < span style = { { fg : props . message . error ? theme . text . muted : local . agent . color ( props . message . agent ) } } >
22022206 { Locale . titlecase ( props . message . agent ) }
@@ -2223,11 +2227,12 @@ function AssistantFooter(props: { message: SessionMessageAssistant }) {
22232227}
22242228
22252229function SessionSwitchMessageV2 ( props : { message : SessionMessageInfo } ) {
2230+ const gutter = useRowGutter ( )
22262231 const ctx = use ( )
22272232 const theme = useTheme ( )
22282233 if ( props . message . type === "location-switched" )
22292234 return (
2230- < box paddingLeft = { 3 } >
2235+ < box paddingLeft = { gutter ( ) } >
22312236 < text >
22322237 < span style = { { fg : theme . text . muted } } > ↳ Moved to </ span >
22332238 < span style = { { fg : theme . text . feedback . info . base } } > { props . message . location . directory } </ span >
@@ -2246,13 +2251,14 @@ function SessionSwitchMessageV2(props: { message: SessionMessageInfo }) {
22462251 return ""
22472252 }
22482253 return (
2249- < box paddingLeft = { 3 } >
2254+ < box paddingLeft = { gutter ( ) } >
22502255 < text fg = { theme . text . muted } > { text ( ) } </ text >
22512256 </ box >
22522257 )
22532258}
22542259
22552260function SessionNoticeMessageV2 ( props : { message : SessionMessageInfo } ) {
2261+ const gutter = useRowGutter ( )
22562262 const ctx = use ( )
22572263 const theme = useTheme ( )
22582264 const renderer = useRenderer ( )
@@ -2276,7 +2282,7 @@ function SessionNoticeMessageV2(props: { message: SessionMessageInfo }) {
22762282 return state ( ) ?? "finished"
22772283 }
22782284 const heading = ( ) => `${ state ( ) === "completed" ? "↳" : "!" } ${ actor ( ) } ${ status ( ) } `
2279- const suffix = ( ) => Locale . truncateWidth ( ` · ${ description ( ) } ` , Math . max ( 0 , ctx . width - 3 - stringWidth ( heading ( ) ) ) )
2285+ const suffix = ( ) => Locale . truncateWidth ( ` · ${ description ( ) } ` , Math . max ( 0 , ctx . width - gutter ( ) - stringWidth ( heading ( ) ) ) )
22802286 const color = ( ) => {
22812287 if ( state ( ) === "error" ) return theme . text . feedback . error . base
22822288 if ( state ( ) === "cancelled" ) return theme . text . feedback . warning . base
@@ -2294,7 +2300,7 @@ function SessionNoticeMessageV2(props: { message: SessionMessageInfo }) {
22942300 >
22952301 < Slot path = "session.message.completion" input = { { sessionID : ctx . sessionID , messageID : props . message . id } } >
22962302 < box
2297- marginLeft = { 3 }
2303+ marginLeft = { gutter ( ) }
22982304 onMouseOver = { ( ) => childID ( ) && setHover ( true ) }
22992305 onMouseOut = { ( ) => setHover ( false ) }
23002306 onMouseUp = { ( ) => {
@@ -2323,6 +2329,7 @@ function SessionSkillMessage(props: { message: Extract<SessionMessageInfo, { typ
23232329}
23242330
23252331function CompactionMessage ( props : { message : Extract < SessionMessageInfo , { type : "compaction" } > } ) {
2332+ const gutter = useRowGutter ( )
23262333 const ctx = use ( )
23272334 const theme = useTheme ( )
23282335 const { currentMarkdownSyntax : syntax } = useThemes ( )
@@ -2374,7 +2381,7 @@ function CompactionMessage(props: { message: Extract<SessionMessageInfo, { type:
23742381 < box border = { [ "top" ] } borderColor = { color ( ) } flexGrow = { 1 } />
23752382 </ box >
23762383 < Show when = { content ( ) } >
2377- < box paddingTop = { 1 } paddingLeft = { 3 } >
2384+ < box paddingTop = { 1 } paddingLeft = { gutter ( ) } >
23782385 < markdown
23792386 ref = { useSessionLinks ( ) }
23802387 syntaxStyle = { syntax ( ) }
@@ -2682,12 +2689,13 @@ function freeLimitReset(delay: number | undefined, base: number) {
26822689}
26832690
26842691function FreeLimitNotice ( props : { message : Pick < SessionMessageAssistant , "error" | "time" > } ) {
2692+ const gutter = useRowGutter ( )
26852693 const theme = useTheme ( )
26862694 const reset = createMemo ( ( ) =>
26872695 freeLimitReset ( props . message . error ?. retryAfterMs , props . message . time . completed ?? props . message . time . created ) ,
26882696 )
26892697 return (
2690- < box paddingLeft = { 3 } flexDirection = "column" >
2698+ < box paddingLeft = { gutter ( ) } flexDirection = "column" >
26912699 < text fg = { theme . text . muted } > You've used today's free messages.{ reset ( ) ? ` They reset at ${ reset ( ) } .` : "" } </ text >
26922700 < text fg = { theme . text . muted } >
26932701 Upgrade to OpenCode Go → < span style = { { fg : theme . text . base } } > /connect</ span > · Switch model →{ " " }
@@ -2698,6 +2706,7 @@ function FreeLimitNotice(props: { message: Pick<SessionMessageAssistant, "error"
26982706}
26992707
27002708function AssistantRetry ( props : { retry : SessionMessageAssistant [ "retry" ] } ) {
2709+ const gutter = useRowGutter ( )
27012710 const theme = useTheme ( )
27022711 const [ seconds , setSeconds ] = createSignal ( 0 )
27032712 createEffect ( ( ) => {
@@ -2713,7 +2722,7 @@ function AssistantRetry(props: { retry: SessionMessageAssistant["retry"] }) {
27132722 return (
27142723 < Show when = { props . retry } >
27152724 { ( retry ) => (
2716- < box paddingLeft = { 3 } >
2725+ < box paddingLeft = { gutter ( ) } >
27172726 < text fg = { theme . text . feedback . warning . base } >
27182727 ⚠ { seconds ( ) > 0 ? `Retrying in ${ seconds ( ) } s` : "Retry due" } · attempt { retry ( ) . attempt } ·{ " " }
27192728 { retry ( ) . error . message }
@@ -3384,6 +3393,7 @@ function Glob(props: ToolProps) {
33843393}
33853394
33863395function Read ( props : ToolProps ) {
3396+ const gutter = useRowGutter ( )
33873397 const theme = useTheme ( )
33883398 const pathFormatter = usePathFormatter ( )
33893399 const isRunning = createMemo ( ( ) => props . part . state . status === "running" )
@@ -3410,7 +3420,7 @@ function Read(props: ToolProps) {
34103420 </ InlineTool >
34113421 < For each = { loaded ( ) } >
34123422 { ( filepath ) => (
3413- < box paddingLeft = { 3 } >
3423+ < box paddingLeft = { gutter ( ) } >
34143424 < text paddingLeft = { 3 } fg = { theme . text . muted } >
34153425 ↳ Loaded { pathFormatter . format ( filepath ) }
34163426 </ text >
@@ -3531,6 +3541,7 @@ export function isBackgroundSubagent(
35313541export { executeCallSummary }
35323542
35333543function ExecuteCallView ( props : { call : Accessor < ExecuteCall > } ) {
3544+ const gutter = useRowGutter ( )
35343545 const theme = useTheme ( )
35353546 const renderer = useRenderer ( )
35363547 const [ expanded , setExpanded ] = createSignal ( false )
@@ -3546,7 +3557,7 @@ function ExecuteCallView(props: { call: Accessor<ExecuteCall> }) {
35463557
35473558 return (
35483559 < box
3549- paddingLeft = { 3 }
3560+ paddingLeft = { gutter ( ) }
35503561 onMouseOver = { ( ) => expandable ( ) && setHover ( true ) }
35513562 onMouseOut = { ( ) => setHover ( false ) }
35523563 onMouseUp = { ( ) => {
@@ -3584,6 +3595,7 @@ function ExecuteCallView(props: { call: Accessor<ExecuteCall> }) {
35843595
35853596// The `execute` tool streams child tool calls through metadata, not a child session like Task.
35863597function Execute ( props : ToolProps ) {
3598+ const gutter = useRowGutter ( )
35873599 const ctx = use ( )
35883600 const theme = useTheme ( )
35893601 const dialog = useDialog ( )
@@ -3615,7 +3627,7 @@ function Execute(props: ToolProps) {
36153627 </ InlineTool >
36163628 < Index each = { calls ( ) } > { ( call ) => < ExecuteCallView call = { call } /> } </ Index >
36173629 < Show when = { showOutput ( ) } >
3618- < box paddingLeft = { 3 } >
3630+ < box paddingLeft = { gutter ( ) } >
36193631 < For each = { outputPreview ( ) . split ( "\n" ) } >
36203632 { ( line , index ) => (
36213633 < text paddingLeft = { 3 } fg = { theme . text . feedback . error . base } >
0 commit comments