Uh oh!
There was an error while loading. Please reload this page.
Add standalone poll pages and fix wide-screen article layout - #76
Conversation
Greptile SummaryThe PR adds administrator-only standalone poll pages, localized report proxies, inline charts, RSS proxies, and a shared constrained article layout.
Confidence Score: 4/5The PR is not yet safe to merge because localized crosstabs PDF downloads remain unavailable from the poll page. The API contract and proxy support Files Needing Attention: src/components/content/PollDetails.tsx
|
| Filename | Overview |
|---|---|
| src/components/content/ArticlePage.tsx | Centralizes shared memo and poll metadata, fetching, access handling, and article presentation. |
| src/components/content/ArticleLayout.tsx | Introduces fixed outer gutters and a centered desktop grid with a constrained reading column. |
| src/components/content/PollDetails.tsx | Presents poll downloads and supporting methodology/news-release content. |
| src/lib/polls/downloads.ts | Preserves stable display keys while rewriting localized upstream download URLs through the protected proxy. |
| src/app/api/polls/[slug]/downloads/[asset]/route.ts | Adds an administrator-protected, allowlisted, no-store proxy for generated poll files. |
| src/lib/charts/inline-chart.ts | Validates and converts embedded poll chart definitions and datasets for interactive rendering. |
| src/app/feeds/[feed]/route.ts | Proxies 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]
Reviews (7): Last reviewed commit: "Simplify restricted poll login message" | Re-trigger Greptile
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.