From f2b6e373ff54166baf5fdd9fd50db443457da264 Mon Sep 17 00:00:00 2001 From: balaji j Date: Sat, 27 Jun 2026 11:24:33 -0700 Subject: [PATCH 1/3] add message and message rendering Signed-off-by: balaji j --- internal/app/ui/components/status.go | 29 +++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/internal/app/ui/components/status.go b/internal/app/ui/components/status.go index d6b8eb5..3558eb7 100644 --- a/internal/app/ui/components/status.go +++ b/internal/app/ui/components/status.go @@ -7,8 +7,17 @@ import ( "charm.land/lipgloss/v2" ) -// StatusModel manages the status bar and the executing spinner. +// MessageUpdateMsg is used to update the message in the status bar +type MessageUpdateMsg struct { + Message string +} + +// MessageResetMsg is used to reset the message in the status bar +type MessageResetMsg struct{} + +// StatusModel manages the status bar and the executing spinner type StatusModel struct { + Message string Version string Width int IssueLink string @@ -32,6 +41,10 @@ func (m StatusModel) Update(msg tea.Msg) (StatusModel, tea.Cmd) { switch msg := msg.(type) { case tea.WindowSizeMsg: m.Width = msg.Width + case MessageUpdateMsg: + m.Message = msg.Message + case MessageResetMsg: + m.Message = "" } return m, cmd } @@ -63,7 +76,14 @@ func (m StatusModel) View() string { } padding := strings.Repeat(" ", paddingWidth) - statusBar := m.StatusBarStyle.Width(m.Width).Render(name + padding + link) + firstLine := m.StatusBarStyle.Faint(true).Render(m.Message) + secondLine := m.StatusBarStyle.Render(lipgloss.Sprintf("%s%s%s", name, padding, link)) + + statusBar := lipgloss.JoinVertical( + lipgloss.Top, + firstLine, + secondLine, + ) return lipgloss.JoinVertical( lipgloss.Top, @@ -75,8 +95,7 @@ func (m StatusModel) View() string { // StaticHeight returns the height of the footer. func (m StatusModel) StaticHeight() int { separator := m.SeparatorStyle.Render(strings.Repeat("─", m.Width)) - statusBar := m.StatusBarStyle.Width(m.Width).Render("pgxcli " + m.Version) - // Top separator + Bottom separator + Status bar - return lipgloss.Height(separator)*2 + lipgloss.Height(statusBar) + // Top separator + Bottom separator + message line + version line + return lipgloss.Height(separator)*2 + 2 } From 54c4af0643867ee1bead2e2a4b7d0a98b64a55cd Mon Sep 17 00:00:00 2001 From: balaji j Date: Sat, 27 Jun 2026 11:25:13 -0700 Subject: [PATCH 2/3] send message to the status bar dynamically Signed-off-by: balaji j --- internal/app/ui/model.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/app/ui/model.go b/internal/app/ui/model.go index 783644b..cec9a52 100644 --- a/internal/app/ui/model.go +++ b/internal/app/ui/model.go @@ -182,6 +182,7 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case seqTimeoutMsg: if msg.seq == m.pendingSeq { + m.statusModel, _ = m.statusModel.Update(components.MessageResetMsg{}) // reset status message m.state = StateInput } return m, nil @@ -218,6 +219,7 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.state = StatePendingQuit m.pendingSeq++ n := m.pendingSeq + m.statusModel, _ = m.statusModel.Update(components.MessageUpdateMsg{Message: "Press Ctrl+C again to quit"}) return m, tea.Tick(500*time.Millisecond, func(t time.Time) tea.Msg { return seqTimeoutMsg{seq: n} }) @@ -234,6 +236,7 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.state = StatePendingClear m.pendingSeq++ n := m.pendingSeq + m.statusModel, _ = m.statusModel.Update(components.MessageUpdateMsg{Message: "Press ESC again to clear"}) return m, tea.Tick(500*time.Millisecond, func(t time.Time) tea.Msg { return seqTimeoutMsg{seq: n} }) From 16690c17f3f69b1088a431d87e8bf551ec93572e Mon Sep 17 00:00:00 2001 From: balaji j Date: Sat, 27 Jun 2026 11:25:41 -0700 Subject: [PATCH 3/3] remove background for the status bar style Signed-off-by: balaji j --- internal/app/ui/styles.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/app/ui/styles.go b/internal/app/ui/styles.go index 2a10f75..79d71a4 100644 --- a/internal/app/ui/styles.go +++ b/internal/app/ui/styles.go @@ -49,7 +49,6 @@ func DefaultStyles() Styles { Faint(true), StatusBar: lipgloss.NewStyle(). Foreground(lipgloss.Color("#C4B5FD")). - Background(lipgloss.Color("#2A273F")). Padding(0, 1), ClampNotice: lipgloss.NewStyle(). Foreground(lipgloss.Color("#A78BFA")).