Skip to content

feat(calendar): open on 1 December, with a home page button - #57

Merged
maxitect merged 4 commits into
mainfrom
feat/56-calendar-opens-on-1-december-by-itself-with-a-home
Nov 13, 2026
Merged

maxitect merged 4 commits into
mainfrom
feat/56-calendar-opens-on-1-december-by-itself-with-a-home

Conversation

@maxitect

@maxitect maxitect commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What

The advent calendar now opens to the public at 00:00 Paris time on 1 December by itself, and the home page shows a button to it from 1 to 24 December. "Visible" becomes the off switch.

Changes

  • /calendrier and its endpoints are public from 1 December of the calendar's year (Paris midnight, ignoring "Opens at hour", which still decides when each door opens). Before that the public gets the holding page; signed-in members keep the preview. Reuses getCalendarDay from src/lib/calendar/schedule.ts in getPublicState.
  • "Visible" now defaults to on (field default, code fallback and a migration). Unticking it after 1 December takes the calendar down (holding page, endpoints 404); ticking it brings it back.
  • Home page: CalendarButton links to /calendrier, French and English, shown 1 to 24 December Paris time. The date is checked in the browser (useSyncExternalStore, server snapshot is "hidden"), so / stays static. It sits above the footer, clear of the video controls.
  • Admin guide explains the new meaning of "Visible".

Acceptance criteria

AC Result Method Evidence
30 Nov 23:59 Paris: holding page; 1 Dec 00:00: calendar, no admin change or deploy PASS api, shifted clock AC1
"Visible" off after 1 Dec: holding page and both endpoints 404; back on: calendar returns PASS api, db AC2
Still public on 25 December and in January PASS api AC1
Home button on 1 and 24 Dec, not on 30 Nov or 25 Dec, both languages, 1280 and 390 px PASS browser AC3
Lighthouse mobile 90+ (median of 3) and / stays static PASS deploy, cli, api AC4
No console errors or CSP violations on / or /calendrier PASS browser AC5
Migration applies on a copy of production and has a working down PASS db AC6

Closes

Closes #56

Notes

  • Migration 20261113_225308_visible_on_by_default sets the column default to true and sets any stored row to true. Production has no saved calendar settings yet (no row; the column defaulted to false), so today the rewrite changes nothing there. It is there for a save made before this merges: under the old meaning, a stored "off" only meant "not launched yet", and without the rewrite it would keep the calendar hidden on 1 December. It applies after the production migrations initial, calendar, calendar_checks and carousel (proved on a copy of main). No hand-written constraint, so no register entry.
  • The home button's dates use the default calendar year (2026) from defaultYear, not the admin "Year" field, because reading the setting would make / render per request. Changing "Year" for a later December means updating that constant, or a follow-up.
  • Opening is at Paris midnight on 1 December whatever "Opens at hour" says; between midnight and that hour the page shows the calendar with no door open yet.
  • After merge: nothing to do in the admin. The migration runs with the deploy and the "Visible" box then reads ticked.
  • Lighthouse mobile on the deploy preview: 96, 97, 96 (median 96; LCP 2.4 s; CLS 0), on 13 November, when the button is hidden. The button renders only after mount; CLS with it showing was measured at 0.
  • The button passes the home page's language to the calendar (/calendrier?isFrench=…), because the toggle's choice does not survive the full page load into the calendar's own layout.

Review

Verdict: ALL CLEAR
Rounds: 2

Finding Severity Resolution
The home button opened the calendar in the browser's language, not the one chosen on the home page warning fixed in 8c192cf
AC4 evidence was local only, not from the deploy preview critical fixed: deploy preview evidence added to AC4
The migration note said production had a stored "Visible" off; it has no row suggestion fixed in the notes
The home button uses defaultYear (2026), not the admin "Year" suggestion open: a cached server read is possible but changes how / is cached; needs a decision before December 2027
From midnight until "Opens at hour" (if set above 0), the status line reads "The first door opens on 1 December" on 1 December suggestion open: accurate, default hour is 0
Deploy previews log a CSP frame-src error for Netlify's preview drawer (app.netlify.com) suggestion open: preview-only, also on #55's preview, none on production

Re-verified: AC3 home button, now linking to /calendrier?isFrench=true|false (browser, local production build, fixed clock, EN/FR, 1280/390) PASS · AC1 (api, shifted server clock, plus "Opens at hour" 9 at 00:30 on 1 December: 200, today 0) PASS · AC5 (browser, deploy preview) PASS apart from the preview drawer · AC6 (db, preview reset from main) PASS · check.sh PASS

Evidence

AC1

Production build on port 4056 against Neon dev (no settings row, so defaults), with Date shifted by a preload (FAKE_NOW).

== 2026-11-30T22:59:00Z   (30 Nov 23:59 Paris)
/api/calendar: 404
/calendrier: HOLDING
== 2026-11-30T23:00:00Z   (1 Dec 00:00 Paris)
/api/calendar: 200   {"year":2026,"today":1,"open":true,"member":false,"doors":[]}
/calendrier: CALENDAR
== 2026-12-25T12:00:00Z
/api/calendar: 200   "today":24,"open":true
/calendrier: CALENDAR
== 2027-01-15T12:00:00Z
/api/calendar: 200   "today":24,"open":true
/calendrier: CALENDAR

HOLDING is the page carrying <meta name="robots" content="noindex"> and no script. /api/calendar/audio/1 is 404 throughout because no door has audio on that branch, so it cannot tell open from closed there; it shares getPublicState with /api/calendar.

AC2

psql dev: insert into calendar_settings (behaviour_visible, ...) values (false, 2026, 0, 'open')
== 2026-12-01T00:00:00Z (visible=off)   /api/calendar: 404  /api/calendar/audio/1: 404  /calendrier: HOLDING
== 2026-12-25T12:00:00Z (visible=off)   /api/calendar: 404  /api/calendar/audio/1: 404  /calendrier: HOLDING
psql dev: update calendar_settings set behaviour_visible=true
== 2026-12-25T12:00:00Z (visible=on)    /api/calendar: 200  /calendrier: CALENDAR

AC3

Headless Chromium, Date shifted in the page. Button box and whether it overlaps the pause or mute button (it never does):

30 Nov 23:59 | EN/FR | 1280 and 390 | absent
1 Dec 00:00  | EN | 1280 | "The advent calendar"       {"x":540,"y":624,"w":199,"h":48} overlapsControls=0
1 Dec 00:00  | EN | 390  | "The advent calendar"       {"x":95,"y":668,"w":199,"h":48}  overlapsControls=0
1 Dec 00:00  | FR | 1280 | "Le calendrier de l’Avent"  {"x":528,"y":624,"w":225,"h":48} overlapsControls=0
1 Dec 00:00  | FR | 390  | "Le calendrier de l’Avent"  {"x":83,"y":668,"w":225,"h":48}  overlapsControls=0
24 Dec 23:59 | EN/FR | 1280 and 390 | present, same boxes as 1 Dec
25 Dec 00:00 | EN/FR | 1280 and 390 | absent

Screenshots were reviewed at 390 px (EN) and 1280 px (FR): the button sits above the footer icons, clear of the controls and the logo.

AC4

curl -sI localhost:4056/  ->  HTTP/1.1 200 OK, x-nextjs-prerender: 1, Cache-Control: s-maxage=86400, stale-while-revalidate=518400
lighthouse mobile x3 (production build, localhost): 94, 94, 94  | LCP 3.1 s | CLS 0
Playwright CLS at 390 px: 2026-11-13 CLS = 0 button: 0 ; 2026-12-10 CLS = 0 button: 1

On the deploy preview (https://deploy-preview-57--clarksbowlingclub.netlify.app):

curl -sI /  ->  HTTP/2 200, x-nextjs-prerender: 1, cache-status: "Next.js"; hit, "Netlify Edge"; stored
lighthouse mobile x3 (/): 96 LCP 2.4 s CLS 0 | 97 LCP 2.4 s CLS 0 | 96 LCP 2.4 s CLS 0

AC5

/                          errors/warnings: 4 (headless GL driver "GPU stall due to ReadPixels" from the WebGL logo; no CSP or page error)
/calendrier                errors/warnings: 0
/calendrier?isFrench=true  errors/warnings: 0

A securitypolicyviolation listener was installed on each page and logged nothing.

AC6

Neon preview reset to its parent (a copy of main), a "Visible off" row inserted, then:

pnpm payload migrate        -> Migrated: 20261113_225308_visible_on_by_default
select id,behaviour_visible -> 1|t ; column_default -> true
pnpm payload migrate:down   -> Migrated down: 20261113_225308_visible_on_by_default
select behaviour_visible    -> f ; column_default -> false
pnpm payload migrate        -> Migrated again; behaviour_visible -> t

@netlify

netlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for clarksbowlingclub ready!

Name Link
🔨 Latest commit 8c192cf
🔍 Latest deploy log https://app.netlify.com/projects/clarksbowlingclub/deploys/6af7999721d7c0915ec9fdb5
😎 Deploy Preview https://deploy-preview-57--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 13, 2026 23:13
@maxitect
maxitect merged commit 10fb776 into main Nov 13, 2026
5 checks passed
@maxitect
maxitect deleted the feat/56-calendar-opens-on-1-december-by-itself-with-a-home branch November 13, 2026 23:19
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 opens on 1 December by itself, with a home page button until 24 December

1 participant