Skip to content

Refine poll headers, Markdown takeaways and demographic chart data - #78

Merged
xrendan merged 3 commits into
mainfrom
codex/key-takeaways-markdown
Sep 8, 2026
Merged

Refine poll headers, Markdown takeaways and demographic chart data#78
xrendan merged 3 commits into
mainfrom
codex/key-takeaways-markdown

Conversation

@xrendan

@xrendanxrendan commented Sep 8, 2026

Copy link
Copy Markdown
Member

Poll pages now show a tighter publication header and let readers explore demographic results directly beneath each chart.

  • Remove poll authors from the visible page and browser print header, enlarge the date, and reduce header spacing.
  • Show an optional italic subtitle below the title, with compact spacing above the date.
  • Render Markdown in poll key takeaways and memo key messages while preserving numbering.
  • Improve chart tooltips and fetch crosstabs on View data, matching charts to question IDs. Use the BCDS demographic dropdown and simplified demographic titles; omit unknown categories and suppress values with fewer than 50 respondents.
  • Widen tables only when their columns need the space, keep prose readable, and move the sidebar left on laptop screens.

Validation: TypeScript, ESLint for affected components and libraries, all 14 poll tests, and git diff checks pass. Based on latest main.

The optional subtitle requires the companion York Factory subtitle migration/API changes, which remain local; it stays hidden until the API provides a value. Customer download suppression is handled by York Factory PR #125, with defensive suppression in these frontend tables.

@xrendanxrendan changed the title Support Markdown in key takeawaysRefine poll headers, Markdown takeaways and demographic chart dataSep 8, 2026
@greptile-apps

greptile-appsBot commented Sep 8, 2026

Copy link
Copy Markdown

Greptile Summary

Poll publication pages now use a compact author-free header, support optional subtitles and Markdown takeaways, and expose crosstab data beneath inline charts.

  • Adds exact question-ID matching, localized breakdown labels, unknown-category filtering, and defensive suppression for samples below 50.
  • Uses a generic “Breakdown” selector so demographic, question-based, and survey-arm dimensions are no longer mislabeled.
  • Updates poll layout, chart tooltips, table sizing, documentation, tests, and the shared component dependency.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

FilenameOverview
src/components/content/PollChartData.tsxAdds lazy crosstab loading and a generic breakdown selector, resolving the previous inaccurate demographic label.
src/lib/polls/crosstabs.tsValidates crosstab exports, matches exact question IDs, filters unknown categories, and suppresses columns with insufficient bases.
src/components/content/InlineChart.tsxIntegrates the shared tooltip and switches View data to crosstabs when an authenticated download URL is available.
src/components/content/ArticlePage.tsxApplies poll-specific headers and layout, renders key messages as Markdown, and passes crosstab URLs into article charts.
src/app/memos/[slug]/MemoHero.tsxAdds optional subtitles and a compact poll variant that omits author and supporter presentation.
src/lib/api/articles.tsNormalizes the optional poll subtitle at the API boundary.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Poll article chart] --> B[View data]
B --> C[Authenticated crosstabs download]
C --> D[Parse and suppress bases below 50]
D --> E[Match table by question ID]
E --> F[Choose breakdown]
F --> G[Render overall and selected columns]
Loading

Reviews (2): Last reviewed commit: "Label all crosstab comparisons as breakd..." | Re-trigger Greptile

Comment threadsrc/components/content/PollChartData.tsx Outdated
@xrendan
xrendan merged commit edc5084 into mainSep 8, 2026
2 checks passed
Sign up for freeto 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

@xrendan