feat: add shimmer text rendering (#2027)

This commit is contained in:
Ytzhak
2025-08-18 06:55:01 -04:00
committed by GitHub
parent cd3d91209a
commit 667ff90dd6
5 changed files with 201 additions and 6 deletions

View File

@@ -339,6 +339,7 @@ func (m *editorComponent) Content() string {
t := theme.CurrentTheme()
base := styles.NewStyle().Foreground(t.Text()).Background(t.Background()).Render
muted := styles.NewStyle().Foreground(t.TextMuted()).Background(t.Background()).Render
promptStyle := styles.NewStyle().Foreground(t.Primary()).
Padding(0, 0, 0, 1).
Bold(true)
@@ -381,9 +382,11 @@ func (m *editorComponent) Content() string {
status = "waiting for permission"
}
if m.interruptKeyInDebounce && m.app.CurrentPermission.ID == "" {
hint = muted(
status,
) + m.spinner.View() + muted(
bright := t.Accent()
if status == "waiting for permission" {
bright = t.Warning()
}
hint = util.Shimmer(status, t.Background(), t.TextMuted(), bright) + m.spinner.View() + muted(
" ",
) + base(
keyText+" again",
@@ -391,7 +394,11 @@ func (m *editorComponent) Content() string {
" interrupt",
)
} else {
hint = muted(status) + m.spinner.View()
bright := t.Accent()
if status == "waiting for permission" {
bright = t.Warning()
}
hint = util.Shimmer(status, t.Background(), t.TextMuted(), bright) + m.spinner.View()
if m.app.CurrentPermission.ID == "" {
hint += muted(" ") + base(keyText) + muted(" interrupt")
}