Skip to content

Commit aa66911

Browse files
timoclsnnipuna-perera
authored andcommitted
feat(tui): remove sharing info from session header when sharing is disabled (sst#1076)
1 parent 21d1064 commit aa66911

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

packages/tui/internal/components/chat/messages.go

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,23 +448,30 @@ func (m *messagesComponent) renderHeader() string {
448448
Render(formatTokensAndCost(tokens, contextWindow, cost, isSubscriptionModel))
449449

450450
background := t.Background()
451-
share = layout.Render(
451+
452+
var items []layout.FlexItem
453+
justify := layout.JustifyEnd
454+
455+
if m.app.Config.Share != opencode.ConfigShareDisabled {
456+
items = append(items, layout.FlexItem{View: share})
457+
justify = layout.JustifySpaceBetween
458+
}
459+
460+
items = append(items, layout.FlexItem{View: sessionInfo})
461+
462+
headerRow := layout.Render(
452463
layout.FlexOptions{
453464
Background: &background,
454465
Direction: layout.Row,
455-
Justify: layout.JustifySpaceBetween,
466+
Justify: justify,
456467
Align: layout.AlignStretch,
457468
Width: headerWidth - 6,
458469
},
459-
layout.FlexItem{
460-
View: share,
461-
},
462-
layout.FlexItem{
463-
View: sessionInfo,
464-
},
470+
items...,
465471
)
466472

467-
headerLines = append(headerLines, share)
473+
headerLines = append(headerLines, headerRow)
474+
468475
header := strings.Join(headerLines, "\n")
469476
header = styles.NewStyle().
470477
Background(t.Background()).

0 commit comments

Comments
 (0)