Skip to content

feat(calendar): preview the home page button before 1 December when signed in - #64

Merged
maxitect merged 3 commits into
feat/60-calendar-lo-c-s-round-of-changes-before-1-decemberfrom
feat/62-calendar-preview-the-home-page-button-before-1
Nov 26, 2026
Merged

maxitect merged 3 commits into
feat/60-calendar-lo-c-s-round-of-changes-before-1-decemberfrom
feat/62-calendar-preview-the-home-page-button-before-1

Conversation

@maxitect

@maxitect maxitect commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds a CalendarSettings checkbox that lets someone signed in to the Payload admin see the home page calendar button before 1 December. The public sees nothing different until then.

Changes

  • New checkbox behaviour.previewButton in the calendar settings, off by default, with migration 20261126_193319_calendar_preview_button (one nullable-default boolean column).
  • New GET /api/calendar/button returns { show }: true only for a signed-in member when the checkbox is on. no-store.
  • CalendarButton still decides the 1 to 24 December season in the browser. Before 1 December it asks that route once (never during or after the season) and shows the button when show is true.

Acceptance criteria

AC Result Method Evidence
Checkbox on, signed-in user sees the button on / in FR and EN before 1 Dec PASS browser AC1 below
Checkbox off, signed-in user sees no button before 1 Dec PASS browser AC2 below
Not signed in: no button before 1 Dec, checkbox on or off PASS browser AC1, AC2 below
From 1 Dec everyone sees the button whatever the checkbox says PASS browser AC4 below
Home page not made dynamic for everyone PASS, with a cost cli AC5 below
Migration runs cleanly on a Neon branch; no console errors or CSP violations on / PASS db, browser AC6 below

Closes

Closes #62

Notes

  • Stacked on Calendar: Loïc's round of changes before 1 December #60 (PR feat(calendar): apply Loic's changes before the 1 December opening #63): both add a CalendarSettings migration, and this branch is based on it.
  • / stays static (○). The cost: until 1 December every home page visit makes one small request to /api/calendar/button, which is a function call, because the Payload session cookie is httpOnly and cannot be read in the browser. From 1 December the request is no longer made.
  • Proof ran on a throwaway Neon branch t62-proof (child of preview) with a throwaway admin user, since deleted. The branch itself is left for you to delete; I did not run the app against preview or dev.
  • After merge, and after Calendar: Loïc's round of changes before 1 December #60's: run payload migrate against the main Neon branch. The deploy preview build applies it to preview.
  • The Netlify toolbar CSP error is Netlify's own on preview pages, not ours.

Review

Verdict: ALL CLEAR
Rounds: 2

Finding Severity Resolution
Member check ran on every home visit after 24 December, and showed members the button then warning fixed in 6a4ebdf
No Netlify deploy preview (Netlify builds previews only for PRs into main; this PR is stacked on #63) critical closed: not needed, user decision

Re-verified on the rebased tree (main 2c25ab7, then #60, then #62), next start build on a Neon branch from preview with #62's migration applied after #60's: AC1 (browser) PASS, AC2 (browser) PASS, AC3 (browser) PASS, AC4 (browser, 2 Dec; 26 Dec shows no button and makes no request) PASS, AC5 (cli, / is ○) PASS, AC6 (db, 20261126_193319_calendar_preview_button migrated in batch 6, behaviour_preview_button boolean default false; browser, 0 console errors on /) PASS · check.sh PASS

Evidence

AC1 and AC2 and AC4 (production build, port 4062, Playwright with real clock 26 Nov 2026; "2 Dec" uses a faked clock)

flag=on member EN 26 Nov   button: 1 The advent calendar -> /calendar          errors: 0
flag=on public EN 26 Nov   button: 0                                            errors: 0
flag=on member FR 26 Nov   button: 1 Le calendrier de l’Avent -> /calendrier    errors: 0
flag=on public FR 26 Nov   button: 0                                            errors: 0
flag=off member EN 26 Nov  button: 0                                            errors: 0
flag=off public EN 26 Nov  button: 0                                            errors: 0
flag=off member FR 26 Nov  button: 0                                            errors: 0
flag=off public FR 26 Nov  button: 0                                            errors: 0
flag=on  public/member, EN and FR, 2 Dec: button 1 each (links /calendar, /calendrier)
flag=off public/member, EN and FR, 2 Dec: button 1 each

AC5

$ grep ' /$' .git/ticket/62/check.log
┌ ○ /                                    1d      1w
$ curl -si localhost:4062/api/calendar/button
HTTP/1.1 200 OK
cache-control: no-store
content-type: application/json

AC6

$ payload migrate   (NEON_BRANCH=t62-proof)
Migrating: 20261126_193319_calendar_preview_button
Migrated:  20261126_193319_calendar_preview_button (59ms)
$ psql -c "select column_name,data_type,column_default ... 'behaviour_preview_button'"
behaviour_preview_button|boolean|false

Console errors on / in every case above: 0. pnpm check (lint, typecheck, build): PASS.

@maxitect
maxitect force-pushed the feat/62-calendar-preview-the-home-page-button-before-1 branch from c537744 to 055e46d Compare November 26, 2026 19:47
@maxitect
maxitect force-pushed the feat/62-calendar-preview-the-home-page-button-before-1 branch from 055e46d to 6a4ebdf Compare November 26, 2026 20:44
@maxitect
maxitect added this pull request to stack #65 November 26, 2026 20:44
@netlify

netlify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for clarksbowlingclub ready!

Name Link
🔨 Latest commit 6a4ebdf
🔍 Latest deploy log https://app.netlify.com/projects/clarksbowlingclub/deploys/6b089a38ecc418cc544c0be3
😎 Deploy Preview https://deploy-preview-64--clarksbowlingclub.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@maxitect
maxitect marked this pull request as ready for review November 26, 2026 20:53
@maxitect
maxitect merged commit 338e7a5 into main Nov 26, 2026
6 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.

Calendar: preview the home page button before 1 December when logged in

1 participant