From 6ef58e391576581e6b354f500650e16eced7d739 Mon Sep 17 00:00:00 2001 From: jay Date: Thu, 11 Jun 2026 09:26:19 -0400 Subject: [PATCH] Word Search: pin per-size counts in test + fix stale .playing-word comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per Codex audit. test_wordsearch_endpoint now asserts the exact promise — small 6, med 9, large 13, pairwise-disjoint. app.css comment updated to .playing-game (the class was renamed when the focused viewport was generalized to both games). Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/app.css | 8 ++++---- tests/test_admin.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/app.css b/frontend/src/app.css index f0a7896..7eb7bb1 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -66,10 +66,10 @@ button { font-family: inherit; cursor: pointer; } .rise { animation: rise 0.5s ease both; } @media (prefers-reduced-motion: reduce) { .rise { animation: none; } html { scroll-behavior: auto; } } -/* Daily Word on mobile becomes a focused, full-viewport screen: lock body scroll - and hide the site footer so the on-screen keyboard is truly pinned (not riding - the page's scroll). The .playing-word class is toggled by /play and always - removed on navigation via effect cleanup. Mobile only — desktop is unaffected. */ +/* A puzzle on mobile becomes a focused, full-viewport screen: lock body scroll and + hide the site footer so it feels like a game, not a web page (keyboard/grid + truly pinned, not riding the page scroll). The .playing-game class is toggled by + /play and always removed on navigation via effect cleanup. Mobile only. */ @media (max-width: 720px) { html.playing-game, html.playing-game body { overflow: hidden; } html.playing-game footer.site { display: none; } diff --git a/tests/test_admin.py b/tests/test_admin.py index 2127698..c675cec 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -334,7 +334,9 @@ def test_wordsearch_endpoint(tmp_path, monkeypatch): assert all(findable(r["grid"], dim, w) for w in r["words"]) # every word placed → solvable themes.add(r["theme"]); per_size[tier] = set(r["words"]) assert len(themes) == 1 # all sizes share the day's one theme - # the three sizes are DISJOINT — each day is three distinct puzzles + # frozen promise: exact per-size counts ... + assert len(per_size["small"]) == 6 and len(per_size["med"]) == 9 and len(per_size["large"]) == 13 + # ... and the three sizes are DISJOINT — each day is three distinct puzzles assert per_size["small"] & per_size["med"] == set() assert per_size["small"] & per_size["large"] == set() assert per_size["med"] & per_size["large"] == set()