Skip to content

Commit 5ba0fc3

Browse files
committed
bugfix: collection form styling
1 parent ef918b7 commit 5ba0fc3

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

internal/tui/components/text_input.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ func (t *TextInput) SetWidth(width int) {
4242
if containerWidth < 15 {
4343
containerWidth = 15
4444
}
45-
45+
4646
// The actual input width inside the container (subtract border and padding)
4747
inputWidth := containerWidth - 4 // 2 for border, 2 for padding
4848
if inputWidth < 10 {
4949
inputWidth = 10
5050
}
51-
51+
5252
// Ensure the underlying textinput respects the width
5353
t.textInput.Width = inputWidth
5454
}
@@ -78,21 +78,22 @@ func (t TextInput) Update(msg tea.Msg) (TextInput, tea.Cmd) {
7878
func (t TextInput) View() string {
7979
labelStyle := styles.TitleStyle.Copy().
8080
Width(12).
81+
MarginTop(1).
8182
Align(lipgloss.Right)
8283

8384
// Create a fixed-width container for the input to prevent overflow
8485
containerWidth := t.width - 12 - 1 - 2 // Account for label, colon, spacing
8586
if containerWidth < 15 {
8687
containerWidth = 15
8788
}
88-
89+
8990
inputContainer := styles.ListItemStyle.Copy().
9091
Width(containerWidth).
9192
Height(1).
9293
Border(lipgloss.RoundedBorder()).
9394
BorderForeground(styles.Secondary).
9495
Padding(0, 1)
95-
96+
9697
if t.textInput.Focused() {
9798
inputContainer = inputContainer.BorderForeground(styles.Primary)
9899
}

internal/tui/views/add_collection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (v AddCollectionView) Update(msg tea.Msg) (AddCollectionView, tea.Cmd) {
4545
v.width = msg.Width
4646
v.height = msg.Height
4747
v.layout.SetSize(v.width, v.height)
48-
v.form.SetSize(v.width-4, v.height-8)
48+
v.form.SetSize(v.width-50, v.height-8)
4949

5050
case tea.KeyMsg:
5151
if v.submitting {

internal/tui/views/edit_collection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (v EditCollectionView) Update(msg tea.Msg) (EditCollectionView, tea.Cmd) {
4949
v.width = msg.Width
5050
v.height = msg.Height
5151
v.layout.SetSize(v.width, v.height)
52-
v.form.SetSize(v.width-4, v.height-8)
52+
v.form.SetSize(v.width-50, v.height-8)
5353

5454
case tea.KeyMsg:
5555
if v.submitting {

0 commit comments

Comments
 (0)