fix: restore Sep+Oct adult merge and stop auto-truncating period selector #28

Merged
kacerr merged 1 commits from fix/period-selector-restore into main 2026-05-08 11:13:14 +02:00
Owner

Why

User reported the adults dashboard's From/To period selector showed only Dec 2025 onwards — Sep+Oct 2025, Nov 2025, and Dec 2025 had vanished from the dropdown compared to production.

Diagnosis (full plan in docs/plans/2026-05-08-1052-period-selector-missing-old-months.md):

  1. Sheet-level data loss (out of scope of this PR) — the live adults attendance sheet header was pruned to start at 02.12.2025; Sep/Oct/Nov 2025 columns were deleted. Restoring those from Sheets version history is required to actually see those periods on the dashboard.
  2. Code regression #11257f0d (Mar 9) commented out ADULT_MERGED_MONTHS, removing the Sep+Oct 2025 merged label.
  3. Code regression #27774301 (Apr 9) added a JS onload default defaultFrom = maxMonthIdx − 4 that immediately filtered the table to the last 5 months on every page load, hiding older periods even when they were present.

This PR fixes the two code regressions.

Changes

  • scripts/attendance.py, go/internal/services/membership/sources.go: restored 2025-09 → 2025-10 mapping. Per product decision the 2025-12 → 2026-01 mapping stays disabled (Dec and Jan billed separately for adults; juniors keep both merges).
  • templates/adults.html, templates/juniors.html: dropped the defaultFrom = maxMonthIdx − 4 lines. From-selector now starts at the oldest available month; future-month removal and column-hiding still in place.
  • go/internal/services/membership/sources_test.go: TestLoadAdults / TestLoadAdults_Fee updated to assert Sep dates merge into 2025-10.

Test plan

  • make test (Python, 31 tests pass)
  • cd go && go test ./... (Go, all packages pass)
  • After merging: restore Sep/Oct/Nov 2025 columns in the adults attendance sheet from Sheets version history
  • POST /flush-cache on both Python and Go backends
  • Reload /adults → confirm dropdown lists Sep+Oct 2025, Nov 2025, Dec 2025, Jan 2026, … as separate options and the table shows all non-future months on first load
  • Reload /juniors → confirm dropdown still shows Sep+Oct 2025, Nov 2025, Dec 2025+Jan 2026 (juniors keeps both merges)
  • make parity reports zero diffs on /api/adults and /api/juniors

🤖 Generated with Claude Code

## Why User reported the adults dashboard's From/To period selector showed only Dec 2025 onwards — Sep+Oct 2025, Nov 2025, and Dec 2025 had vanished from the dropdown compared to production. Diagnosis (full plan in `docs/plans/2026-05-08-1052-period-selector-missing-old-months.md`): 1. **Sheet-level data loss** *(out of scope of this PR)* — the live adults attendance sheet header was pruned to start at `02.12.2025`; Sep/Oct/Nov 2025 columns were deleted. Restoring those from Sheets version history is required to actually see those periods on the dashboard. 2. **Code regression #1** — `1257f0d` (Mar 9) commented out `ADULT_MERGED_MONTHS`, removing the `Sep+Oct 2025` merged label. 3. **Code regression #2** — `7774301` (Apr 9) added a JS onload default `defaultFrom = maxMonthIdx − 4` that immediately filtered the table to the last 5 months on every page load, hiding older periods even when they were present. This PR fixes the two code regressions. ## Changes - `scripts/attendance.py`, `go/internal/services/membership/sources.go`: restored `2025-09 → 2025-10` mapping. Per product decision the `2025-12 → 2026-01` mapping stays disabled (Dec and Jan billed separately for adults; juniors keep both merges). - `templates/adults.html`, `templates/juniors.html`: dropped the `defaultFrom = maxMonthIdx − 4` lines. From-selector now starts at the oldest available month; future-month removal and column-hiding still in place. - `go/internal/services/membership/sources_test.go`: `TestLoadAdults` / `TestLoadAdults_Fee` updated to assert Sep dates merge into `2025-10`. ## Test plan - [x] `make test` (Python, 31 tests pass) - [x] `cd go && go test ./...` (Go, all packages pass) - [ ] After merging: restore Sep/Oct/Nov 2025 columns in the adults attendance sheet from Sheets version history - [ ] `POST /flush-cache` on both Python and Go backends - [ ] Reload `/adults` → confirm dropdown lists `Sep+Oct 2025`, `Nov 2025`, `Dec 2025`, `Jan 2026`, … as separate options and the table shows all non-future months on first load - [ ] Reload `/juniors` → confirm dropdown still shows `Sep+Oct 2025`, `Nov 2025`, `Dec 2025+Jan 2026` (juniors keeps both merges) - [ ] `make parity` reports zero diffs on `/api/adults` and `/api/juniors` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kacerr added 1 commit 2026-05-08 11:12:48 +02:00
fix: restore Sep+Oct adult merge and stop auto-truncating period selector
All checks were successful
Deploy to K8s / deploy (push) Successful in 9s
e618e906ef
Two regressions made older periods invisible on the adults dashboard:

- 1257f0d (Mar 9) commented out ADULT_MERGED_MONTHS, removing the
  Sep+Oct 2025 merged label. Restored only the 2025-09 → 2025-10
  mapping (Dec and Jan are billed separately for adults; the
  Dec → Jan mapping stays disabled per product decision). Mirrored
  on the Go side. Test fixtures in sources_test.go now assert Sep
  dates land in merged 2025-10 instead of 2025-09.

- 7774301 (Apr 9) added a JS onload default that set the From
  selector to maxMonthIdx − 4 and immediately filtered the table,
  hiding everything older than 5 months on first load. Dropped that
  default in templates/adults.html and templates/juniors.html so
  the From-selector starts at the oldest available month. Future
  months are still removed from the dropdowns and hidden in the
  table — only the past-month truncation is gone.

Note: the live adults attendance sheet had also been pruned to
start at 02.12.2025; restoring Sep/Oct/Nov 2025 columns from
Sheets version history is required to actually see those periods.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr merged commit 2cbd98df1a into main 2026-05-08 11:13:14 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kacerr/fuj-management#28