Skip to content

Commit 10ddd65

Browse files
committed
wip: refactoring tui
1 parent 61396b9 commit 10ddd65

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ func (m *editorComponent) View() string {
270270
)
271271
textarea = styles.BaseStyle().
272272
Width(m.width).
273+
PaddingTop(1).
274+
PaddingBottom(1).
273275
Background(t.BackgroundElement()).
274276
Border(lipgloss.ThickBorder(), false, true).
275277
BorderForeground(t.BackgroundSubtle()).
@@ -307,7 +309,7 @@ func (m *editorComponent) SetSize(width, height int) tea.Cmd {
307309
m.width = width
308310
m.height = height
309311
m.textarea.SetWidth(width - 5) // account for the prompt and padding right
310-
m.textarea.SetHeight(height - 2) // account for info underneath
312+
m.textarea.SetHeight(height - 4) // account for info underneath
311313
return nil
312314
}
313315

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func (m *messagesComponent) header() string {
245245
base := styles.BaseStyle().Render
246246
muted := styles.Muted().Render
247247
headerLines := []string{}
248-
headerLines = append(headerLines, toMarkdown("# "+m.app.Session.Title, width-4, t.BackgroundElement()))
248+
headerLines = append(headerLines, toMarkdown("# "+m.app.Session.Title, width-4, t.Background()))
249249
if m.app.Session.Share != nil && m.app.Session.Share.Url != "" {
250250
headerLines = append(headerLines, muted(m.app.Session.Share.Url))
251251
} else {
@@ -256,7 +256,7 @@ func (m *messagesComponent) header() string {
256256
header = styles.BaseStyle().
257257
Width(width).
258258
PaddingLeft(2).
259-
Background(t.BackgroundElement()).
259+
// Background(t.BackgroundElement()).
260260
BorderLeft(true).
261261
BorderRight(true).
262262
BorderBackground(t.Background()).

packages/tui/internal/page/chat.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (p *chatPage) View() string {
139139

140140
layoutView = layout.PlaceOverlay(
141141
editorX,
142-
editorY-lipgloss.Height(overlay)+1,
142+
editorY-lipgloss.Height(overlay)+2,
143143
overlay,
144144
layoutView,
145145
)
@@ -169,7 +169,7 @@ func NewChatPage(app *app.App) layout.ModelWithView {
169169
layout.WithDirection(layout.FlexDirectionVertical),
170170
layout.WithPaneSizes(
171171
layout.FlexPaneSizeGrow,
172-
layout.FlexPaneSizeFixed(5),
172+
layout.FlexPaneSizeFixed(6),
173173
),
174174
),
175175
}

0 commit comments

Comments
 (0)