Map Review: choose the disease week, and read any card at full size #323
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "amiable-platypus"
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?
What this is
Four changes to the Map Review / Analysis pane, all driven by the same complaint: the rail is a third of the screen, the population reading was pinned to one week, and a card could not be looked at properly.
1. Choose the disease week and season
The population read always anchored at the season's last week that carried an analysed sample (week 41 on the live district), with no way to move it. A discreet
Season/Weekpair now sits above the population map:week=2026-41in the URL and the stored session analysis, so a shared link opens on the week it was taken at and a reload keeps it. Absent means the default; neither grammar version moved, because absence has a defined meaning rather than being a value the server might refuse.Filtered set · Feb 4 – Oct 19, 2026, orWeek 30 · Jul 19 – Jul 25, 2026.The window decision is extracted into
populationWindowOf, a pure function of the reads' rows and the request, so every rule is tested without a database (population_window_test.go). The response gainsyear,seasons,seasonFirst,seasonLast,firstWeek,filtered,range.2. The season list follows the trap stations
The first cut offered every season with an analysed sample, which listed Delta MVCD's seeded history back to 1954 and Placer's off-station imports from 2002. The picker now offers the seasons whose analysed samples came from a trap that sits at a station — the era a deployment actually ran — with a fallback: a district that has only ever counted off-station traps keeps every season it has rather than an empty control. A malformed sampling year (the live data carries a
4439) is neither offered nor used as the season a read falls back to.3. Read any card at full size
Every card in the pane except the map — the population question's four cards and all sixty report panels — carries an expander. It moves that card's own live DOM into a page-level overlay (
Teleport), so the card is the same component instance: its chart keeps the resize observer that redraws it at the bigger box, its handlers keep their closures, and a drill-down click inside the enlarged card still narrows the shared filter. Close with the X, Escape, or a backdrop click; the card returns to its place.Details that cost something and are worth knowing when reviewing:
deferon the teleport, because a card mounts before the layer that owns the host and a teleport caches the target it resolved at mount — a missing host is cached as null and throws when enabled.transform, and a transformed ancestor is the containing block forposition: fixed, which would pin a window-sized overlay to the rail's box for the quarter second of that animation.4. Read it at a legible size, and name the colours
clamp(11, min(width/40, height/11), 16). The rail stays exactly at 11px; the enlarged chart reads 16px.WasteTopSiteshad no key at all). Each stacked chart now carries its ownWasteOutcomeKey.Testing
Open the worktree's Map Review page and sign in:
/_/review/map?state=1&panel=analysis&table=species_count.Week N · <dates>. Reload — the week survives. Copy the URL — it carriesweek=YYYY-WWand opens on that week elsewhere.species_count.species = 1). Both selects disable, the caption readsFiltered set · <dates>, and clearing the filter puts the chosen week back in force.Checks that ran here:
go build -tags tiff,go test ./platform/map_review/,golangci-lint(0 issues),pnpm run typecheck,pnpm test(615),pnpm run build-sync, plus a Chromium harness for the overlay mechanics and the measured font sizes. The population window rules are covered by a table-driven test; the URL and stored-analysis carriers bymapReviewUrl.test.tsandmapReviewPrefs.test.ts.Not included
The "open in another window" variant was deferred by choice. Its cheap form needs the sixty report panels extracted into data-driven components so the second window can render from a mirrored payload; the expander covers the need for now.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.