feat(tui): persist bottom panel preference across restarts

Save bottom_panel pref (logs/maint/none) to store on toggle.
Restore on startup via InitialModel, same pattern as detail_open.
This commit is contained in:
2026-07-01 21:02:45 -04:00
parent a32a443a4a
commit 14cec4283d
3 changed files with 28 additions and 1 deletions
+15
View File
@@ -50,6 +50,21 @@ func writeCmd(op string, fn func() error) tea.Cmd {
}
}
func (m *Model) saveBottomPanelPref() tea.Cmd {
v := "logs"
switch m.bottomPanel {
case bottomNone:
v = "none"
case bottomMaint:
v = "maint"
}
st := m.store
ctx := m.ctx
return writeCmd("Save bottom panel preference", func() error {
return st.SetPreference(ctx, "bottom_panel", v)
})
}
func sortSitesForDisplay(allSites []models.Site, collapsed map[int]bool, sortCol int, sortAsc bool) []models.Site {
var groups, ungrouped []models.Site
children := make(map[int][]models.Site)