fix-the-redesign-so-that-i-did-it-myself-426 #507
No reviewers
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web!507
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-the-redesign-so-that-i-did-it-myself-426"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP: fix-the-redesign-so-that-i-did-it-myself-426to fix-the-redesign-so-that-i-did-it-myself-426The legacy
/picksand/picks_formroutes are thoroughly tested and now delegate to the extractedpicks_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.pyinto a sharedapp/picks.pyand 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:139includesv3.router, yettests/contains no v3 requests (grep for/v3is empty). The sharedpicks_page/record_picksare exercised through the legacy routes intests/test_picks_routes.py, but the v3 wiring itself — auth redirects, theget_open_picks_week409 gate onapp/routers/v3.py:83,display_week_idhandling inapp/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, andlogin.htmlare empty ({% extends "v3/base.html" %}only), and the nav inapp/templates/v3/base.html:35-40rendersProfile/Settings/Sign out/Sign inashref="#". Because the routes requireget_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:13gained# pylint: disable=duplicate-code, butapp/routers/v3.pyis a near-clone of v2's structure and did not.R0801reports a duplication cluster unless the disable is present in every file participating in it, andscripts/test_and_lint.sh:12runs pylint without--exit-zero. I couldn't run pylint in this sandbox to confirm; please make suretest_and_lint.shis green before merging (v3.py may need the same disable).Nits
v3
allpickscan't browse past weeks.app/routers/v3.py:150acceptsdisplay_week_id, but no v3 template or nav emits such a link (allpicks.htmlhas no week selector), so the historical-week navigation the legacy page offers viaweek_no/season_type/seasonisn't reachable in v3 yet. Presumably intentional for this pass — flagging so it isn't forgotten.Malformed
unicode-rangefor the Figtree font. Inapp/styles/v3.src.cssthe Figtree@font-faceusesU+0000 -00FF, U+0152 -0153, …(stray spaces), which minifies to the mangledU0 -0FF, U152 -153, …inapp/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 unusedgameskey into the legacypicks.j2context (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.