diff options
| author | Timo Clasen <[email protected]> | 2025-07-17 00:36:48 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-16 17:36:48 -0500 |
| commit | 60b55f9d921805a4a9d38c9eed05a060df08df82 (patch) | |
| tree | abdd4456951d257019f7a50194a650058583af9f /packages/tui | |
| parent | 3c6c2bf13b97150b32e3f800c92c689ae6367545 (diff) | |
| download | opencode-60b55f9d921805a4a9d38c9eed05a060df08df82.tar.gz opencode-60b55f9d921805a4a9d38c9eed05a060df08df82.zip | |
feat(tui): remove sharing info from session header when sharing is disabled (#1076)
Diffstat (limited to 'packages/tui')
| -rw-r--r-- | packages/tui/internal/components/chat/messages.go | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/packages/tui/internal/components/chat/messages.go b/packages/tui/internal/components/chat/messages.go index 6c65483b5..93f952a78 100644 --- a/packages/tui/internal/components/chat/messages.go +++ b/packages/tui/internal/components/chat/messages.go @@ -448,23 +448,30 @@ func (m *messagesComponent) renderHeader() string { Render(formatTokensAndCost(tokens, contextWindow, cost, isSubscriptionModel)) background := t.Background() - share = layout.Render( + + var items []layout.FlexItem + justify := layout.JustifyEnd + + if m.app.Config.Share != opencode.ConfigShareDisabled { + items = append(items, layout.FlexItem{View: share}) + justify = layout.JustifySpaceBetween + } + + items = append(items, layout.FlexItem{View: sessionInfo}) + + headerRow := layout.Render( layout.FlexOptions{ Background: &background, Direction: layout.Row, - Justify: layout.JustifySpaceBetween, + Justify: justify, Align: layout.AlignStretch, Width: headerWidth - 6, }, - layout.FlexItem{ - View: share, - }, - layout.FlexItem{ - View: sessionInfo, - }, + items..., ) - headerLines = append(headerLines, share) + headerLines = append(headerLines, headerRow) + header := strings.Join(headerLines, "\n") header = styles.NewStyle(). Background(t.Background()). |
