feat: refactor TUI with read-only info view and optimized layout

- Add new 'i' command for read-only host information display
- Implement info view with option to switch to edit mode (e/Enter)
- Hide User and Port columns to optimize table space usage
- Improve table height calculation for better host visibility
- Add proper message handling for info view navigation
- Interface optimization
This commit is contained in:
2025-09-04 16:47:07 +02:00
parent 2ade315ddc
commit 1cea3795e4
8 changed files with 469 additions and 52 deletions

View File

@@ -42,6 +42,7 @@ type Styles struct {
FormContainer lipgloss.Style
Label lipgloss.Style
FocusedLabel lipgloss.Style
HelpSection lipgloss.Style
}
// NewStyles creates a new Styles struct with the given terminal width
@@ -88,8 +89,7 @@ func NewStyles(width int) Styles {
Foreground(lipgloss.Color(SecondaryColor)),
HelpText: lipgloss.NewStyle().
Foreground(lipgloss.Color(SecondaryColor)).
MarginTop(1),
Foreground(lipgloss.Color(SecondaryColor)),
// Error style
Error: lipgloss.NewStyle().
@@ -118,8 +118,10 @@ func NewStyles(width int) Styles {
Foreground(lipgloss.Color(SecondaryColor)),
FocusedLabel: lipgloss.NewStyle().
Foreground(lipgloss.Color(PrimaryColor)).
Bold(true),
Foreground(lipgloss.Color(PrimaryColor)),
HelpSection: lipgloss.NewStyle().
Padding(0, 2),
}
}