Skip to content

Publish the Toronto 2026 candidate questionnaire - #69

Merged
mikaalnaik merged 1 commit into
mainfrom
mikaal/hosted-survey-questions
Aug 24, 2026
Merged

Publish the Toronto 2026 candidate questionnaire#69
mikaalnaik merged 1 commit into
mainfrom
mikaal/hosted-survey-questions

Conversation

@mikaalnaik

Copy link
Copy Markdown
Contributor

Adds /toronto/vote/survey-questions, a page listing every question we ask Toronto's 2026 municipal candidates, so we can point people at our own URL instead of a Google Doc.

What's on the page

  • Stage One — five yes/no questions (housing, encampments, road pricing, infrastructure, transparency)
  • Stage Two — sixteen trilemmas across six sections, each with three labelled options
  • Additional questions — the ten O1–O10 questions

Content lives in questions.ts as typed data, so it's editable without touching layout. Styling follows the neighbouring /toronto/vote/get-involved page (theme-election, framed container, section grids).

Keeping it out of search

Two layers:

  1. Page metadata sets noindex, nofollow, nocache — verified in the served HTML.
  2. robots.ts disallows the path for * and for each AI crawler (GPTBot, ChatGPT-User, ClaudeBot, PerplexityBot). Those crawler rules had a blanket Allow: / with no disallow list, so they needed the path added explicitly.

The sitemap is a hand-maintained list, so the route never appears there.

PDF download

"Download PDF" calls window.print(), reusing the existing @media print rules in globals.css — the same approach ShareButtons already uses for memos. No new dependency.

Tradeoff worth knowing: this means the reader picks "Save as PDF" in the print dialog rather than getting a direct file download. A true one-click .pdf would need a PDF library or a headless-Chrome route. Happy to add that if we'd rather have it.

Verification

  • tsc --noEmit and eslint pass clean
  • Page renders in dev; confirmed all sections and both PDF buttons are present in the served HTML, and that the robots meta tag and robots.txt output are correct
  • Not visually reviewed — the browser extension wasn't connected, so the layout is unverified beyond content presence. Worth an eyeball on the preview deploy.

🤖 Generated with Claude Code

Adds /toronto/vote/survey-questions, a noindexed page listing every
question we ask Toronto's 2026 municipal candidates: five Stage One
yes/no questions, sixteen Stage Two trilemmas across six sections, and
ten additional questions.

The page is kept out of search results two ways: page metadata sets
noindex/nofollow/nocache, and robots.txt disallows the path for `*` as
well as for each AI crawler that previously had a blanket `Allow: /`.
It is not in the sitemap, which is a hand-maintained list.

"Download PDF" triggers the browser print dialog, reusing the existing
@media print rules in globals.css the same way memo sharing does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds a typed, static Toronto 2026 candidate-questionnaire page with print controls and explicit search-engine exclusion.

  • Defines the Stage One, Stage Two, and additional-question content in typed data.
  • Renders the questionnaire using the Toronto election theme and responsive section grids.
  • Adds page-level noindex metadata and crawler-specific robots exclusions.
  • Reuses the browser print dialog for PDF saving.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking print-layout issue that should be corrected so consecutive questions remain visually separated in saved PDFs.

The new route, crawler policy, metadata, and typed content are internally consistent; the only accepted issue is that the global print rule overrides the margins used to separate question articles.

Files Needing Attention: src/app/toronto/vote/survey-questions/page.tsx

Important Files Changed

Filename Overview
src/app/robots.ts Adds the questionnaire path to the wildcard and named AI-crawler disallow rules, consistent with the stated noindex policy.
src/app/toronto/vote/survey-questions/DownloadPdfButton.tsx Adds a client-side print control that is correctly hidden by the existing global print stylesheet.
src/app/toronto/vote/survey-questions/page.tsx Adds the complete responsive questionnaire presentation, but its article spacing is erased when the print stylesheet runs.
src/app/toronto/vote/survey-questions/questions.ts Defines the questionnaire as straightforward typed static data with the described five, sixteen, and ten-question groups.

Fix all with Greploop Fix All in Codex Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
src/app/toronto/vote/survey-questions/page.tsx:103
**Print removes question spacing**

When a visitor prints or saves the questionnaire as a PDF, the global print rule sets every `article` margin to zero with `!important`, overriding the `mt-10` and `mt-12` utilities and placing consecutive questions directly against the preceding option grids.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "Publish the Toronto 2026 candidate quest..." | Re-trigger Greptile

<span className="text-border-light mr-3">{number}</span>
{title}
</h3>
{questions.map(({ id: qid, question, options }) => (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Print removes question spacing

When a visitor prints or saves the questionnaire as a PDF, the global print rule sets every article margin to zero with !important, overriding the mt-10 and mt-12 utilities and placing consecutive questions directly against the preceding option grids.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/app/toronto/vote/survey-questions/page.tsx
Line: 103

Comment:
**Print removes question spacing**

When a visitor prints or saves the questionnaire as a PDF, the global print rule sets every `article` margin to zero with `!important`, overriding the `mt-10` and `mt-12` utilities and placing consecutive questions directly against the preceding option grids.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex Fix in Claude Code

@mikaalnaik
mikaalnaik merged commit 6ef8ca4 into main Aug 24, 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