Skip to content

Commit e4e0596

Browse files
cpcloudclaude
andcommitted
fix(ui): navigate to tab for insights with entity_id=0
Insights with a valid tab but entity_id=0 (group-level observations) were incorrectly marked InfoOnly, showing "house data, not in any tab" on Enter. Now they navigate to the tab without selecting a specific row. InfoOnly is reserved for insights with truly unrecognized tab names. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a2b420a commit e4e0596

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

internal/app/dashboard.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,9 +1099,6 @@ func (m *Model) dashInsightsRows() []dashRow {
10991099
ID: item.EntityID,
11001100
Section: dashSectionInsights,
11011101
}
1102-
if item.EntityID == 0 {
1103-
target.InfoOnly = true
1104-
}
11051102
}
11061103
rows = append(rows, dashRow{
11071104
Cells: []dashCell{

internal/app/dashboard_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,8 +1297,9 @@ func TestInsightsRows_WithItems(t *testing.T) {
12971297
assert.Equal(t, tabAppliances, rows[0].Target.Tab)
12981298
assert.Equal(t, uint(5), rows[0].Target.ID)
12991299
assert.False(t, rows[0].Target.InfoOnly)
1300-
// EntityID 0 should be InfoOnly (no specific entity to jump to).
1301-
assert.True(t, rows[1].Target.InfoOnly)
1300+
// EntityID 0 with a valid tab should still navigate to the tab.
1301+
assert.Equal(t, tabMaintenance, rows[1].Target.Tab)
1302+
assert.False(t, rows[1].Target.InfoOnly)
13021303
}
13031304

13041305
func TestInsightsSection_AppearsAfterResultMsg(t *testing.T) {

0 commit comments

Comments
 (0)