Skip to content

feat(programs): templatable rich content sections per program#153

Merged
sacha-l merged 1 commit into
developfrom
feat/program-content-sections
May 22, 2026
Merged

feat(programs): templatable rich content sections per program#153
sacha-l merged 1 commit into
developfrom
feat/program-content-sections

Conversation

@sacha-l
Copy link
Copy Markdown
Collaborator

@sacha-l sacha-l commented May 22, 2026

Summary

  • Adds a nullable content JSONB column to programs holding an ordered list of typed sections — reusable for every program without a per-section schema change.
  • Section types: text, steps, schedule, lineup (products with "what you'll try" + links), stats (LCD tiles), feedback (quote highlights), cta.
  • New ProgramContent renderer draws each section as an on-brand hardware panel (reuses LCDStat), placed right after the description on the program detail page.
  • Dogfooding Denver fixture populated as a worked template (future-tense, so it can be cloned for the next event), including the Typeform feedback highlights + a stats snapshot.

Files

  • supabase/migrations/20260522100000_program_content.sqlcontent jsonb (additive, idempotent)
  • server/api/repositories/program.repository.js — maps content both ways
  • server/api/utils/validation.jsvalidateProgramContent() (typed sections, size caps, http(s)-only URLs) wired into validateProgram
  • server/api/utils/__tests__/validation.test.js — 14 new tests
  • client/src/lib/api.tsProgramContentSection union + ApiProgram.content
  • client/src/components/program/ProgramContent.tsx — renderer
  • client/src/pages/ProgramDetailPage.tsx — renders content
  • client/src/lib/mockPrograms.ts — Denver content
  • docs/improvement-backlog.md — deferred admin editor logged

How to test in staging

Important

Vercel preview runs in mock mode (VITE_USE_MOCK_DATA=true), so the Denver content renders straight from the fixture — use the preview URL for visual review.
Real-API staging (Railway) needs the migration applied and the content column populated (no admin editor yet — seed/SQL). Until seeded, programs show no content panels (graceful, no error).

Test scenarios (verified locally in mock mode)

  • On /programs/dogfooding-2026-denver, all sections render: why-you're-here, what's-different, what-to-do (numbered), debrief, feedback-form CTA, schedule (5 rows), 4-product lineup with links, giving-good-feedback, stats snapshot (4 / 5/7 / All yes), 6 feedback quotes, raffle.
  • On /programs/dogfooding-2026-denver, the feedback CTA points at the Typeform URL.
  • On /programs/symbiosis-2025 (no content), no content panels render — no regression.
  • Server suite 285/285 pass; client build (typecheck) + lint clean.
  • Reviewer: confirm on the Vercel preview URL.

Notes

  • Feedback quote helper names were anonymized for the public page ("Matthew"/"Sasha" → "a teammate"/"an organiser").
  • Admin UI editing of content is deferred (backlog entry in this PR); content is currently authored via fixture (preview) or migration/seed (real API).

Add a nullable `content` JSONB column to programs holding an ordered list
of typed sections (text / steps / schedule / lineup / stats / feedback /
cta) rendered as on-brand panels on the program detail page. Reusable for
every program without a per-section schema change.

- supabase migration adds `content` (additive, idempotent)
- program.repository maps content both ways
- validateProgramContent enforces typed sections, size caps, http(s) URLs
- ProgramContent renderer reuses LCDStat for stat tiles
- Dogfooding Denver fixture populated as a worked template, incl. Typeform
  feedback highlights + stats snapshot
- admin UI editing of content logged to the improvement backlog (deferred)
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

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

Project Deployment Actions Updated (UTC)
stadium Ready Ready Preview, Comment May 22, 2026 1:03pm

@sacha-l sacha-l marked this pull request as ready for review May 22, 2026 13:59
@sacha-l sacha-l merged commit cb5bbc0 into develop May 22, 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