fix(tui): cleanup modal visuals

This commit is contained in:
adamdottv 2025-06-22 06:09:23 -05:00
parent 3ea2daaa4c
commit dc1947838c
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
4 changed files with 97 additions and 192 deletions

View file

@ -103,13 +103,13 @@ func (m *Modal) Render(contentView string, background string) string {
Bold(true).
Padding(0, 1)
escStyle := baseStyle.Foreground(t.TextMuted()).Bold(false)
escStyle := baseStyle.Foreground(t.TextMuted())
escText := escStyle.Render("esc")
// Calculate position for esc text
titleWidth := lipgloss.Width(m.title)
escWidth := lipgloss.Width(escText)
spacesNeeded := max(0, innerWidth-titleWidth-escWidth-3)
spacesNeeded := max(0, innerWidth-titleWidth-escWidth-2)
spacer := strings.Repeat(" ", spacesNeeded)
titleLine := m.title + spacer + escText
titleLine = titleStyle.Render(titleLine)