Skip to content

Commit 6853d20

Browse files
cpcloudclaude
andcommitted
fix(insights): show cached items during refresh, sanitize error text
- Remove loading guard from dashInsightsRows so cached insight items remain visible while a refresh is in-flight (spinner still shows on the header line). - Strip ANSI escapes and take only the first line of error messages before rendering in the dashboard overlay to prevent layout breakage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8f8e48b commit 6853d20

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

internal/app/dashboard.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,8 @@ func (m *Model) dashboardView(budget, maxWidth int) string {
624624
case insLoading:
625625
lines[insightsHeaderLine] += " " + m.dash.spinner.View()
626626
case insError:
627-
msg := m.styles.DashSubtitle().Render(" unavailable: " + ins.err.Error())
627+
errText, _, _ := strings.Cut(ansi.Strip(ins.err.Error()), "\n")
628+
msg := m.styles.DashSubtitle().Render(" unavailable: " + errText)
628629
lines = slices.Insert(lines, insightsHeaderLine+1, msg)
629630
default:
630631
if s := m.insightsStaleness(); s != "" {
@@ -1152,7 +1153,7 @@ func tabAbbrev(tab string) string {
11521153
// dashInsightsRows returns dashboard rows for the insights section.
11531154
func (m *Model) dashInsightsRows() []dashRow {
11541155
ins := m.dash.insights
1155-
if ins.loading || len(ins.items) == 0 {
1156+
if len(ins.items) == 0 {
11561157
return nil
11571158
}
11581159
rows := make([]dashRow, 0, len(ins.items))

0 commit comments

Comments
 (0)