Skip to content

fix(results-panel): correct feedback charts, insights, and add refresh#199

Merged
sacha-l merged 1 commit into
developfrom
fix/feedback-panel-display-bugs
Jun 25, 2026
Merged

fix(results-panel): correct feedback charts, insights, and add refresh#199
sacha-l merged 1 commit into
developfrom
fix/feedback-panel-display-bugs

Conversation

@sacha-l

@sacha-l sacha-l commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Five bugs fixed in the completed-program results panel (ProgramResultsSummarySection):

1. Y-axis labels unreadable

deadlineStatus options are full sentences (up to 57 chars); the fixed YAxis width={90} was truncating them to garbage. Now computed dynamically from the longest label (min(160, max(80, longestLabel × 5.4)px)) with a tickFormatter that adds for anything that still doesn't fit. Tooltip shows the full text on hover.

2. Duplicate entries / wrong chart type for biggestBlocker

biggestBlocker is a single-select field with fixed options, but aggregateFeedback used textSamples() (raw string collection). Two respondents choosing the same option appeared as two identical list entries. Fixed to tally() — now a bar chart showing counts per option. Server change: program-submission.repository.js.

3. "0% plan to continue building" (always wrong)

buildFeedbackInsights was looking for keepCounts["yes"] / keepCounts["maybe"] but the actual stored values are "Yes, already planning to" / "Maybe". Same mismatch on deadlineStatus — checked for "comfortable" / "tight" / "too tight" but real options are full sentences. Both insight calculations always returned 0. Fixed with /^yes/i / /^maybe/i regex matching and pattern detection on deadline outcome strings.

4. couldntHandle free-text collected but never shown

couldntHandleSamples was aggregated server-side but absent from the UI. Added a ·WHAT BITREFILL COULDN'T HANDLE (OPEN TEXT) section below the charts.

5. Stale data after score re-save

Leaderboard was loaded once on mount. If a judge re-saved scores, the panel showed old values until page refresh. Added a ↺ REFRESH button (top-right of the section header) that re-triggers the data fetch without a full page reload.

Also: mock data updated

getFeedbackAggregate mock now uses real Bitrefill option strings so dev:harness exercises the same code paths as production and would have caught bugs 2 and 3 above.

Test plan

  • cd client && npm run build
  • cd server && npm test ✓ (439/439)
  • In dev:harness: all 6 charts render, Y-axis labels truncated but readable, insight prose shows real %, "WHAT COULDN'T BITREFILL HANDLE" section visible, ↺ REFRESH reloads
  • In production: same checks with live data after merge

- biggestBlocker: tally() not textSamples() (it is a single-select field,
  not free text) — removes duplicates and enables a proper bar chart
- buildFeedbackInsights: pattern-match option strings instead of hardcoded
  short keys; actual stored values are 'Yes, already planning to'/'Maybe',
  not 'yes'/'maybe'; same fix for deadlineStatus (full sentence options, not
  'comfortable'/'tight')
- FeedbackChart: dynamic YAxis width computed from longest label (max 160px)
  + tickFormatter truncation so long option strings are readable
- Layout: 6-chart grid (adds surfacesPrimary + biggestBlocker); replaces the
  old 'BIGGEST BLOCKERS' text list; adds 'WHAT COULDN'T BITREFILL HANDLE'
  for couldntHandle free-text responses
- Refresh button: increments refreshTick dep so leaderboard/stats/feedback
  can be reloaded after score re-saves without a full page refresh
- Mock data: updated to use real Bitrefill option strings so dev:harness
  exercises the same code paths as production
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stadium Ready Ready Preview, Comment Jun 25, 2026 6:11pm

@sacha-l

sacha-l commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Stadium UI verification — http://localhost:8080 (dev:harness)

Scenarios: 5 total, 5 pass, 0 fail, 0 skipped

# Scenario Result Notes
1 RESULTS SUMMARY heading and ↺ REFRESH button visible PASS both elements rendered immediately after admin data loads
2 6 feedback charts all rendered PASS WHERE DID YOU LAND?, WOULD KEEP BUILDING, AGENT ENVIRONMENT, SURFACES USED, PRIMARY SURFACE, BIGGEST BLOCKER all visible
3 Insight prose does not say "0% plan" PASS observed: "89% plan to keep building. 29% completed a full autonomous purchase. Top blocker: …"
4 WHAT BITREFILL COULDN'T HANDLE (OPEN TEXT) section visible with entries PASS section present, mock bullets rendered
5 REFRESH button reloads and restores panel PASS heading persists through reload, button returns to ↺ REFRESH state

Preview mode: window.STADIUM_MOCK = true
Console errors during run: 0
Recommended next action: continue to PR → merge to develop → promote to main

@sacha-l sacha-l merged commit a0988e9 into develop Jun 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant