fix(dashboard): UX polish pass 4 (trends 404 gate + zero-match Profiles count)

Final small UX polish pass for the stakeholder demo. Two renderer fixes.

C1 (primary): console 404 on data/trends.json

On load the dashboard fetched data/trends.json unconditionally. The renderer only emits that file when the analyzer had a previous run to compare against (Summary.HasTrendData -> JSON has_trend_data is true); the file is absent otherwise, so the browser logged a 404 (File not found) for data/trends.json. The empty state still rendered, but the 404 dirtied the console for any technical stakeholder who opens devtools.

Fix: the trends fetch is deferred into loadTrends() in src/00-header.js, which now runs after summary.json has loaded and short-circuits to Promise.resolve(null) when summary.has_trend_data is falsy or absent. When there is no trend data the file is never requested (no network call, hence no 404) and state.trends stays null. The existing renderTrendsTab() already renders the "No trends data yet" empty state whenever state.trends is null or empty, so the empty state still shows without the fetch. When has_trend_data is true the fetch runs exactly as before.

C2 (minor): Profiles zero-filter count badge

When a Profiles search or filter matched zero rows, updateProfileCount() in src/06-profiles.js blanked the #profiles-count badge while the table correctly showed "No team members match the current filters." The badge now reads "0 of profiles match" when there are profiles (it still blanks only when there are no profiles at all, where the table already explains the collector/analyzer state).

Validation

  • make static regenerated the bundle (app.src.js).
  • make check (no-race vet + test): pass.
  • CGO_ENABLED=1 go test -race ./...: pass.
  • golangci-lint run: 0 issues.
  • Coverage: 69.9% (gate is 65%).
  • Committed structural regression tests in internal/renderer/render_test.go: one asserts the trends.json fetch sits behind the has_trend_data guard and the old unconditional form is gone; one asserts the zero-match Profiles count branch emits a non-empty string. Both fail on the pre-fix bundle.

Coordinator does the visual browser verification.

🤖 Generated with Claude Code

Merge request reports

Loading