style: update About view credits format

This commit is contained in:
Jose Luis Montañes Ojados
2026-01-17 02:01:49 +01:00
parent 6ae4d39b92
commit 5ff7affd95

View File

@@ -22,6 +22,7 @@ const (
FocusChat FocusChat
FocusInput FocusInput
FocusUserView FocusUserView
FocusAbout
) )
// ListItem represents an item in the navigation tree (Channel or User) // ListItem represents an item in the navigation tree (Channel or User)
@@ -79,6 +80,7 @@ type Model struct {
// UI State // UI State
focus Focus focus Focus
lastFocus Focus // To return from About view
width, height int width, height int
channels []ChannelNode channels []ChannelNode
items []ListItem // Flattened list for navigation items []ListItem // Flattened list for navigation
@@ -560,7 +562,16 @@ func (m *Model) handleKeyPress(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
case "tab": case "tab":
// Cycle focus // Cycle focus
m.focus = (m.focus + 1) % 3 m.focus = (m.focus + 1) % 4 // FocusChannels, FocusChat, FocusInput, FocusUserView
return m, nil
case "f1":
if m.focus == FocusAbout {
m.focus = m.lastFocus
} else {
m.lastFocus = m.focus
m.focus = FocusAbout
}
return m, nil return m, nil
} }
@@ -570,8 +581,8 @@ func (m *Model) handleKeyPress(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
return m.handleInputKeys(msg) return m.handleInputKeys(msg)
} }
// 3. Global Shortcuts (Only when NOT in Input) // 3. Global Shortcuts (Only when NOT in Input or About)
if m.focus != FocusInput && m.focus != FocusUserView { if m.focus != FocusInput && m.focus != FocusUserView && m.focus != FocusAbout {
switch msg.String() { switch msg.String() {
case "q": case "q":
// Quit (same as ctrl+c) // Quit (same as ctrl+c)
@@ -649,6 +660,8 @@ func (m *Model) handleKeyPress(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
return m.handleChatKeys(msg) return m.handleChatKeys(msg)
case FocusUserView: case FocusUserView:
return m.handleUserViewKeys(msg) return m.handleUserViewKeys(msg)
case FocusAbout:
return m.handleAboutViewKeys(msg)
} }
return m, nil return m, nil
} }
@@ -657,6 +670,13 @@ func (m *Model) handleChatKeys(_ tea.KeyMsg) (tea.Model, tea.Cmd) {
return m, nil return m, nil
} }
func (m *Model) handleAboutViewKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
if msg.String() == "esc" || msg.String() == "f1" {
m.focus = m.lastFocus
}
return m, nil
}
func (m *Model) handleUserViewKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) { func (m *Model) handleUserViewKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
if m.viewUser == nil || m.audioPlayer == nil { if m.viewUser == nil || m.audioPlayer == nil {
if msg.String() == "esc" || msg.String() == "q" { if msg.String() == "esc" || msg.String() == "q" {
@@ -816,6 +836,10 @@ func (m *Model) handleInputKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
// View renders the UI // View renders the UI
func (m *Model) View() string { func (m *Model) View() string {
if m.focus == FocusAbout {
return m.renderAboutView()
}
if m.width == 0 { if m.width == 0 {
return "Loading..." return "Loading..."
} }
@@ -1203,3 +1227,35 @@ func (m *Model) renderUserView() string {
return lipgloss.JoinVertical(lipgloss.Left, info...) return lipgloss.JoinVertical(lipgloss.Left, info...)
} }
func (m *Model) renderAboutView() string {
titleStyle := lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("205")).
MarginBottom(1).
Align(lipgloss.Center)
boxStyle := lipgloss.NewStyle().
Border(lipgloss.RoundedBorder()).
BorderForeground(lipgloss.Color("62")).
Padding(2).
Width(60).
Align(lipgloss.Center)
mainContent := lipgloss.JoinVertical(lipgloss.Center,
titleStyle.Render("TS3 TUI CLIENT"),
lipgloss.NewStyle().Foreground(lipgloss.Color("250")).Render("Una terminal potente para tus comunidades."),
"",
lipgloss.NewStyle().Bold(true).Render("Hecho en Antigravity"),
"",
lipgloss.NewStyle().Bold(true).Render("Con la ayuda de:"),
lipgloss.NewStyle().Foreground(lipgloss.Color("212")).Render("- Gemini 3 Pro"),
lipgloss.NewStyle().Foreground(lipgloss.Color("212")).Render("- Claude Opus 4.5"),
"",
"",
lipgloss.NewStyle().Faint(true).Render("(Presiona ESC o F1 para volver)"),
)
// Center everything on screen
return lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center, boxStyle.Render(mainContent))
}