fix-the-redesign-so-that-i-did-it-myself-426 #507

Merged
johnsturgeon merged 7 commits from fix-the-redesign-so-that-i-did-it-myself-426 into main 2026-09-11 13:58:12 +02:00
Owner
No description provided.
Merge origin/main into fix-the-redesign-so-that-i-did-it-myself-426
Some checks failed
Claude Code Review / claude-review (pull_request) Has been skipped
Python FastAPI Jinja Linting / build (pull_request) Failing after 44s
Tests / pytest (pull_request) Failing after 23s
7dc8465929
Brings in the magic-link login, dev email filtering, and the Tailwind
toolchain ignores. The only conflict was .gitignore, where both sides
ignored the toolchain; kept main's broader `bin/` over `/bin/tailwindcss`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Updated to fix breakage
Some checks failed
Claude Code Review / claude-review (pull_request) Has been skipped
Python FastAPI Jinja Linting / build (pull_request) Failing after 27s
Tests / pytest (pull_request) Failing after 18s
73a6d0e5c3
Fixed up a few obvious lint issues
Some checks failed
Claude Code Review / claude-review (pull_request) Has been skipped
Python FastAPI Jinja Linting / build (pull_request) Failing after 29s
Tests / pytest (pull_request) Successful in 15s
53ced4dc79
migrated the picks page logic to a central class
All checks were successful
Python FastAPI Jinja Linting / build (pull_request) Successful in 51s
Tests / pytest (pull_request) Successful in 25s
Claude Code Review / claude-review (pull_request) Has been skipped
005cd32615
Even when I do away with the 'old' page, this is still a good design decision
johnsturgeon changed title from WIP: fix-the-redesign-so-that-i-did-it-myself-426 to fix-the-redesign-so-that-i-did-it-myself-426 2026-09-11 13:32:09 +02:00
Bumped the version
All checks were successful
Claude Code Review / claude-review (pull_request) Successful in 2m10s
Python FastAPI Jinja Linting / build (pull_request) Successful in 29s
Tests / pytest (pull_request) Successful in 14s
1927c34460
Author
Owner

The legacy /picks and /picks_form routes are thoroughly tested and now delegate to the extracted picks_page/record_picks, so the moved logic stays covered. My review is ready.


This PR extracts the picks eligibility/validation logic out of app/main.py into a shared app/picks.py and adds a parallel v3 UI (new router, Tailwind-built CSS, Jinja templates). The refactor is behavior-preserving on the legacy routes and the extraction is clean; the findings below are mostly about the new v3 surface, which is wired into the live app while still partly a stub.

Worth fixing

  • The v3 router is mounted in production but has no test coverage. app/main.py:139 includes v3.router, yet tests/ contains no v3 requests (grep for /v3 is empty). The shared picks_page/record_picks are exercised through the legacy routes in tests/test_picks_routes.py, but the v3 wiring itself — auth redirects, the get_open_picks_week 409 gate on app/routers/v3.py:83, display_week_id handling in app/routers/v3.py:150, error-page rendering — is untested. At minimum add a happy-path GET/POST test per v3 route so a template rename or context-key change doesn't 500 silently in production.

  • Stub pages and dead nav links are publicly reachable. app/templates/v3/standings.html, rules.html, profile.html, and login.html are empty ({% extends "v3/base.html" %} only), and the nav in app/templates/v3/base.html:35-40 renders Profile/Settings/Sign out/Sign in as href="#". Because the routes require get_player, they're behind auth and nothing in the legacy UI links to /v3, so risk is low — but confirm this half-built UI is meant to ship in 2.34.0 rather than sit behind a feature flag or stay unmerged.

  • Verify pylint still passes. app/routers/v2.py:13 gained # pylint: disable=duplicate-code, but app/routers/v3.py is a near-clone of v2's structure and did not. R0801 reports a duplication cluster unless the disable is present in every file participating in it, and scripts/test_and_lint.sh:12 runs pylint without --exit-zero. I couldn't run pylint in this sandbox to confirm; please make sure test_and_lint.sh is green before merging (v3.py may need the same disable).

Nits

  • v3 allpicks can't browse past weeks. app/routers/v3.py:150 accepts display_week_id, but no v3 template or nav emits such a link (allpicks.html has no week selector), so the historical-week navigation the legacy page offers via week_no/season_type/season isn't reachable in v3 yet. Presumably intentional for this pass — flagging so it isn't forgotten.

  • Malformed unicode-range for the Figtree font. In app/styles/v3.src.css the Figtree @font-face uses U+0000 -00FF, U+0152 -0153, … (stray spaces), which minifies to the mangled U0 -0FF, U152 -153, … in app/static/v3.css. Inter and Rock Salt use the correct spaceless form. Browsers reject the invalid descriptor and fall back to the full range, so the font still loads — but it's inconsistent with the other two and worth cleaning up at the source.

  • PicksPage.as_context() leaks an unused games key into the legacy picks.j2 context (app/main.py:247). Harmless (the template ignores it), just slightly untidy versus the old hand-built context.

Overall this is a solid, low-risk refactor; the main asks are test coverage for the new v3 routes and confirming the v3 UI is intended to go live in this state.

<!-- claude-code-review --> The legacy `/picks` and `/picks_form` routes are thoroughly tested and now delegate to the extracted `picks_page`/`record_picks`, so the moved logic stays covered. My review is ready. --- This PR extracts the picks eligibility/validation logic out of `app/main.py` into a shared `app/picks.py` and adds a parallel v3 UI (new router, Tailwind-built CSS, Jinja templates). The refactor is behavior-preserving on the legacy routes and the extraction is clean; the findings below are mostly about the new v3 surface, which is wired into the live app while still partly a stub. ## Worth fixing - **The v3 router is mounted in production but has no test coverage.** `app/main.py:139` includes `v3.router`, yet `tests/` contains no v3 requests (grep for `/v3` is empty). The shared `picks_page`/`record_picks` are exercised through the legacy routes in `tests/test_picks_routes.py`, but the v3 wiring itself — auth redirects, the `get_open_picks_week` 409 gate on `app/routers/v3.py:83`, `display_week_id` handling in `app/routers/v3.py:150`, error-page rendering — is untested. At minimum add a happy-path GET/POST test per v3 route so a template rename or context-key change doesn't 500 silently in production. - **Stub pages and dead nav links are publicly reachable.** `app/templates/v3/standings.html`, `rules.html`, `profile.html`, and `login.html` are empty (`{% extends "v3/base.html" %}` only), and the nav in `app/templates/v3/base.html:35-40` renders `Profile`/`Settings`/`Sign out`/`Sign in` as `href="#"`. Because the routes require `get_player`, they're behind auth and nothing in the legacy UI links to `/v3`, so risk is low — but confirm this half-built UI is meant to ship in 2.34.0 rather than sit behind a feature flag or stay unmerged. - **Verify pylint still passes.** `app/routers/v2.py:13` gained `# pylint: disable=duplicate-code`, but `app/routers/v3.py` is a near-clone of v2's structure and did not. `R0801` reports a duplication cluster unless the disable is present in *every* file participating in it, and `scripts/test_and_lint.sh:12` runs pylint without `--exit-zero`. I couldn't run pylint in this sandbox to confirm; please make sure `test_and_lint.sh` is green before merging (v3.py may need the same disable). ## Nits - **v3 `allpicks` can't browse past weeks.** `app/routers/v3.py:150` accepts `display_week_id`, but no v3 template or nav emits such a link (`allpicks.html` has no week selector), so the historical-week navigation the legacy page offers via `week_no`/`season_type`/`season` isn't reachable in v3 yet. Presumably intentional for this pass — flagging so it isn't forgotten. - **Malformed `unicode-range` for the Figtree font.** In `app/styles/v3.src.css` the Figtree `@font-face` uses `U+0000 -00FF, U+0152 -0153, …` (stray spaces), which minifies to the mangled `U0 -0FF, U152 -153, …` in `app/static/v3.css`. Inter and Rock Salt use the correct spaceless form. Browsers reject the invalid descriptor and fall back to the full range, so the font still loads — but it's inconsistent with the other two and worth cleaning up at the source. - **`PicksPage.as_context()` leaks an unused `games` key** into the legacy `picks.j2` context (`app/main.py:247`). Harmless (the template ignores it), just slightly untidy versus the old hand-built context. Overall this is a solid, low-risk refactor; the main asks are test coverage for the new v3 routes and confirming the v3 UI is intended to go live in this state.
Built css (tailwind)
All checks were successful
Claude Code Review / claude-review (pull_request) Successful in 3m45s
Python FastAPI Jinja Linting / build (pull_request) Successful in 30s
Tests / pytest (pull_request) Successful in 15s
Release on merge / release (pull_request) Successful in 0s
fd373530a3
Added "inter" font
johnsturgeon deleted branch fix-the-redesign-so-that-i-did-it-myself-426 2026-09-11 13:58:12 +02:00
Sign in to join this conversation.
No description provided.