fix: the gameweek pager wraps on a phone; the second transfer respects the club cap (#34) #41

Merged
kristofferopsahl merged 2 commits from fix/gw-nav-wraps-on-a-phone into feat/captaincy-board 2026-09-19 00:28:13 +02:00
Collaborator

Targets feat/captaincy-board (#31). Two frontend fixes, one commit each, each with its own ?v= bump following the asset ritual (169, then 170).

1. The gameweek pager wraps on a phone

test_header_narrow[400] failed on every #31 run: "the page is 410px wide on a 400px screen". The header wasn't the problem. The overflow was .gw-nav: stepper, XI total, formation and the card-line <select> in a flex row with no wrap, ending at 409.8px.

.gw-nav gets flex-wrap: wrap in its one rule, not in an appended override (#7/#26), per CLAUDE.md's "content folds; it does not vanish". tests/data/style.baseline.css carries the same declaration as an intended change for the render gate, the way ea6c214 did for the strength kicker.

2. The second transfer is club-capped against the squad the first one left (#34, item 2)

bestSwapFrom read the cap from clubCounts(), which counts SQUAD.picks, the squad before either move. When searching for the second move it still counted the player the first move sold and missed the one it bought. clubCounts(excludeId, picks = SQUAD.picks) now counts the squad being searched; the single-move caller is unchanged.

Two tests in test_banking_move_now_vs_wait.py, one per direction, both red before the change:

  • the pair bought a fourth club-7 player (4 against a cap of 3);
  • it bought S16 instead of the legal S28 from a club the first move had just made room in.

Verification (local, Playwright 1.62 / Chromium 151)

  • full tests/web with the browser: 1306 passed, 8 skipped, 0 failed. #31's head had 1 failure (the 400px one).
  • test_css_characterization.py passes against the updated baseline.

Browser tests are local-only since #38, so CI here runs syntax/tests/wheel.

🤖 Generated with Claude Code

Targets `feat/captaincy-board` (#31). Two frontend fixes, one commit each, each with its own `?v=` bump following the asset ritual (169, then 170). ### 1. The gameweek pager wraps on a phone `test_header_narrow[400]` failed on every #31 run: "the page is 410px wide on a 400px screen". The header wasn't the problem. The overflow was `.gw-nav`: stepper, XI total, formation and the card-line `<select>` in a flex row with no wrap, ending at 409.8px. `.gw-nav` gets `flex-wrap: wrap` in its one rule, not in an appended override (#7/#26), per CLAUDE.md's "content folds; it does not vanish". `tests/data/style.baseline.css` carries the same declaration as an intended change for the render gate, the way `ea6c214` did for the strength kicker. ### 2. The second transfer is club-capped against the squad the first one left (#34, item 2) `bestSwapFrom` read the cap from `clubCounts()`, which counts `SQUAD.picks`, the squad before either move. When searching for the second move it still counted the player the first move sold and missed the one it bought. `clubCounts(excludeId, picks = SQUAD.picks)` now counts the squad being searched; the single-move caller is unchanged. Two tests in `test_banking_move_now_vs_wait.py`, one per direction, both **red before the change**: - the pair bought a fourth club-7 player (4 against a cap of 3); - it bought S16 instead of the legal S28 from a club the first move had just made room in. ### Verification (local, Playwright 1.62 / Chromium 151) - full `tests/web` with the browser: **1306 passed, 8 skipped, 0 failed**. #31's head had 1 failure (the 400px one). - `test_css_characterization.py` passes against the updated baseline. Browser tests are local-only since #38, so CI here runs syntax/tests/wheel. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
At 400px the pager row -- the week stepper, the XI total, the formation
and the card-line picker -- ran 10px past the screen, so the whole page
scrolled sideways and test_header_narrow[400] failed on every run of #31.
`.gw-nav` was a flex row with no wrap. It wraps now, in its one rule
rather than an appended override; the baseline stylesheet carries the
same declaration, as an intended change for the render gate. Assets move
to ?v=169.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fix: the second transfer is club-capped against the squad the first one left
All checks were successful
CI / syntax (pull_request) Successful in 9s
CI / tests (pull_request) Successful in 1m13s
CI / wheel (pull_request) Successful in 28s
8e59d231e4
#34, item 2. bestSwapFrom took the club cap from clubCounts(), which
counts SQUAD.picks -- the squad before either move. Searching for the
second move it still counted the player the first move sold and missed
the one it bought. So "one now vs two next week" could propose a fourth
player from one club, and could refuse a legal buy from a club the first
move had just made room in.

clubCounts takes the squad to count, defaulting to SQUAD.picks for the
single-move caller, and bestSwapFrom passes the squad it is searching.
Two tests, one per direction, each RED before the change: the pair
bought a fourth club-7 player (4 against a cap of 3), and it bought S16
instead of the legal S28. Assets move to ?v=170.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kristofferopsahl merged commit 22a69ba69f into feat/captaincy-board 2026-09-19 00:28:13 +02:00
kristofferopsahl deleted branch fix/gw-nav-wraps-on-a-phone 2026-09-19 00:28:13 +02:00
Sign in to join this conversation.
No description provided.