feat(programs): templatable rich content sections per program#153
Merged
Conversation
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)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
contentJSONB column toprogramsholding an ordered list of typed sections — reusable for every program without a per-section schema change.text,steps,schedule,lineup(products with "what you'll try" + links),stats(LCD tiles),feedback(quote highlights),cta.ProgramContentrenderer draws each section as an on-brand hardware panel (reusesLCDStat), placed right after the description on the program detail page.Files
supabase/migrations/20260522100000_program_content.sql—content jsonb(additive, idempotent)server/api/repositories/program.repository.js— mapscontentboth waysserver/api/utils/validation.js—validateProgramContent()(typed sections, size caps, http(s)-only URLs) wired intovalidateProgramserver/api/utils/__tests__/validation.test.js— 14 new testsclient/src/lib/api.ts—ProgramContentSectionunion +ApiProgram.contentclient/src/components/program/ProgramContent.tsx— rendererclient/src/pages/ProgramDetailPage.tsx— renders contentclient/src/lib/mockPrograms.ts— Denver contentdocs/improvement-backlog.md— deferred admin editor loggedHow 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
contentcolumn populated (no admin editor yet — seed/SQL). Until seeded, programs show no content panels (graceful, no error).Test scenarios (verified locally in mock mode)
/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./programs/dogfooding-2026-denver, the feedback CTA points at the Typeform URL./programs/symbiosis-2025(no content), no content panels render — no regression.Notes
contentis deferred (backlog entry in this PR); content is currently authored via fixture (preview) or migration/seed (real API).