Skip to content

Add standalone poll pages and fix wide-screen article layout - #76

Merged
xrendan merged 11 commits into
mainfrom
codex/poll-publication
Sep 6, 2026
Merged

Add standalone poll pages and fix wide-screen article layout#76
xrendan merged 11 commits into
mainfrom
codex/poll-publication

Conversation

@xrendan

@xrendanxrendan commented Sep 6, 2026

Copy link
Copy Markdown
Member

Adds /polls and /polls/:slug backed by York Factory’s separate poll API. Polls reuse memo article presentation, including key takeaways, sharing, subscriptions and table of contents. PDF, JSON and Excel text downloads sit below share icons, with access-checked proxies and fresh generated-file availability. Inline buildcanada-chart fences support interactive controls and searchable data tables using the published charts 1.x package.

The shared article container preserves a 720px reading column on wide screens through fixed outer gutters and a centered grid. Poll routes use Build Canada | Polling branding based on the Toronto wordmark layout; both section labels use white text and integrated navigation borders. Builders is removed from navigation.

Adds /feeds/all.xml, /feeds/memos.xml, /feeds/posts.xml and /feeds/polls.xml as public York Factory RSS proxies. The document head advertises the public all/memos/posts feeds; the combined proxy excludes polls and the poll feed requires an admin session. Proxies never forward preview credentials and return generic errors for unavailable upstream feeds.

Validation: 9 chart/download tests and 4 RSS proxy tests pass, along with TypeScript and targeted ESLint. Local checks confirm all four RSS routes, discovery metadata on index/detail pages, branded downloads, interactive charts and article layouts across mobile/wide screens. Companion backend: BuildCanada/york_factory#123; Surveyor: BuildCanada/surveyor#53. Deploy backend migrations/API first.

Polls are currently administrator-only on TradingPost. Live identity checks protect index/detail rendering, metadata, markdown aliases and downloads. Non-admin visitors see an access page with a login link; navigation hides Polls until admin status is confirmed. Polls are removed from sitemap and indexing. Validation includes 18 local requests across anonymous, member and admin sessions, public feed exclusion, browser login/navigation checks, TypeScript, ESLint and RSS proxy tests.

@greptile-apps

greptile-appsBot commented Sep 6, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds administrator-only standalone poll pages, localized report proxies, inline charts, RSS proxies, and a shared constrained article layout.

  • Adds poll list/detail, metadata, markdown, download, access-control, and branding flows.
  • Adds interactive inline-chart parsing and presentation.
  • Adds RSS proxy routes and feed discovery metadata.
  • Refactors memo, post, and Toronto memo pages onto shared article components.
  • Constrains article content to a centered reading column on wide screens.

Confidence Score: 4/5

The PR is not yet safe to merge because localized crosstabs PDF downloads remain unavailable from the poll page.

The API contract and proxy support crosstabs_pdf, including localized assets, but PollDownloads still does not read or render that stable display key, leaving the previously reported download omission outstanding.

Files Needing Attention: src/components/content/PollDetails.tsx

Important Files Changed

FilenameOverview
src/components/content/ArticlePage.tsxCentralizes shared memo and poll metadata, fetching, access handling, and article presentation.
src/components/content/ArticleLayout.tsxIntroduces fixed outer gutters and a centered desktop grid with a constrained reading column.
src/components/content/PollDetails.tsxPresents poll downloads and supporting methodology/news-release content.
src/lib/polls/downloads.tsPreserves stable display keys while rewriting localized upstream download URLs through the protected proxy.
src/app/api/polls/[slug]/downloads/[asset]/route.tsAdds an administrator-protected, allowlisted, no-store proxy for generated poll files.
src/lib/charts/inline-chart.tsValidates and converts embedded poll chart definitions and datasets for interactive rendering.
src/app/feeds/[feed]/route.tsProxies York Factory RSS feeds with content-type validation, caching boundaries, and restricted poll-feed access.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Administrator] --> P[Poll routes]
P --> C[Live access check]
C --> Y[York Factory poll API]
Y --> D[Localized downloads]
D --> X[Access-checked download proxy]
Y --> B[Shared article presentation]
B --> H[Inline charts]
B --> L[Constrained reading layout]
Loading

Reviews (7): Last reviewed commit: "Simplify restricted poll login message" | Re-trigger Greptile

Comment threadsrc/components/content/PollDetails.tsx Outdated
@xrendanxrendan changed the title Render poll publications and inline interactive charts on memo pagesAdd standalone poll pages and fix wide-screen article layoutSep 6, 2026
@xrendan
xrendan merged commit 0bd1be1 into mainSep 6, 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