Skip to content

Add admin experimental condition analytics#24

Open
Spbd1 wants to merge 1 commit into
codex/add-google-sheets-webhook-for-submissionsfrom
codex/improve-admin-dashboard-analytics
Open

Add admin experimental condition analytics#24
Spbd1 wants to merge 1 commit into
codex/add-google-sheets-webhook-for-submissionsfrom
codex/improve-admin-dashboard-analytics

Conversation

@Spbd1

@Spbd1 Spbd1 commented May 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Surface useful summaries for the new experimental conditions (revision access, reveal timing, memory distortion, cost visibility, explanation frame, replay) on the protected admin dashboard.
  • Include the new experimental fields in the CSV export and ensure older submissions without those fields do not break exports or dashboard rendering.

Description

  • Extended the server-side admin aggregation (lib/adminSubmissions.ts) by adding many new AdminStats fields and computing counts/averages/percentages for revision, delayed reveal, memory distortion, cost visibility, explanation frame, and replay-related metrics while ignoring missing legacy fields in averages.
  • Added CSV export columns for all requested fields (e.g. revision_condition, attempted_pre_reveal_revision, used_revision_opportunity, revision_magnitude, reveal_timing_condition, stand_by_initial_interpretation, cost_visibility_condition, explanation_frame_condition, remembered_responsibility_error, remembered_constraint_suspicion_error, remembered_primary_attribution_matches_original, memory_distortion_magnitude, replay_completed, replay_assignment_condition, behavior_change_care_avoidance, etc.) and implemented a payloadColumn fallback so values from alternate (older) paths or missing fields export as blank instead of failing.
  • Updated the admin UI (components/admin/AdminDashboard.tsx) to render compact tables/cards for the new experimental summaries via a new MetricSection component and experimentSections configuration, plus small formatting helpers (formatExperimentValue) to display counts, averages, and percentage values.
  • Kept existing admin features (token-based stats fetch, JSON/CSV downloads, recent submissions table) intact and made the new stats tolerant of legacy submissions (blank/null outputs).

Testing

  • Ran npm run typecheck and it completed successfully.
  • Ran npm run lint and it completed successfully but with the pre-existing React Hook dependency warning in components/ParticipantBackgroundForm.tsx.
  • Ran npm run build and the Next.js production build completed successfully (static pages generated and app compiled).

Files changed: lib/adminSubmissions.ts, components/admin/AdminDashboard.tsx.


Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant