feat: centered footer + auth type toggle pills
- Status bar footer centered within terminal width using lipgloss.Width - Auth Type field replaced with toggle pills (password/key) Space/Enter/←/→ cycle between options on the focused field Selected type shown with SelectedStyle/TagStyle (green), inactive type shown in muted SubtitleStyle Help hint 'Space/←/→ to toggle' shown when focused - Added toggleAuthType() and cycleAuthType() helpers
This commit is contained in:
+12
-2
@@ -4,6 +4,7 @@ import (
|
||||
"strings"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
)
|
||||
|
||||
// Tab represents a single tab in the TUI
|
||||
@@ -194,8 +195,17 @@ func renderTabBar(tm *TabManager) string {
|
||||
return TabBarStyle.Render(bar)
|
||||
}
|
||||
|
||||
// renderStatusBar renders the bottom status bar
|
||||
// renderStatusBar renders the bottom status bar, centered
|
||||
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"
|
||||
return StatusBarStyle.Render(hints)
|
||||
rendered := StatusBarStyle.Render(hints)
|
||||
// Center within the terminal width
|
||||
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