Finish settings TODO cleanup

This commit is contained in:
2026-05-18 10:05:26 +01:00
parent cadd4c8f64
commit f10598601f
8 changed files with 131 additions and 86 deletions

View File

@@ -64,6 +64,7 @@ func (st *uiState) drawTabBar() {
label string
active bool
}
activeTab := -1
// Reserve space at the right edge for "+ new". If there are too
// many tabs to fit even at minTabWidth, drop tabs from the right
@@ -134,6 +135,9 @@ func (st *uiState) drawTabBar() {
label: label,
active: c.ID == focus,
})
if tabs[len(tabs)-1].active {
activeTab = len(tabs) - 1
}
col += w
}
}
@@ -195,8 +199,12 @@ func (st *uiState) drawTabBar() {
hintCol, styleBorder, strings.Repeat("─", newHintW), styleReset)
}
if summary := st.activeSummaryText(width - 2); summary != "" {
fmt.Fprintf(&b, "\x1b[2;1H %s%s%s", styleDim, summary, styleReset)
if activeTab >= 0 {
tab := tabs[activeTab]
summaryWidth := tab.width - 2
if summary := st.activeSummaryText(summaryWidth); summary != "" {
fmt.Fprintf(&b, "\x1b[2;%dH %s%s%s", tab.startCol, styleDim, summary, styleReset)
}
}
frame := b.String()