fix(tui): restore muted status bar, remove duplicate global keys from tab footers
This commit is contained in:
@@ -167,7 +167,7 @@ func (t *HostListTab) View() string {
|
|||||||
|
|
||||||
// Footer
|
// Footer
|
||||||
var footer styledRow
|
var footer styledRow
|
||||||
footerText := "[n]ew [e]dit [d]el [f]sftp [K]eygen [/]find [q]uit Ctrl+Tab:switch Ctrl+Q:close"
|
footerText := "[n]ew [e]dit [d]el [f]sftp [K]eygen [/]find [q]uit"
|
||||||
footer = styledRow{text: SubtitleStyle.Render(footerText), plain: footerText}
|
footer = styledRow{text: SubtitleStyle.Render(footerText), plain: footerText}
|
||||||
rows = append(rows, footer) // for widest measurement
|
rows = append(rows, footer) // for widest measurement
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ func (t *KeyListTab) View() string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
footerPlain := "Ctrl+N:add Ctrl+E:edit D:delete Esc:back Ctrl+Tab:switch Ctrl+Q:close"
|
footerPlain := "Ctrl+N:add Ctrl+E:edit D:delete Esc:back"
|
||||||
footer := styledRow{text: SubtitleStyle.Render(footerPlain), plain: footerPlain}
|
footer := styledRow{text: SubtitleStyle.Render(footerPlain), plain: footerPlain}
|
||||||
|
|
||||||
widestRow := lipgloss.Width(titlePlain)
|
widestRow := lipgloss.Width(titlePlain)
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ func (t *SFTPBrowserTab) View() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
b.WriteString("\n" + lipgloss.PlaceHorizontal(t.width, lipgloss.Center,
|
b.WriteString("\n" + lipgloss.PlaceHorizontal(t.width, lipgloss.Center,
|
||||||
SubtitleStyle.Render("Tab:switch ↑↓:nav /:filter C:copy D:delete N:mkdir R:refresh Esc:close Ctrl+Tab:switch Ctrl+Q:close")))
|
SubtitleStyle.Render("Tab:switch ↑↓:nav /:filter C:copy D:delete N:mkdir R:refresh Esc:close")))
|
||||||
|
|
||||||
return b.String()
|
return b.String()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ func (t *SnippetListTab) View() string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
footerPlain := "Ctrl+N:add Ctrl+E:edit D:delete Esc:back Ctrl+Tab:switch Ctrl+Q:close"
|
footerPlain := "Ctrl+N:add Ctrl+E:edit D:delete Esc:back"
|
||||||
footer := styledRow{text: SubtitleStyle.Render(footerPlain), plain: footerPlain}
|
footer := styledRow{text: SubtitleStyle.Render(footerPlain), plain: footerPlain}
|
||||||
|
|
||||||
widestRow := lipgloss.Width(titlePlain)
|
widestRow := lipgloss.Width(titlePlain)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
"github.com/charmbracelet/lipgloss"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Tab represents a single tab in the TUI
|
// Tab represents a single tab in the TUI
|
||||||
@@ -174,6 +175,10 @@ func (tm *TabManager) View() string {
|
|||||||
b.WriteString(content)
|
b.WriteString(content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Render status bar (muted, like tamagosh)
|
||||||
|
b.WriteString("\n")
|
||||||
|
b.WriteString(renderStatusBar(tm))
|
||||||
|
|
||||||
return b.String()
|
return b.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,4 +202,18 @@ func renderTabBar(tm *TabManager) string {
|
|||||||
return TabBarStyle.Render(bar)
|
return TabBarStyle.Render(bar)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// renderStatusBar renders the bottom status bar, centered — muted like tamagosh
|
||||||
|
func renderStatusBar(tm *TabManager) string {
|
||||||
|
hints := "Ctrl+Tab:switch Ctrl+Q:close ↑↓:nav Enter:SSH Ctrl+N:add Ctrl+F:SFTP Ctrl+K:keys Ctrl+P:snippets q:quit"
|
||||||
|
rendered := SubtitleStyle.Render(hints)
|
||||||
|
if tm.width > 0 {
|
||||||
|
w := lipgloss.Width(rendered)
|
||||||
|
if w < tm.width {
|
||||||
|
pad := (tm.width - w) / 2
|
||||||
|
rendered = strings.Repeat(" ", pad) + rendered
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rendered
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user