Approval-based snapshot testing library for Go (mirror)

fix: tui footer margin

+7 -10
+6 -9
cmd/tui/main.go
··· 27 27 helpStyle = lipgloss.NewStyle(). 28 28 Foreground(lipgloss.Color("241")). 29 29 Background(lipgloss.Color("236")). 30 - Padding(0, 1) 30 + Padding(0, 0) 31 31 32 32 statusBarStyle = lipgloss.NewStyle(). 33 33 Background(lipgloss.Color("236")). ··· 153 153 m.width = msg.Width 154 154 m.height = msg.Height 155 155 156 - headerHeight := 3 156 + headerHeight := 1 157 157 footerHeight := 1 158 158 verticalMarginHeight := headerHeight + footerHeight 159 159 ··· 345 345 headerStyled := statusBarStyle.Width(m.width).Render(header) 346 346 347 347 // Footer with scroll info only 348 + // TODO: maybe add snapshot file name to footer? 348 349 scrollInfo := fmt.Sprintf("%3.f%%", m.viewport.ScrollPercent()*100) 349 350 scrollStyled := helpStyle.Render(scrollInfo) 350 351 351 352 // Create footer with just scroll info on the right 352 - footer := lipgloss.JoinHorizontal(lipgloss.Left, 353 + footer := lipgloss.JoinHorizontal(lipgloss.Bottom, 353 354 strings.Repeat(" ", max(m.width-lipgloss.Width(scrollStyled)-1, 0)), 354 355 scrollStyled, 355 356 ) 356 357 footerStyled := statusBarStyle.Width(m.width).Render(footer) 357 358 358 359 // Viewport content 360 + // TODO: it would be nice if we could show the input on the right side? 361 + // - (probably optionally, with a keybind -- hidden by default) 359 362 viewportContent := m.viewport.View() 360 - 361 - // Calculate how much vertical space we have 362 - // Total height = terminal height 363 - // Used by header = ~1 line (the rendered header) 364 - // Used by footer = ~1 line 365 - // Middle = viewport (takes remaining space) 366 363 367 364 return lipgloss.JoinVertical( 368 365 lipgloss.Left,
+1 -1
internal/diff/diff.go
··· 1 1 package diff 2 2 3 3 /* 4 - This file was sourced from github.com/gkampitakis/go-snaps, available with the following License 4 + This file was sourced from github.com/gkampitakis/go-snaps, available with the following License: 5 5 6 6 MIT License 7 7