chore: added footer helper to jotts cf80d956
Steve · 2026-05-17 17:02 3 file(s) · +17 −3
TODO.md (added) +1 −0
1 +
- [ ] Fix input for sipp so it reflects jotts
apps/jotts-go/tui/update.go +1 −1
275 275
		return
276 276
	}
277 277
	listW, contentW := splitWidths(m.width)
278 -
	bodyH := splitBodyHeight(m.height)
278 +
	bodyH := splitBodyHeight(m.height - 1)
279 279
280 280
	listInnerW := max(listW-paneFrameWidth(), 1)
281 281
	listInnerH := max(bodyH-paneFrameHeight(), 1)
apps/jotts-go/tui/view.go +15 −2
24 24
	statusErrStyle = lipgloss.NewStyle().
25 25
			Foreground(lipgloss.Color("1")).
26 26
			Bold(true)
27 +
	hintStyle = lipgloss.NewStyle().
28 +
			Foreground(lipgloss.Color("8"))
27 29
	modalStyle = lipgloss.NewStyle().
28 30
			Border(lipgloss.RoundedBorder()).
29 31
			BorderForeground(lipgloss.Color("3")).
32 34
33 35
func (m Model) View() tea.View {
34 36
	listW, contentW := splitWidths(m.width)
35 -
	bodyH := splitBodyHeight(m.height)
37 +
	bodyH := splitBodyHeight(m.height - 1)
36 38
37 39
	left := m.renderListPane(listW, bodyH)
38 40
	right := m.renderRightPane(contentW, bodyH)
39 41
40 -
	base := lipgloss.JoinHorizontal(lipgloss.Top, left, right)
42 +
	body := lipgloss.JoinHorizontal(lipgloss.Top, left, right)
43 +
	footer := m.renderFooter()
44 +
	base := lipgloss.JoinVertical(lipgloss.Left, body, footer)
41 45
42 46
	var overlays []*lipgloss.Layer
43 47
	if m.showHelp {
131 135
		Width(max(w-paneFrameWidth(), 1)).
132 136
		Height(max(h-paneFrameHeight(), 1)).
133 137
		Render(inner)
138 +
}
139 +
140 +
func (m Model) renderFooter() string {
141 +
	mode := "local"
142 +
	if m.isRemote {
143 +
		mode = "remote " + m.backend.RemoteURL()
144 +
	}
145 +
	help := m.help.ShortHelpView(m.keys.ShortHelp())
146 +
	return hintStyle.Render(fmt.Sprintf("[%s] %s", mode, help))
134 147
}
135 148
136 149
func centerLayer(w, h int, content string, z int) *lipgloss.Layer {