# CrewChief UK (formerly RefSync UK) — Application Changelog

All notable changes to the **CrewChief UK** (Independent UK Basketball Officials Appointment Platform) application from its inception are documented in this file.

*Disclaimer: CrewChief UK is an independent platform for UK basketball clubs, leagues, and match officials. It is not affiliated with, endorsed by, authorized by, operated by, or created by or for Basketball England.*

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---

## [Unreleased]

## [2.66.2] — 2026-12-04
### Fixed
- **crewchief.uk answers over HTTPS.** The web server on crewchief.uk couldn't open its own log file, because the installer had created it as the wrong user, so it never started. The installer now checks its setup as the web server's own user, repairs the log folder, and fails clearly if the web server isn't running. (#412)

## [2.66.1] — 2026-12-04
### Fixed
- **crewchief.uk deploys.** The first install no longer fails at its tidy-up step when there are no older releases to remove. While the holding page is up, the deploy now checks that crewchief.uk answers over HTTPS. The move to crewchief.uk checks it too before it touches the old address. The move also read the installed version wrongly, which would have stopped it after the redirect. (#409)

## [2.66.0] — 2026-12-04
### Added
- **Production can run on crewchief.uk.** Releases now also deploy to the new crewchief.uk server (Amazon Lightsail in Stockholm, behind Caddy), with a holding page until the data is moved and an automatic rollback if the new version doesn't start. Deploys sign in to AWS with short-lived credentials, so no server key is stored in GitHub. A hand-run workflow takes stock of RochenHost, moves the database, settings and keys across with checked row counts, redirects the old address, and can hand the site back if needed. Email can move to Amazon SES. (#406)

## [2.65.0] — 2026-12-03
### Added
- **Fixture import understands your league's grades.** The grade column is read against the grading scheme your league uses: a grade's name or code matches, and a match you saved earlier is used first. Grades join teams, venues, courts and competitions in the review step. A grade that doesn't match is offered the closest one, and a Basketball England code such as "Level 2" is offered as the grade in the same position in your scheme. You can remember the choice for future imports. (#401)
- **Links to outside systems.** A new record of what an outside system (a league platform or a federation feed) calls each of a league's fixtures, teams, venues and courts. Those ids survive renames on either side. Admins can list their league's links at `GET /api/league/external-links`. Each link belongs to one league. (#289)
- **Court codes.** A court can carry a short code from an outside system (for example `SHOW` or `CRT1`), and schedule feeds match courts by it. (#290)
### Changed
- **No more Basketball England Level 1 by default.** When nothing in the file or the division gives a fixture a grade, the import uses the lowest grade in use in your league's own scheme. Teams created by an import do the same. (#401)
- **Schedule sync files fixtures properly.** Fixtures from a schedule feed now go into the active season and the competition and division the feed names, with that division's grade and the season's match fees, like a CSV import. Before, they got a fixed grade and fee. A feed that says which system it comes from (`provider`) is matched by that system's ids, and a delivery older than one already taken is skipped, so late or repeated webhooks can't undo a change. (#289)
- **One UK time everywhere.** Schedule feeds, the CSV import and calendar exports share one rule: a time without an offset is UK time, so fixtures either side of the March and October clock changes keep their wall-clock time. Feeds can also send a date, a time and a time zone separately. (#290)
### Fixed
- A schedule feed could fail to create a team in a league with no team rep. (#289)

## [2.64.0] — 2026-12-03
### Added
- **A proper season rollover.** Roll Over now opens a panel instead of a confirmation box. It shows what is still open in the outgoing season (fixtures to play, positions not filled, played fixtures without a result, expense claims waiting), what carries over (clubs, teams, competitions, divisions, panels, development groups, fee rules and saved import matches), and lets you set the new season's name and dates. (#399)
- **Start a new season on your own grades.** The rollover panel has a choice of grades for the new season, with how many officials don't have a grade in each yet. Choosing your league's own scheme switches to it as the new season starts, with the same history and notices as any other switch. Fixtures in the season you archive keep the grades they have. (#399)
### Changed
- **Switching grades is only blocked by the season that is running.** Upcoming fixtures in an archived season no longer stop a league from switching grading scheme. (#399)
### Fixed
- The notice officials get when their league switches grades no longer says "Midlands Grades grades" when the scheme's name already ends in "Grades". (#399)

## [2.63.0] — 2026-12-03
### Added
- **A history of every grading change.** Creating a scheme, renaming, reordering, retiring or adding levels, switching scheme, and changing officials' grades (one at a time or in bulk) are now recorded in the league's activity, with a plain summary of what changed. The Grade Levels page shows the most recent changes, a bulk grading can be opened to see each official's grade before and after, and League Members > Activity has a new Grades filter. A change to the shared Basketball England grades appears in the history of every league that uses them. (#396)
- **Officials are told when their grade changes.** When an official's grade in the scheme their league uses changes, or the league switches to different grades, they get a notice in the app saying what their grade now is, or that they don't have one yet. These notices are never emailed, so grading a whole league at once can't flood anyone's inbox. Grading officials before a switch stays quiet until the league actually switches. (#396)

## [2.62.0] — 2026-12-03
### Added
- **Grade every official into your own scheme in one pass.** The Grade Levels page has an "Officials' grades" card for a league's own scheme, showing how many officials are graded and how many are not. Grade officials lists everyone in the league with their Basketball England grade and a suggested grade at the same position in your scheme. Change any you disagree with, filter to those without a grade or search by name, then save them all at once. This works before you switch, so officials are eligible from the first day. (#393)

### Changed
- **Switching scheme warns about officials without a grade.** "Use this scheme" now says how many officials have no grade in the new scheme yet and won't be eligible until graded. (#393)

## [2.61.1] — 2026-12-03
### Changed
- **Unified Release Notes Modal (#392):** Removed the unused *User-Friendly Guide* / *Technical & Admin Architecture* audience toggle from `#dialog-changelog` (and its dead event listeners in `app-12-wire-shared.js` and `app-20-wire-auth-and-nav.js`), presenting one clean, scannable Release Notes timeline.
- **Restored Category Badges & Bold Bullet Lead-Ins (#392):** Added `.changelog-tag-row` category badges and bold bullet lead-ins across all recent inline release cards (`v2.53.1`–`v2.61.1`), and updated the lazy-loaded archive renderer (`app-13-wire-chrome.js`) to auto-generate category badges (`New Feature`, `Bug Fix`, `Improvement`) from `CHANGELOG.md` headings.

### Fixed
- **High-Contrast `LATEST` Pill Styling (#392):** Added dedicated `.badge-latest`, `.badge-fix`, and `.badge-improvement` CSS rules in `public/styles.css` so the `LATEST` badge renders as a WCAG-compliant pill rather than bare unstyled text.

## [2.61.0] — 2026-12-03
### Added
- **Grade Levels page (League Setup).** A league can see the floor and table grades it uses, lowest first, and choose which grading scheme applies. The shared Basketball England grades can only be changed by a Super Admin, because every league on them relies on them. Any league can create its own scheme, started as a copy, then rename, add, retire and reorder its levels with drag and drop or the up and down buttons. Eligibility follows a new order straight away. (#387)
- **Officials hold a grade in each scheme.** In a league with its own scheme, the grade that counts is the official's grade in that scheme; their Basketball England grade is kept as it is for credentials and other leagues. Someone with no grade in the league's scheme is refused with the reason "No grade in this league's scheme". (#387)
- **Switching scheme is safe.** A league can't switch while upcoming fixtures still need grades from the current scheme, and competition and division defaults move to the level in the same position. A level still needed by upcoming fixtures can't be retired, and no level is ever deleted. (#387)
- **Demo:** Northern Junior uses its own "Northern Junior Grades" (four floor levels, three table levels), and the showcase reorders them to show eligibility changing. (#387)

### Fixed
- The competition and division forms filled the table grade picker with floor grades, and still showed grade codes; both now list the right grades by name. The credentials dialog also showed codes. (#387)
- Grade names are now escaped wherever they are shown, since leagues can name their own levels. (#387)

## [2.60.0] — 2026-12-03
### Added
- Five clear categories: Men's, Women's, Boys and Girls, plus Mixed. A competition is for men and boys, women and girls, or mixed, and each division's age group decides the rest: U18 and older play as Men's or Women's, U17 and younger as Boys or Girls. U17 is now an age group (#386).
- Teams can be edited from the club list: rename a team or move it to another division (#386).
### Changed
- A team no longer has its own officials' grade or category. The Add team form asks only for the club, name, competition and division, and shows what the team takes from its division ("Men's U18 · County U18 · officials need Floor Level 3 or above and Enhanced DBS") (#386).
- Fixtures take their category and grade from their division or competition, never from a team. The CSV import uses the division's grade when the file has none, for new and updated fixtures alike (#386).
- Grades are shown by name everywhere ("Floor Level 3" with "NBL Div 2 & 3" beneath it) instead of codes such as LEVEL_3 and TABLE_L2 (#386).
- Under-19s and younger always need Enhanced DBS officials, whatever the category is called (#386).
### Fixed
- The club secretary fixture form saved the grade code as the fixture's division, so fixtures showed "LEVEL_3" as their competition. Fixtures now use the home team's division, and existing ones are put right on start-up (#386).
- The workbench Men's filter also showed women's fixtures (#386).

## [2.59.0] — 2026-12-03
### Added
- One club can now play in several leagues. Each team plays in one league, each league sees only its own clubs, teams and venues, and registering or importing a club that already exists adds it to your league instead of failing or quietly borrowing another league's record (#383).
- Shared venues: one record per hall, used by any league. The league that looks after a venue edits it (Super Admin can step in), other leagues suggest a correction for it to approve, and every league keeps its own private notes on access, parking and who to call, shown in the venue map. Venues now have a country, and adding a hall that already exists offers the existing one (#383).
- Clubs can have home venues, with one main, and a team can play somewhere else. A league chooses whether its fixtures are usually played at the home club's venue or at central venues, and new fixtures default to the right court (#383).
- A warning when a fixture is booked on a court already in use at that time, by any league. The fixture is still saved, and another league's fixture is described only as "another league" (#383).
- The big demo shows each of these: Leeds Northern Stars plays in two leagues, the Nottingham Hoops Centre is shared by the Midlands and Northern Junior leagues with a correction waiting and a court clash, and Northern Junior plays at central venues (#383).
### Fixed
- Fixtures can no longer use another league's teams, and club fixture requests now go to that league's assignors only (#383).
- The schedule feed matched a court to a venue by comparing an id with a name, so a named court at a named venue was never found (#383).
- A development-groups test no longer depends on the time of day (it could pick the Super Admin as the plain official who must not manage groups) (#383).

## [2.58.1] — 2026-12-02
### Fixed
- An empty league and season bar no longer shows in the top bar when nobody is signed in (#379).
- Signed-out visitors no longer see the officials' bottom navigation while the page starts up, and the demo opens straight to its persona choice without the marketing page appearing first (#379).
### Changed
- Landing page rewritten for league appointments officers: a clearer headline and subheadline, the live demo as the main call to action (with "Set up my league free" second), plain English in place of jargon, a section on officials' data and safeguarding, and answers to common questions. Claims a new product can't back have been removed (#379).

## [2.58.0] — 2026-12-02
### Fixed
- The development-groups tests no longer depend on the time of day (the Preferred-group check now looks for the bonus, which a candidate already at the 100-point cap can't show in the total) (#375).
### Added
- Officials can see the leagues they belong to in their profile (My leagues), follow their join requests, and ask to join any other league; the league's administrators approve or decline as for new sign-ups (#373).
- Big demo (`DEMO_VOLUME_FIXTURES`, 3,000 on the Railway demo): three leagues of about 1,000 fixtures each (Newham, Midlands Regional and Northern Junior), each with its own assignor, venues, clubs and officials. When it is built, every feature is put to work through the app itself and the result of each step is reported in the server log and at `/api/demo/showcase`. See `docs/DEMO_GUIDE.md` for who to sign in as to check each feature (#372).
### Changed
- The demo no longer signs anyone in automatically: every new visit starts at the sign-in screen with the demo personas shown first, and a refresh keeps the persona chosen in that tab (#372).

## [2.57.0] — 2026-12-02
### Added
- Self-healing cover, optional per league (auto-appoint settings): when an official withdraws close to tip-off, CrewChief offers the slot to the best eligible officials in waves (3, then 5, then everyone eligible, faster as tip-off nears) and appoints the first to accept, re-checking they are still eligible. Officials get a "Cover needed" card and an email; assignors can start or stop a run from Needs Attention, see how many have been asked, and are told when it fills or runs out of people. Waves are sent by the server every minute, by `scripts/run_cover_waves.py` from cron where the server doesn't run as a process, and whenever assignors or officials load their pages (#369).

### Fixed
- A development-groups test no longer fails late in the day, when the first upcoming demo fixture already has an override recorded (#375).

## [2.56.0] — 2026-12-02
### Added
- Development groups, an optional league feature (League Setup, People & League Members, Development groups): put officials into groups such as "Pathway 1" or "National panel", then make each competition or division prefer certain groups (members rank first) or be strict (only members can be appointed; anyone else needs an override with a written reason, which is audited). Auto-assign, self-assign and cover claims never break a strict rule, shadow, observer and mentor slots are never restricted, and officials see their group on their profile (#366).

## [2.55.0] — 2026-12-02
### Added
- Coverage map for assignors (Fixtures, Map): where officials live (counted by postcode district, never full postcodes), venues rated Good, Thin or Short by how many officials will travel there over the next 4, 8 or 12 weeks, clubs at their home venue, and an automatic review in plain English of where appointing will be hard and what would help. Includes a table version and a CSV export (#364).
### Changed
- Postcodes are placed using every UK postcode district (bundled open data, no online lookup) instead of a handful of area letters, so travel distances for real addresses are much more accurate (#364).

## [2.54.4] — 2026-12-02
### Fixed
- When an official declines, the assignor's alert names a suggested replacement again (the lookup had been failing silently) (#361).
- Matchday outcome alerts (forfeit, abandoned, no-show) go only to the fixture's own league, not to assignors in other leagues (#361).
- Pre-tip-off matchday reminders are emailed (through the outbox when it is on) and recorded in the audit log (#361).

## [2.54.3] — 2026-12-02
### Changed
- Faster first load for big leagues: signing in fetches the season's fixtures once instead of three times, the offline copy is refreshed later when the app is idle, and the server builds its fixture summaries from one list. With 1,500 fixtures, sign-in to the Fixtures grid drops from about 5 seconds to about 2 (#358).

## [2.54.2] — 2026-12-02
### Fixed
- In the app installed on an iPhone, the header now sits below the status bar, so the account menu (profile, appearance, sign out) and notifications can be reached again; landscape also keeps clear of the notch (#354).

## [2.54.1] — 2026-12-02
### Changed
- Red count badges, danger buttons and red tags use a deeper red (#b91c1c), so white text on them is 6.5:1 in both themes (it was 3.8:1, and 2.8:1 for some in dark mode); the accessibility audit checks it (#350).

## [2.54.0] — 2026-12-02
### Added
- Matchday card on the referee's schedule from 3 hours before tip-off until the game ends: arrive-by time, directions, the crew with Call buttons (where shared), check-in and a quick way to report a forfeit, no-show or abandonment (#340).
- Optional daily safeguarding sweep (`EXPIRY_SWEEP=on`) that runs the DBS and licence check inside the server, queues emails for new lapsed-appointment notices when the email outbox is in use, and shows on Needs Attention when it last ran (#339).
- `scripts/seed_volume.py` and `scripts/perf_probe.js` for checking the app with a full season of fixtures; results are in `TEST_INFRA.md` (#342).
- Appoint from a small popover beside an empty or declined slot, with the top three available officials and a "More options" link to the Inspector (#330).
- Referees' schedule has Games, Open slots and Availability sections (`/official/open-slots`, `/official/availability`), so each game appears once and the page is about half as long on a phone (#332).
- Officials can choose to share their phone number with crew partners; it is shown only to officials on the same fixture, from 48 hours before tip-off until the game ends, with a Call button on the partner (#334).
- League travel limit setting (miles, one way) next to the matchday settings, replacing the fixed 50 miles (#331).
- Officials whose Enhanced DBS or licence lapses after they were appointed are now flagged on the fixture grid and cards ("DBS expired", "Safeguarding breach"), listed in Needs Attention as "Re-appoint" items, and told by the expiry daemon along with the assignor who appointed them (#319).
- "Data request" feedback category, used by the privacy page for access, correction and deletion requests (#326).

### Changed
- Orange buttons and active pills use a deeper court orange (#c2410c) in both themes, so white text on them is 5.2:1 (it was 3.6:1, and 2.8:1 in dark mode), and light-mode orange links and text darken to match; the accessibility audit now checks both (#347).
- After an action (appoint, remove, restore, accept, decline, accept several, edit a fixture, auto-appoint) the server returns the fixtures it changed and the page updates them in place instead of downloading everything again; hidden views are drawn when they are next shown, not after every change. With 1,500 fixtures an appointment shows in about 0.3 s instead of 1.7 s (#336).
- The backups and audit-log dialogs load when first opened; dialog bodies use the current build version and are cached for offline use; only start-up scripts are fetched at high priority (#337).
- Colour tokens defined once; light-mode green and amber text and green buttons darkened to at least 5:1 contrast; the accessibility audit checks contrast from the stylesheet's own tokens; more decorative emoji hidden from screen readers (#338).
- The availability calendar and heatmap open on the current month, and the heatmap's "next 14/30 days" start today (both were fixed to November 2026) (#341).
- Fixtures page: one compact row of counts (still click-to-filter), the webhook status only appears when a sync is running or failing, shorter view switch labels, no chip row repeating a lone date preset, and the Inspector starts closed (#328).
- Fixture rows are about half as tall: tip-off time first, one-line matchup, status as a compact count, carpool as an icon beside the crew (#329).
- Override reasons need at least 10 characters everywhere, statutory blocks are explained in a dialog instead of a browser alert, and miles beyond the travel limit are shown in red (#331).
- Phones use one bottom navigation per role (Games, Availability, Pay, Assessments for officials; Attention, Fixtures, Availability, Finance for assignors) that goes through the router, so the address and Back button work; the duplicate top tabs are hidden (#333).
- The Fixtures toolbar's "Finance & Reports" menu is now "Exports", to tell it apart from the Finance & Claims tab (#335).
- The start-up globals check counts functions an app script publishes on `window` as declared by the app, and records the browser globals `DOMParser`, `Error`, `Event` and `Image`; it was failing wherever the TypeScript compiler is installed (#343).
- One definition of "urgent" for the nav badge and the Needs Attention page, fixture totals scoped to the active league, unfilled slots counted from each fixture's real slot list (table officials included), declines that have already been replaced no longer listed, and the referee "awaiting reply" badge uses the same count as "Needs your response" (#320).
- The Inspector opens on the first fixture in view that still needs an official instead of a hard-coded past fixture, and shows the fixture's date prominently (#321).
- Expiry wording reads "Expired 22 days ago" / "Expires in 5 days" instead of negative "days remaining" (#322).
- Referee game-day links (directions, assignor contact, calendar view switches) are at least 44px tall, with a full-width "Call assignor" button; officials can now see an assignor's phone number, and no made-up fallback contact details are shown (#323).
- Content scrolled into view on phones stops clear of the sticky header and floating bottom navigation (#324).
- The header glass is light in light mode (the inactive role toggle was barely visible), every view has an h1, and decorative emoji in buttons are hidden from screen readers (#325).
- The platform owner's address is read from the `OWNER_EMAIL` environment variable instead of being written into the code and public pages. Without it the owner profile keeps a reserved `.invalid` address that nobody can sign in with, and it takes the real address once `OWNER_EMAIL` is set (#326).
- Crew partner text on the referee hub names the roles still to be appointed instead of "Solo assignment", declined officials are no longer listed as partners, and Accept is green everywhere (#327).
- Reuse rendered demo portraits within each process to speed up database setup in CI (#311).
- Report Python test timings by module in CI and require passing main CI for the selected release commit before publishing (#313).
- Run the Python suite in two parallel CI jobs and require both to pass before release (#315).
- Rebalance Python CI shards using the measured cost of test fixtures and execution (#317).

## [2.53.1] — 2026-12-01
### Fixed
- Rochen deployment uses the selected published release tag and requires a successful CI run for its commit. The full Python suite runs in CI with a longer time limit (#310).
- Restored the tenancy route inventory, aligned startup and integration checks with the current application, and fixed season-division controls, auto-assignment validation, and SQLite connection cleanup (#310).
- Updated the development dependency lockfile to clear the cross-spawn advisory in CI (#310).
- The Rochen installer retains a pre-deploy SQLite snapshot and rejects archives containing database files, preserving writes made during the deploy (#310).

## [2.53.0] — 2026-11-30
### Added
- **Per-League Rules & Documents Library (#307):** Replaced the hardcoded 6-card Rulebook modal with a dedicated full-width **League Rules, Documents & Film Room** page (`/resources`, `public/app-26-resources.js`, `backend/resources.py`) where league assignors can upload `.pdf`, `.docx`, `.txt`, and `.md` files (up to 5 MB, pure-stdlib validation + ZIP-bomb guard) or add external links, alongside pinned live official reference links (FIBA, Basketball England, CPSU Safeguarding).
- **Native In-App PDF & Word Reader + Full-Text Search (#307):** View uploaded PDFs inline (`GET /api/league/documents/{id}/file`) and read `.docx`/`.txt`/`.md` handbooks natively on mobile without Word (`GET /api/league/documents/{id}/reader`), with full-text search and highlighted matching snippets across titles, notes, and extracted document text.
- **Interactive Film Room & Tough Calls (#307):** Added `/resources/film-room` (`GET/POST/DELETE /api/league/film-clips`) where Assignors and Accredited Mentors can publish YouTube breakdowns (`Tough Call`, `Good Call`, `Missed / Bad Call`, `Mechanics`, `Table & Clock`) using privacy-enhanced `youtube-nocookie.com` embeds (with `?t=` timestamp support), scenario prompts, and interactive **Reveal Official Ruling** cards (verdict, rule citation, coaching takeaway). Pre-seeded demo `.docx`, `.pdf`, and Film Room clips in `backend/demo_seed.py`.


## [2.52.2] — 2026-11-30
### Changed
- **Working Footer Links (#306):** Replaced the 4 non-clickable `Quick Access` `<span>` items and static `Enhanced DBS` `<span>` in `#app-footer` (`public/index.html`, `public/app-20-wire-auth-and-nav.js`) with working **Help & Account** links (*Rules & Guidance (BE / FIBA)*, *My Profile & Security*, *Notifications & Reminders*, *Send Feedback*) and tightened the brand description.


## [2.52.1] — 2026-11-30
### Changed
- **Unified CrewChief UK Brand Logo Across UI (#305):** Replaced the legacy topbar wireframe SVG and the `🏀` emoji brand marks in the footer, login gate, and token response card with the unified CrewChief UK emblem (`public/icon.svg`) in `public/index.html`.


## [2.52.0] — 2026-11-30
### Added
- **Official Profile Images & EXIF-Stripped Upload (#304):** Added `user_avatars` SQLite table + `users.avatar_updated_at` (`backend/database.py`), pure-stdlib magic-byte validation (`backend/avatars.py`, JPEG/PNG/WebP only, 150 KB cap, SVG blocked), and `GET / PUT / DELETE /api/users/{id}/avatar` endpoints (`server.py`) with ETag caching, `nosniff`, and cross-league tenancy isolation.
- **Profile Photo Uploader & Consistent UI Avatars (#304):** Added a 256×256 client-side center-crop & EXIF-stripping photo uploader to **My Profile** (`#view-ACCOUNT_PROFILE`, `public/app-20-wire-auth-and-nav.js`), and rendered avatars consistently via `renderUserAvatar()` across the Topbar, Official Hub, People & League Members, and Candidate Inspector Drawer.
- **Default Demo Portraits (#304):** Seeded distinct pure-stdlib illustrated referee/assignor/club portraits for all demo users in `backend/demo_seed.py` so demo sandboxes display profile photos by default.


## [2.51.0] — 2026-11-30
### Added
- **Original CrewChief UK Brand & PWA Icon Set (#303):** Created original geometric basketball-and-whistle icons (`public/icon.svg`, `public/icon-192.png`, `public/icon-512.png`, `public/apple-touch-icon.png`), deleted legacy `public/be-logo.png`, updated `public/manifest.json`, `public/index.html` favicons/OG tags, `public/service-worker.js`, and `public/app-13-wire-chrome.js`, and added a regression guard test.

### Changed
- **High-Converting Landing Page Redesign (#303):** Upgraded `#view-LANDING` in `public/index.html` and `public/styles.css` with a sharper hero (`Start 14-day free trial` + `Explore live demo`), Conflict Engine suitability preview card, 4-metric proof strip, role-based value cards (Assignors, Officials, Clubs & Treasurers), 4-card UK-first highlights grid, closing CTA band, and independent platform disclaimer.
- **GitHub `README.md` Overhaul (#303):** Replaced the outdated README with a modern `v2.51+` showcase featuring the new brand emblem, status badges, comparison table, current feature overview, quickstart, architecture map, and preserved operational hosting runbooks.


## [2.50.2] — 2026-11-30
### Changed
- **Single Prominent Summary on Fixtures Workbench (#302):** Removed the duplicate top `Needs Attention` banner (`#workbench-needs-attention-banner`) and bottom `Today’s critical items:` strip (`#workbench-critical-strip`) from `#view-ASSIGNOR_WORKBENCH` (`public/index.html`, `public/app-03-assignor-workbench.js`), leaving the 6 clickable KPI cards (`#assignor-kpi-strip`) as the single summary and reclaiming ~140px above the Fixture Grid.


## [2.50.1] — 2026-11-30
### Fixed
- **Auto-Appoint Settings UI Wiring (#301):** Fixed `initAutoAssignUI()` in `public/app-04-auto-appoint.js` which exited early looking for the removed `#dialog-aa-settings` instead of `#view-AUTO_ASSIGN_SETTINGS`, restoring the *How it works / Settings* tabs, *Save settings*, *Reset*, and *Compare methods* controls.

### Changed
- **Decluttered Operations & Approvals Menu (#301):** Removed duplicate entries from `#menu-ops` (`Auto-Appoint Settings`, `Crew & Table Templates`, `Expiry & Safeguarding Warnings`, `Import Aliases` — already available in League Setup, KPI tiles, and Import Fixtures), moved `Quick-Start League Setup Wizard` (`#btn-open-setup-wizard`) into `#menu-league-setup`, and scoped `#ops-alert-badge` to the Reschedule Queue count.


## [2.50.0] — 2026-11-30
### Added
- **Assignor Pending Club Fixture Requests Queue (#300):** Surfaced pending `GET /api/club/fixture-requests?status=PENDING` submissions directly on `#view-ASSIGNOR_WORKBENCH` (`#workbench-club-requests-banner`, hidden when empty) with inline **Approve** (auto-creates the fixture with Home Team's Division & Season match fees) and **Reject** actions (`POST /api/club/fixture-requests/{id}/decide`) in `public/app-03-assignor-workbench.js` and `public/index.html`.
- **Workbench Season Filter (#300):** Added `#filter-season` inside `#advanced-filters-drawer` populated from `state.seasons` (`public/app-02-helpers-bootstrap.js`) and wired into `getFilteredGames()`, active filter chips, and Clear All Filters (`public/app-03-assignor-workbench.js`, `public/app-21-wire-workbench-and-portals.js`).

### Changed
- **Workbench Toolbar & Operations Menu Declutter (#300):** Folded the 5 Weekend Operations & Smart Tools actions (`Nudge Weekend Unconfirmed`, `Send Unassigned Digest`, `Auto-Group Double-Headers`, `+ Shadow / Observer Slot`, `Import Aliases`) from `#rm-assignor-ops-bar` (`public/app-22-roadmap-features.js`) into the existing **Operations & Approvals** dropdown (`#menu-ops`), and removed the duplicate `#btn-open-import-export` item from `#menu-reports`.


## [2.49.0] — 2026-11-30
### Added
- **League Activity Filters & Finance Category (#299):** Added `finance` category, `actorId` (filter by actor or affected official), `q` (keyword search across actor, official, fixture code, action, and details), and `sinceDays` (24h / 7d / 30d) filters to `GET /api/league/activity` (`backend/audit_log.py`, `server.py`), plus Category pills, affected-person subtext, and Person/Timeframe/Search controls in `#lm-panel-activity`.
- **Browser Back/Forward Support for People Hub Tabs (#299):** Registered clean subtab routes (`/setup/members`, `/setup/members/requests`, `/setup/members/viewers`, `/setup/members/activity`) in `public/app-24-router.js` and wired tab switches in `public/app-06-league-members.js` through `window.navigateTo()` so browser Back/Forward and the breadcrumb Back button navigate smoothly between tabs.


## [2.48.2] — 2026-11-30
### Changed
- **Single Interactive Filter & Counter Bar (#298):** Removed the redundant non-clickable `.user-mgmt-stats-strip` box in People & League Members (`#lm-panel-pool`) and embedded live count badges directly inside each interactive role/status filter pill (`All`, `Assignors`, `Officials`, `Mentors`, `Club Reps`, `DBS Alert`) in `public/index.html` and `public/app-06-league-members.js`.


## [2.48.1] — 2026-11-30
### Fixed
- **People & League Members Layout & Table Clipping (#297):** Widened `.lm-container` from `1100px` to `1480px`, added `overflow-x: auto` and inner padding to `.lm-panel` / `.lm-panel .table-container` in `public/styles.css`, and balanced column `min-width` values on `#view-LEAGUE_MEMBERS` so the Actions column (`Edit`, `Credentials`, `Remove`) never clips on the right edge.


## [2.48.0] — 2026-11-30
### Changed
- **Consolidated People & League Members Hub (#296):** Merged `#view-USER_MANAGEMENT` and `#view-LEAGUE_MEMBERS` into a single **👥 People & League Members** page under League Setup (`/setup/members`, with `/setup/users` aliased), combining KPIs, `+ Register New User`, Add Existing Official by Email, Role/Mentor/DBS filter pills, and inline **✏️ Edit**, **Verify/Credentials**, and **Remove** actions on every row in `public/app-06-league-members.js` & `public/index.html`.
- **Relocated Matchday Check-In Mode (#296):** Moved the league Matchday Mode toggle and pre-tipoff alert threshold out of the Members header into **Auto-Appoint Settings → Settings for this league** (`#view-AUTO_ASSIGN_SETTINGS`), and further reduced gzipped `public/index.html`.


## [2.47.0] — 2026-11-30
### Fixed
- **Official Hub Assessments Scoping (#295):** `renderEvaluationsView()` (`public/app-08-evaluations-auth.js`) now scopes `#view-EVALUATIONS` to the signed-in official’s own assessments whenever `state.activeWorkspace === "OFFICIAL"` (even for dual-role Assignor/Admin accounts), reserving the Executive Assessment Review List and submission form for the Assignor workspace; hardened unauthenticated bootstrap in `backend/database.py` to always return `[]` for `evaluations`.

### Added
- **Mentor & Developing Official User Management Toggles (#295):** Exposed `isMentor` (`users.is_mentor`) and `isDeveloping` (`users.is_developing`) across `get_user_by_id`, `list_users`, `create_user`, and `update_user_roles_and_cert` (`backend/database.py`, `server.py`), added `🎓 Accredited Mentor` and `🌱 Developing / Rookie Official` checkboxes to `#dialog-create-user` and `#dialog-edit-user-mgmt`, and displayed Mentor/Developing badges in User Management (`public/app-06-league-members.js`).


## [2.46.0] — 2026-11-30
### Added
- **Club Fixture Request Email Alerts (#294):** Submitting a club fixture request (`POST /api/club/fixture-requests`) now queues an alert to league assignors (`CLUB_FIXTURE_REQUEST_SUBMITTED`), and approving or rejecting (`POST /api/club/fixture-requests/{id}/decide`) notifies the requesting Club Rep (`CLUB_FIXTURE_REQUEST_DECIDED`) with the created fixture ID or decision notes.
- **Club Portal Request Queue & Reschedule Polish (#294):** Added the **📋 Club Fixture Request Queue** form and live status list (`#club-fixture-request-card`) inside `#view-TEAM_REP_PORTAL` (`public/index.html`, `public/app-07-expenses.js`), and pre-filled the fixture’s actual tip-off time on the Club Portal **Request Rearrangement** dialog.


## [2.45.0] — 2026-11-30
### Added
- **24-Hour Pre-Tipoff Matchday Reminders (#293):** Added idempotent `dispatch_matchday_reminders()` in `backend/matchday.py` (tracking `appointments.reminder_24h_sent_at`), exposed via `POST /api/admin/reminders/dispatch` and standalone cron script `scripts/dispatch_matchday_reminders.py` (queues email notifications + best-effort Web Push).
- **Quick Game-Day Forfeit / Abandonment / No-Show Reporting (#293):** Added `POST /api/games/{id}/matchday-outcome` (`games.match_outcome_flag` / `games.outcome_note`), a 1-click **🚩 Flag Issue** action in Official Hub (`public/app-05-referee-portal.js`) that alerts league assignors and surfaces an amber outcome badge on the Assignor Workbench (`public/app-03-assignor-workbench.js`).


## [2.44.0] — 2026-11-30
### Added
- **Official Remittance Advice Slips (HTML + Email, #292):** Added printable A4 HTML remittance statements (`GET /api/finance/remittances/{official_id}/html`) with masked BACS destination digits and self-or-assignor access control, plus batch email dispatch (`POST /api/finance/remittances/send`) with audit logging and a `🧾 Remittance` link on every official claim row in `public/app-07-expenses.js`.
- **Accounting Software CSV Exports (#292):** Added `GET /api/exports/accounting.csv?provider=xero|quickbooks|freeagent&kind=club_invoices|official_payouts` and a Finance toolbar export preset selector in `public/index.html` & `public/app-15-wire-actions.js` for ready-to-import Xero, QuickBooks, and FreeAgent CSVs.


## [2.43.0] — 2026-11-30
### Fixed
- **Lazy-Loaded Changelog Archive Markdown & Mobile Overflow (#291):** Added safe inline Markdown rendering (`**bold**`, `` `code` ``, `*italic*`) in `public/app-13-wire-chrome.js`, dynamically deduplicated versions already rendered inline in `#dialog-changelog` (removing the stale hardcoded `.slice(5)`), and added `min-width: 0` / `overflow-wrap: anywhere` rules in `public/styles.css` so long paths never clip past the card border on mobile.

### Changed
- **Lazy-Loaded Admin Modal Partials & Page Budget (#291):** Extracted `#dialog-league-setup-wizard`, `#dialog-sync-schedule`, and `#dialog-super-admin` bodies into static partials under `public/partials/` hydrated on first open via `ensureDialogPartialLoaded()` (`public/app-02-helpers-bootstrap.js`), and trimmed legacy inline `#dialog-changelog` cards to keep only the latest release inline — reducing gzipped `public/index.html` from `81.5 KB` to `73.5 KB` (+10 KB headroom).



## [2.42.0] — 2026-11-30

> **Platform UX Phase 3: Official Quick-Block Weekend/Holiday Availability & Club Portal Fixture Request Queue (#287):** Adds 1-click Weekend and Holiday Date Range availability blocking in Official Hub, plus a structured Club Fixture Request workflow where Club Reps submit division-linked fixture requests that Assignors can approve into live fixtures with automatic grade and fee defaults.

### Added
- **Official Quick-Block Availability Bar (`public/index.html`, `public/app-25-competitions.js`, #287):** Added 1-click **Block This Weekend** and **Block Holiday Range** controls in Official Hub (`#view-OFFICIAL_PORTAL`) posting `UNAVAILABLE` blocks directly to `/api/officials/availabilities`.
- **Club Fixture Requests Workflow (`backend/competitions.py`, `backend/database.py`, `server.py`, #287):** Added `club_fixture_requests` table and `GET/POST /api/club/fixture-requests` + `POST /api/club/fixture-requests/{id}/decide` endpoints (with cross-league tenancy isolation) that inherit the home team's structured Competition & Division and auto-create the fixture with resolved season match fees on approval.


## [2.41.0] — 2026-11-30

> **Platform UX Phase 2: Dedicated Full-Page Workflows for Profile (`/account/profile`), Notifications (`/notifications`) & Auto-Assignor Settings (`/setup/auto-assign`) (#286):** Promotes the three remaining heavy modals into dedicated full-width routed pages above `#app-footer` with Liquid Glass breadcrumbs and native browser Back/Forward support.

### Changed
- **Dedicated My Profile & Security Page (`/account/profile`, `#view-ACCOUNT_PROFILE`, #286):** Promoted `#dialog-profile` into a full-width responsive page accessible to all signed-in roles.
- **Dedicated Notifications Inbox (`/notifications`, `#view-NOTIFICATIONS`, #286):** Promoted `#dialog-notifications` into a full-width page reachable directly from the topbar bell icon.
- **Dedicated Auto-Appoint Settings Page (`/setup/auto-assign`, `#view-AUTO_ASSIGN_SETTINGS`, #286):** Promoted `#dialog-aa-settings` into a full-width page with a direct entry in **League Setup → Auto-Appoint Settings**.


## [2.40.0] — 2026-11-30

> **Platform UX Phase 1: Participating Divisions UI, Club Recharge Division Sub-Rows, ★ Panel Candidate Pill & Lazy-Loaded Changelog (#285):** Surfaces all live `v2.38.0` backend capabilities in the UI and cuts initial `index.html` payload size by lazy-loading historical changelog entries from `CHANGELOG.md`.

### Added
- **Participating Divisions Checklist (`/setup/seasons`, #285):** Added `#season-participating-divisions-card` in `#view-SEASONS_MANAGEMENT` wired to `GET/PUT /api/seasons/{id}/divisions` so leagues can toggle participating divisions per season visually.
- **Expandable Division Breakdown in Club Recharge (`public/app-07-expenses.js`, #285):** Added per-club expand/collapse controls revealing nested per-Division fixture counts, floor fees, table fees, travel expenses, and subtotals.
- **Candidate Inspector `★ Panel` Pill (`public/app-03-assignor-workbench.js`, #285):** Displays a gold `★ Panel` badge next to approved Competition/Division panel officials (`+25` suitability boost) in the Candidate Inspector drawer.

### Changed
- **Lazy-Loaded Changelog Archive (`public/index.html`, `public/app-13-wire-chrome.js`, #285):** Keeps the latest releases inline in `#dialog-changelog` and loads older release history on demand from `CHANGELOG.md`, trimming initial HTML weight significantly.


## [2.39.1] — 2026-11-30

> **Hotfix: Move Full-Page Views Above `#app-footer` (#284):** Relocates `#view-SEASONS_MANAGEMENT`, `#view-COMPETITIONS_ADMIN`, and `#view-SEASON_REPORT` above `<footer class="app-footer" id="app-footer">` in `public/index.html` so the page footer always renders below page content, and adds a permanent DOM-order regression test.

### Fixed
- **Footer rendering above full-page views (`public/index.html`, #284):** Moved `#view-SEASONS_MANAGEMENT`, `#view-COMPETITIONS_ADMIN`, and `#view-SEASON_REPORT` ahead of `#app-footer` so Seasons & Fees, Competitions & Divisions, and Season Committee Report render cleanly above the footer.


## [2.39.0] — 2026-11-30

> **Competitions Phase C: Dedicated Full-Page Workflows for Bulk Fixture Import (`/fixtures/import`) & Season Committee Report (`/reports/committee`) (#283):** Promotes the heavy Bulk Import/Export and Season Committee Executive Report modals into dedicated full-width routed pages with clean URLs, Season selector filtering, Liquid Glass breadcrumbs, and native browser Back/Forward support.

### Changed
- **Dedicated Bulk Import & Export Page (`/fixtures/import`, `#view-FIXTURE_IMPORT`, #283):** Promoted `#dialog-import-export` into a full-width page under `Assignor › Fixtures › Import & Export`, returning cleanly to Fixtures on completion.
- **Dedicated Season Committee Report Page (`/reports/committee`, `#view-SEASON_REPORT`, #283):** Promoted `#dialog-season-report` into a full-width page under `Assignor › League Setup › Season Committee Report` with an interactive Season selector dropdown, Competition & Division Coverage/Spend breakdown table, and synced A4 Print/PDF export.


## [2.38.0] — 2026-11-30

> **Competitions Phase B: Committee Report & Club Recharge Breakdown, Competition Official Panels & Season-Scoped Participation (#282):** Adds per-Competition and per-Division coverage/spend analytics to the Season Committee Report & Club Recharge summary, Competition/Division Official Panels with a +25 Auto-Assignor suitability boost, and Season-scoped Division participation preserved across Season Rollover.

### Added
- **Competition & Division Analytics in Season Committee Report & Club Recharge (`backend/database.py`, `backend/finance.py`, `server.py`, `public/app-14-wire-forms.js`, #282):** Added `competitionBreakdown` (fixtures, slot coverage %, declines, and floor/table match fee spend per Competition and nested Division) to both the in-app report and the printable A4 HTML export, plus `divisionBreakdown` per club in `get_club_recharge_summary()`.
- **Competition / Division Official Panels (`backend/competitions.py`, `backend/conflict_engine.py`, `server.py`, `public/app-25-competitions.js`, #282):** Added `competition_official_panels` table, `GET/PUT /api/competitions/{id}/panel`, a **★ Panel** editor in `/setup/competitions`, and a `+25` `panelMatch` suitability score boost + `★ Panel Official` tag in Candidate Inspector & Auto-Assignor.
- **Season-Scoped Division Participation (`backend/competitions.py`, `backend/seasons.py`, `server.py`, #282):** Added `season_divisions` table, `GET/PUT /api/seasons/{id}/divisions`, and automatic cloning of participating divisions during Season Rollover.


## [2.37.0] — 2026-11-30

> **Competitions Phase A: Deterministic DBS Safeguarding, CSV Division Reconciliation, Division-Scoped Team Pickers & Tier Reordering (#281):** Wires structured Competitions & Divisions directly into DBS safeguarding enforcement, CSV fixture import reconciliation, team-to-division backfill & fixture team grouping, and tier `sortOrder` reordering.

### Added
- **Deterministic DBS / Safeguarding Enforcement (`backend/database.py`, #281):** Updated `list_games()`, `_build_game_context()`, and `_is_junior_or_safeguarded_fixture()` to check `divisions.is_junior_safeguarded` and parent `competitions.is_junior_safeguarded` before falling back to legacy text tokens, ensuring reliable Enhanced DBS enforcement regardless of division naming.
- **CSV Smart Import → Structured Division Reconciliation (`backend/fixture_import.py`, `backend/fixtures_io.py`, #281):** Matches imported competition/division names & codes against active league Divisions (plus saved aliases), persists `competition_id` & `division_id` on imported fixtures, inherits default grade tiers when omitted in CSV, and resolves exact `BY_COMPETITION` division match fees.
- **Division-Scoped Team Pickers & Team Backfill (`backend/competitions.py`, `public/app-25-competitions.js`, #281):** Automatically backfills `teams.competition_id` & `teams.division_id` from legacy `age_division` and groups Home/Away team dropdowns in Add/Edit Fixture by the selected Division first (with all other league teams below for Cup/crossover games).
- **Tier Ordering (`sortOrder`) Controls (`backend/competitions.py`, `server.py`, `public/app-25-competitions.js`, #281):** Added `POST /api/competitions/reorder` and `POST /api/divisions/reorder` plus `↑`/`↓` controls in `/setup/competitions` so dropdowns across the app follow each league's exact tier hierarchy.


## [2.36.0] — 2026-11-29

> **Structured Competitions & Divisions in League Admin (#280):** Replaces free-typed competition/division strings with distinct, league-scoped relational **Competitions** and **Divisions** managed on a dedicated League Setup page (`/setup/competitions`), linked automatically across Fixtures, Teams, Match Fee Schedules, Season Rollover, and Assignor Workbench Filters.

### Added
- **Relational Competitions & Divisions Schema & API (`backend/competitions.py`, `server.py`, #280):** Added league-scoped `competitions` and `divisions` tables with inherited safeguarding, minimum floor/table grade, and crew template defaults; automatic startup backfill from legacy `games.age_level`; 1-click UK presets (`UK_NBL_STRUCTURE`, `UK_LOCAL_LEAGUE_STRUCTURE`); and full CRUD/archive endpoints (`GET/POST /api/competitions*`, `POST /api/divisions*`) with cross-league tenancy isolation.
- **Dedicated League Admin Page (`/setup/competitions`, `#view-COMPETITIONS_ADMIN`, `public/app-25-competitions.js`, #280):** Added a full-page Competitions & Divisions manager under **League Setup** with KPI summary cards, UK preset loaders, create/edit/archive flows for Competitions and nested Divisions, and clean History API routing.
- **System-Wide Structured Pickers & Fee Integration (#280):**
  - **Add / Edit Fixture & Directory Teams:** Replaced free-typed text inputs with cascading **Competition → Division** dropdowns that auto-apply inherited minimum grades, crew templates, and resolved season match fees.
  - **Match Fee Schedules & Season Rollover:** Upgraded per-competition fee rules to structured Competition/Division selectors with priority resolution (`division_id` → parent `competition_id` fallback → legacy label → season default), preserved across Season Rollover, plus a 1-click **Sync Rows from League Divisions** button.
  - **Workbench Competition Filter:** Dynamically populates `#filter-competition` from active League Competitions & Divisions (`comp:<id>` / `div:<id>`) alongside quick category filters.


## [2.35.3] — 2026-11-29

> **Hotfix: Fix Mobile Fixture Card Right-Edge Clipping, Topbar Row 1 Wrapping & Bottom Nav Offset (#279):** Fixes iPhone Safari fixture deck cards clipping past the right edge (`minmax(0, 1fr)` + `.card-venue-info { min-width: 0; flex: 1 1 auto; }`), puts Brand + Bell + Account Avatar cleanly on Row 1 (`width: auto`), and tightens `.mobile-bottom-nav` anchoring.

### Fixed
- **Mobile fixture cards clipped on right edge (#279):** Switched `.fixture-cards-deck` and `.deck-slots-grid` to `grid-template-columns: minmax(0, 1fr)` on `<=768px`, added `min-width: 0; flex: 1 1 auto;` to `.card-venue-info`, and added `overflow: hidden; padding: 0.85rem` on `.fixture-deck-card` + `flex-wrap: wrap` on `.card-top-bar` so long venue/team names never push cards past narrow phone viewports.
- **Mobile topbar Row 1 & bottom nav polish (#279):** Overrode legacy `.brand { width: 100%; }` with `width: auto` so Brand + Notification Bell + Account Avatar share one compact top row, and tightened `.mobile-bottom-nav` height/offset (`56px`, `bottom: max(6px, env(safe-area-inset-bottom))`).


## [2.35.2] — 2026-11-29

> **Hotfix: Fix Nested-Route API Prefix Breaking HTML Email Preview & Mobile Topbar/Form Overflow (#278):** Fixes `apiFetch()` (and CSV/report/backup download helpers) prepending clean multi-page routes like `/official/assessments` onto `/api/*` requests — which broke the notification HTML email preview — and fixes mobile topbar clipping and form select overflow on narrow phone screens.

### Fixed
- **HTML Email Preview & API calls failing on multi-page routes (#278):** Added `getApiBasePath()` in `public/app-02-helpers-bootstrap.js` (and updated `app-10`, `app-14`, and `app-17`) so only the legacy `/refsync` subfolder mount is preserved as a prefix, ensuring `/api/notifications/<id>/html` and all other API calls resolve cleanly from `/` regardless of the current route (`/official/assessments`, `/setup/seasons`, `/fixtures`, etc.).
- **Mobile topbar clipping & form select overflow (#278):** Added `@media (max-width: 768px)` responsive rules in `public/styles.css` placing Brand + Bell + Account Avatar cleanly on Row 1, full-width non-clipping League + Season Context Pill on Row 2, full-width Workspace Switcher on Row 3, tighter subnav pills, and `min-width: 0; max-width: 100%` on form cards and `<select>` inputs.


## [2.35.1] — 2026-11-29

> **Hotfix: Fix Router Infinite Recursion Preventing Fixtures & Seasons Page Rendering (#277):** Fixes a call-stack overflow introduced in v2.35.0 where `applySessionRBAC()` called `syncRouteToActiveView()` → `navigateTo()` → `applyRoute()` → `applySessionRBAC()`, interrupting bootstrap before fixtures and the dedicated Seasons page could render.

### Fixed
- **Fixtures & Dedicated Seasons Page Not Loading (#277):** Added `_inApplyRoute` re-entrancy guard and non-recursive `window.syncUrlForCurrentView()` in `public/app-24-router.js`, updated `syncRouteToActiveView()` in `public/app.js` to call `window.syncUrlForCurrentView()` (deferring initial deep-link redirect cleanly out of `applySessionRBAC()`), removed duplicate click navigation on `#btn-open-seasons-modal`, and fixed `seasonApiFetch()` in `public/app-23-seasons.js` to send `state.activeLeagueId`.


## [2.35.0] — 2026-11-29

> **Real Multi-Page URL Routing, Browser Back/Forward History, Breadcrumb Bar & Dedicated Seasons/Fees Page (#276):** Every major view now has its own clean, bookmarkable URL (`/attention`, `/fixtures`, `/availability`, `/finance`, `/setup/seasons`, `/setup/seasons/fees`, `/setup/venues`, `/setup/templates`, `/setup/users`, `/setup/members`, `/official/schedule`, `/official/expenses`, `/official/assessments`, `/club`, `/viewer`, `/login`) with full browser Back/Forward history, modal Back-to-close support, a Liquid Glass `← Back` & Breadcrumb bar, and Seasons & Match Fee Schedules promoted to a dedicated full-width page.

### Added
- **HTML5 History API Multi-Page Router (`public/app-24-router.js`, #276):** Added clean URL routing (`window.navigateTo`, `popstate` Back/Forward restoration, dynamic `document.title` per page, post-login `?next=` return, Ctrl/Cmd-click Open in New Tab, and backward compatibility for legacy `#/...` email links). Opening any `<dialog>` pushes a history state so pressing the browser Back button closes the modal cleanly instead of exiting the site.
- **Dedicated Full-Page Seasons & Match Fee Schedules (`#view-SEASONS_MANAGEMENT`, #276):** Promoted Seasons & Rollover (`/setup/seasons`) and Match Fee Schedules (`/setup/seasons/fees`) out of the modal into a full-width page with synced sub-tab URLs and browser Back/Forward support.
- **Liquid Glass `← Back` & Breadcrumb Bar (`#page-breadcrumb-bar`, #276):** Added a sleek translucent Back button and clickable breadcrumb trail right beneath the subnav so desktop, mobile, and installed PWA users always know where they are and can step back intuitively.
- **Production SPA Routing & Nested Asset Resolution (`public/.htaccess`, `public/index.html`, `public/service-worker.js`, #276):** Added LiteSpeed/Apache SPA fallback rewrite rule after `/api/*`, `<base href="/" />` for nested paths, and cached `app-24-router.js` in the service worker.


## [2.34.1] — 2026-11-29

> **Hotfix: Liquid Glass Dropdown Z-Index Stacking & Notification Badge Polish (#275):** Fixes `.glass-subnav` stacking context so `#menu-league-setup` always floats cleanly above the Needs Attention banner and KPI cards, positions the notification badge at the top-right corner of the glass bell pill, and slightly widens the desktop league selector.

### Fixed
- **League Setup dropdown rendered behind main content (#275):** Elevated `.topbar` (`z-index: 1200; overflow: visible`) and `.glass-subnav` (`position: relative; z-index: 1100; overflow: visible`) with `overflow: visible` on `.glass-subnav .role-tabs` so Liquid Glass dropdown menus always paint above page banners and cards.
- **Notification bell badge overlap (#275):** Positioned `#notif-count-badge` cleanly at the top-right corner of `.glass-icon-btn` and widened `.glass-context-pill .select-league` to `215px` on desktop.


## [2.34.0] — 2026-11-29

> **Apple Liquid Glass Navigation Overhaul (#273) & Flexible Season Match Fee Schedules (#274):** Redesigns the topbar, contextual subnav, and workbench chrome with translucent Apple Liquid Glass floating capsules and frosted dropdowns, cutting header clutter by ~70%; and adds fully customisable per-season Match Fee Schedules supporting Flat, Per-Competition (National League / NBL), and Per-Official-Level (Non-National / Local League) rates with one-click Basketball England 2026/27 presets.

### Added
- **Apple Liquid Glass Navigation & IA Overhaul (#273):** Consolidated the topbar into a single floating translucent Liquid Glass bar with a joined League + Season glass context pill (`#topbar-context-pill`), glass Workspace Switcher (`Assignor` / `Official Hub` / `Club Portal`), Notification Bell, and an Account & Platform glass dropdown (`#menu-account` housing Profile, Appearance, Push, Super Admin, Backups, Rulebook, API Docs, Feedback, Install App, and Sign Out). Streamlined the Assignor subnav into 4 direct operational tabs (`Needs Attention`, `Fixtures`, `Availability`, plus a new direct `Finance & Claims` shortcut `#tab-assignor-finance`) and a grouped `League Setup ▾` glass menu (`#menu-league-setup`) with pending join-request badge mirroring, decluttered the Fixture Workbench primary action bar, and added full dark/light theme support plus `prefers-reduced-transparency` and `prefers-reduced-motion` accessibility fallbacks.
- **Flexible Season Match Fee Schedules — Per-Competition & Per-Official-Level (#274):** Added `seasons.fee_schedule_mode` (`FLAT` | `BY_COMPETITION` | `BY_LEVEL`), `seasons.mileage_rate_pence` (default 45p/mile), and the `season_fee_rules` table with full custom CRUD (`GET/PUT /api/seasons/<id>/fee-schedule`, `POST /api/seasons/<id>/fee-schedule/apply-preset`, `GET /api/seasons/<id>/resolve-fee`). Upgraded `#dialog-seasons` into a 2-tab **Seasons & Rollover** | **Match Fee Schedule** modal with one-click editable Basketball England 2026/27 presets for both **National League (NBL / WNBL / Jnr NBL per competition, including Jnr NBL £37 regular-season combined cap)** and **Non-NBL / Local League (by verified Referee & Table Official Level 1–4 / FIBA)**, automatic competition fee resolution on Add Fixture & CSV Import, and automatic fee schedule cloning on Season Rollover.


## [2.33.0] — 2026-11-29

> **First-Class League-Scoped Seasons, Season Switcher, Rollover & Season Fee Defaults (#272):** Elevates Seasons into a league-scoped domain with `season_id` on fixtures and CSV imports, a Topbar Season Switcher, read-only archived seasons (with 1-click Unarchive), a Season Default Match/Table Fee editor (with optional bulk apply to scheduled fixtures), and One-Click Season Rollover.

### Added
- **First-Class League-Scoped Seasons & Season Switcher (#272):** Scoped `seasons` per league (`league_id`, `status`: `ACTIVE` | `UPCOMING` | `ARCHIVED`, `default_game_fee_cents`, `default_table_fee_cents`, `archived_at`, `rolled_over_from_season_id`) and linked fixtures via `games.season_id` with automatic startup backfill. Added Topbar Season Switcher (`#topbar-season-switcher` / `#select-active-season`), Archived Season read-only banner, and Target Season selector (`#fi-season-select`) in the 3-Stage CSV Fixture Importer.
- **Manage Seasons, Default Match/Table Fee Editor & One-Click Season Rollover (#272):** Added `#dialog-seasons` (`POST /api/seasons`, `POST /api/seasons/<id>`, `POST /api/seasons/<id>/archive`, `POST /api/seasons/<id>/rollover`) allowing Assignors to create seasons, edit default Floor & Table fees (with an optional checkbox to apply updated fees to all scheduled fixtures in that season), archive/unarchive past seasons (blocking accidental writes to archived seasons with `400 SEASON_ARCHIVED`), and roll over a season into the next year carrying forward fee defaults, clubs, teams, venues, and saved import aliases.


## [2.32.0] — 2026-11-29

> **Major Operations, Finance & Officials Feature Release (#264–#271):** Adds Incomplete Venues & Saved Import Aliases management (#264), Live 2-Way `.ics` Calendar Subscription Feeds (#265), Bulk Weekend Unconfirmed Nudges & Thursday Unassigned-Game Digest (#266), Multi-Game Double-Header Grouping with Auto-Assign continuity bonus & mileage deduplication (#267), Branded Club Recharge Invoices with PDF/Email dispatch & Paid tracking (#268), Automated Expense Receipt OCR pre-fill (#269), Mentor / Shadowing / Observer development slots (#270), and Official-to-Official Direct Swap Requests with 1-tap assignor approval (#271).

### Added
- **Incomplete Venues & Saved Import Aliases Manager (#264):** Surfaces venues missing postcode/address in Needs Attention with a quick-edit modal (`POST /api/venues/<id>/details`) that auto-geocodes UK postcodes for mileage, plus a Saved Import Aliases manager (`GET/POST/DELETE /api/league/import-aliases`) to review, edit, or delete remembered CSV mappings.
- **2-Way Calendar Sync — Live `.ics` Subscription Feed (#265):** Added per-official tokenized webcal feeds (`GET /api/calendar/<token>.ics`) with RFC 5545 `UID`, `SEQUENCE`, and `STATUS:CONFIRMED`/`TENTATIVE`/`CANCELLED` plus Copy, Regenerate, and Revoke controls (`GET/POST/DELETE /api/me/calendar-feed`).
- **Bulk Weekend Unconfirmed Reminder & Unassigned-Game Digest (#266):** Added one-click **Nudge Weekend Unconfirmed** (`POST /api/assignor/nudge-weekend-unconfirmed`, 12h per-appointment cooldown) and **Weekend Unassigned Digest** (`POST /api/assignor/weekend-unassigned-digest` + `scripts/send_weekend_digest.py` cron script).
- **Multi-Game Double-Header & Tournament Grouping (#267):** Added automatic & manual same-venue consecutive tip-off grouping (`POST /api/fixtures/auto-group-double-headers`), a +18 pt Auto-Assign same-venue continuity bonus in `backend/auto_assign.py`, and same-day same-venue mileage deduplication warnings (`GET /api/expenses/double-header-check/<appointmentId>`).
- **Club Recharge Invoices — Printable PDF / Email & Paid Tracking (#268):** Persisted `club_recharge_invoices` with sequential invoice numbers, branded printable PDF view (`GET /api/expenses/club-recharge/invoices/<id>/html`), Club Rep email dispatch (`POST .../send`), and Paid/Unpaid reconciliation (`POST .../mark-paid`).
- **Automated Expense Receipt OCR / Pre-fill (#269):** Added `POST /api/expenses/parse-receipt` (`backend/receipt_ocr.py`) extracting UK currency amounts, dates, and categories from uploaded parking/travel receipts to pre-fill Quick Expense and Full Expense claim fields.
- **Mentor / Shadowing & Observer Appointments (#270):** Added `SHADOW`, `OBSERVER`, and `MENTOR` development slots (`POST /api/games/<id>/development-slots`) with configurable £0 development rate or mentor stipend alongside working crews.
- **Official-to-Official Direct Swap Requests (#271):** Added conflict-free colleague discovery (`GET /api/appointments/<id>/swap-candidates`) and a 2-step colleague accept → 1-tap assignor approval workflow (`GET/POST /api/swaps`, `POST /api/swaps/<id>/respond`, `POST /api/swaps/<id>/decide`) that atomically reassigns the fixture slot.


## [2.31.3] — 2026-11-29

> **Hotfix: Quick Expense "Open Full Desktop Form instead" navigation (#263):** Fixes the **Open Full Desktop Form instead** button inside `#dialog-quick-expense` (and related expense fallbacks) so it properly switches to the **Fees, Mileage & Claims → My Claims** tab by calling `applySessionRBAC()` and `renderActiveView()`, pre-selecting the current fixture, and scrolling to `#form-submit-expense`.

### Fixed
- **Quick Expense "Open Full Desktop Form instead" button did not load the full form (#263):** Updated `#btn-quick-exp-full-form`, `openQuickExpenseDialog()`'s empty fallback in `public/app-07-expenses.js`, and the claim-expense fallback in `public/app-05-referee-portal.js` to set `state.activeView = 'EXPENSES'` and `state._activeExpTab = 'MY_CLAIMS'`, call `applySessionRBAC()` and `renderActiveView()`, and pre-select the appointment in `#exp-appointment-select`.


## [2.31.2] — 2026-11-29

> **Hotfix: Expenses Approve Claims KPI cards & missing CSS token aliases (#262):** Switches `#expenses-kpi-strip` from undefined `.stats-grid`/`.stat-card` classes to the standard `.kpi-strip`/`.kpi-card` 3-column card grid and defines the missing `--primary`, `--accent-amber`, and `--accent-green` compatibility token aliases in `public/styles.css`.

### Fixed
- **Fees, Mileage & Claims KPI summary cards unstyled (#262):** Replaced `.stats-grid`/`.stat-card` on `#expenses-kpi-strip` in `public/index.html` with `.kpi-strip` and `.kpi-card` (`.kpi-warning`, `.kpi-info`, `.kpi-success`) and defined `--primary`, `--accent-amber`, and `--accent-green` in `:root` in `public/styles.css` so Awaiting Approval, Approved Unpaid, and Paid (BACS Settled) render as a uniform 3-column card strip matching the rest of the portal.


## [2.31.1] — 2026-11-29

> **Hotfix: Restore Quick Actions, Demo Banner & Matchday CSS (#261):** Closes two unclosed CSS blocks (`.availability-banner-text` and `#notif-count-badge`) and removes a leftover `=======` merge-conflict marker in `public/styles.css` that caused browsers to ignore ~880 lines of downstream styling (including Quick Actions, Demo Banner, Matchday Mode, Season Statement, and Liquid Glass polish), and adds an automated CSS brace-balance & conflict-marker regression test.

### Fixed
- **Quick Actions, Demo Banner & downstream styles unstyled (#261):** Closed `.availability-banner-text` and `#notif-count-badge` and removed the stray `=======` merge-conflict marker in `public/styles.css`, restoring full card, grid, and tile styling for `#official-mobile-home` (Quick Actions), `.demo-site-banner`, Matchday Mode, Season Statement, and Needs Response, and added `test_styles_css_has_balanced_braces_and_no_conflict_markers` in `tests/test_infra_improvements.py`.


## [2.31.0] — 2026-11-29

> **Smart CSV fixture reconciliation, safeguarding RBAC fix & release-gate enforcement (#258–#260):** Redesigns the CSV fixture importer into a 3-stage smart-reconciliation wizard with 3-tier matching, inline entity creation, shared parent club inference, saved aliases, duplicate skip/update toggle, and atomic transactions (#259); restores safeguarding contact details for Assignors, Super Admins, and officials on their own forms (#258); and adds a `--require-released` pre-deploy guard so production deploys always cut a versioned release and update the in-app changelog (#260).

### Added
- **3-Stage Smart-Reconciliation CSV Fixture Importer (#259):** Redesigned the fixture CSV importer so assignors are never hard-blocked by missing Teams, Venues, Courts, or Competitions. Stage 2 extracts unique entities and runs 3-tier matching (Exact, Saved Alias via `import_entity_aliases`, and Fuzzy/Acronym similarity handling abbreviations such as `NYBL`, `UEL SportsDock`, and `St Bon's`), with auto-matched items collapsed by default, inline "Create New" (inferring team gender, age group, and shared parent club name, plus optional venue postcode/address or `is_incomplete` flagging), a "Remember this mapping for future imports" toggle, and a one-click "Create all unmatched items" action. Stage 3 adds an entity creation summary, an optional "Update existing scheduled fixtures matching Fixture code" toggle (defaulting to Skip existing), and commits all new entities, aliases, and fixtures inside a single atomic database transaction.
- **Pre-deploy release gate (`--require-released`) (#260):** Added `--require-released` to `scripts/verify_changelog_sync.py`, wired it into `.github/workflows/deploy-rochen.yml`, and documented the mandatory release-on-deploy checklist in `AGENTS.md` so production deployments cannot proceed while `## [Unreleased]` contains unpromoted entries.

### Fixed
- **Safeguarding contact details now visible to Assignors, Super Admins, and officials on their own forms (#258):** Passed `actor_user_id` into `list_users()` from `get_bootstrap_data()` and recognized `SUPER_ADMIN`, `ADMIN`, `ASSIGNOR`, and league-level admin/assignor memberships so assignors see official phone/postcode/address and officials see their own details on expense forms, while other officials' details remain strictly safeguarded for non-assignors.


## [2.30.2] — 2026-11-29

> **UX, iOS passkey & notification polish release (#251–#257):** Fixes mobile header contrast and Quick Actions styling, adds Quick Expense BACS & fee breakdown (#251), excludes past fixtures from Needs Attention and Auto-Assign (#252), applies Design System & Light Mode contrast fixes including 720px `.modal-lg` desktop sizing (#253), fixes iOS Safari passkey + password manager sign-in going blank (#254), stops logging routine passkey sign-ins as unread EMAIL alerts (#255), and adds clickable links, a Respond CTA, and sandboxed HTML email preview in the Notification Outbox (#256).

### Added
- **Clickable links, Respond CTA, and HTML Email Preview in Notification Outbox (#256):** Notification cards now linkify URLs, show a direct **Respond to Appointment →** button for token-response links, and include a **View HTML Email** button backed by `GET /api/notifications/<id>/html` (with recipient & league tenancy isolation) opening a sandboxed preview modal with **Open in new tab ↗**.

### Fixed
- **Routine passkey sign-ins no longer logged as EMAIL notifications (#255):** Stopped inserting `PASSKEY_AUTH` rows into `notification_logs` on routine passkey sign-ins (no email is sent), and labelled historical `PASSKEY_AUTH` and `OAUTH_SSO` rows as `IN_APP` instead of `EMAIL`.
- **iOS Safari passkey + password manager sign-in going blank (#254):** `authenticateSessionUser()` now loads authenticated bootstrap data immediately after sign-in, removed the production `<datalist>` attribute on the email input to prevent iOS WebKit `autocomplete="username webauthn"` conflicts, isolated passkey `AbortController` instances, added double-tap protection, and surfaced conditional autofill verification errors.
- **UI & Design System Consistency Audit fixes (#253):** Fixed `.modal.modal-lg` desktop sizing (`720px`), defined missing `--court-accent` and `--accent` token aliases, replaced hardcoded dark-theme hex/rgba colors with semantic tokens for Light Mode contrast, standardized Plans/Demo/Rulebook modal chrome, removed raw API text from the Club Rep Portal heading, aligned Expenses to `<h2>`, added button hover/focus states, and fixed dead `.mobile-home-tile` selectors.
- **Exclude past and non-scheduled fixtures from Needs Attention and Auto-Assign (#252):** Defaulted `GET /api/assignor/needs-attention` and `get_assignor_needs_attention()` to `future_only=True`, filtered past reschedule requests, and skipped past, `CANCELLED`, and `COMPLETED` games in `plan_auto_assign()`.
- **Mobile header contrast/overlap, Quick Actions card, and Quick Expense BACS/breakdown (#251):** Fixed Light Mode contrast and mobile wrapping on `.workspace-pill` and `.subnav-bar`, restyled `#official-mobile-home` (Quick Actions) to match portal cards, wired Quick Expense directly to `openQuickExpenseDialog()`, and added fixture selection, Fee + Mileage + Parking breakdown, and BACS bank details to `#dialog-quick-expense`.


## [2.30.1] — 2026-11-28

> **Security, privacy & CI maintenance release: authenticated at-rest encryption for BACS bank details (#241) and Node 24 / GitHub Actions v7 upgrades (#245).** Encrypted `bacs_sort_code` and `bacs_account_number` individually at rest in `expense_claims` (`backend/field_crypto.py`) with an automatic startup migration for existing records, removed plaintext sort codes from notification logs/emails, scoped `get_bootstrap_data` expense claims to the acting official for non-assignors, cleared remembered BACS details from `localStorage` on sign-out, and updated `public/privacy.html`. Also includes the Node 24 / GitHub Actions v7 CI workflow and dependency updates (#245).


## [2.30.0] — 2026-11-28

> **Feature release: officials-first mobile home & push preferences, optional per-league Matchday mode, and guided demo tour.** Officials get a 3-action mobile quick home (Next Game with 1-tap Accept/Decline, Availability, Quick Expense), 5 per-event push/alert toggles, and assignors receive an instant replacement suggestion when an official declines (#224). Leagues can opt in to Matchday mode ("On my way" / "I've arrived" check-ins with no location tracking, 30-day auto-purge, offline tap queue, and a live assignor board highlighting officials not yet arrived within the threshold) (#207). Demo deployments now display a slim demo-only notice banner, the *"only assignor that shows its working"* landing/tour headline, Request Access flow, and an accessible vanilla-JS guided tour (#208).


## [2.29.1] — 2026-11-28

> **Maintenance & CI release: page-budget headroom, Python 3.12 test compatibility, and faster local checks.** Archived pre-2.27.1 release cards out of `public/index.html` into `CHANGELOG.md`, reducing gzipped page size by ~25 KB (-24.1% below baseline). Updated `tests/test_issue_119_database_split.py` to ignore Python 3.13-only class metadata dunders so the full suite runs cleanly on Python 3.12 and 3.13, and added `npm run test:fast` backed by `.githooks/pre-push`.


## [2.29.0] — 2026-11-28

> **Feature & reliability release: official game requests & self-assign, mobile quick expenses, and UX/security hardening.** Assignors can publish open game slots for request or self-assign with automatic clash, distance, and weekend-cap enforcement (#225). Officials get a sub-minute mobile expense flow with photo receipt capture, auto mileage, and an offline queue (#226). Includes fixes for My Officiating Hub TODAY/earnings sync (#219), distance override badges (#220), mobile header & webhook sync (#221, #222), today's critical items strip (#228), demo seed variety (#223), failed email resend (#195), TOTP QR setup (#196), landing pricing & demo tour (#227), request body size limits (#193), SMTP TLS verification (#194), test temp DB cleanup (#215), CI page size budgets (#3), and an automated `.githooks/pre-push` guard hook. After deploying: run the RochenHost deploy and restart the Python app; hard-refresh once on each device (footer should read v2.29.0, Build 20261128a).


## [2.28.0] — 2026-11-27

> **Feature release: your inbox, availability and tax-year statements.** Officials get one list of what needs their answer, with a plain-words clash check for each and Accept all for the clear ones, and the bell shows an unread count (#205). Each month officials confirm their availability (or add the dates they are away), and assignors see who has not confirmed and can send a reminder (#206). Officials have a season statement for a UK tax year or season, with a CSV download and a print view (#209). Assignors without a passkey or authenticator app are reminded to secure the account (#204). The page is split into feature scripts with a proof of identical behaviour (#147, #212). After deploying: run the RochenHost deploy and restart the Python app; hard-refresh once on each device (footer should read v2.28.0, Build 20261125u); the new tables and columns are added automatically; add the daily availability reminder cron line from the README (it does nothing before the 25th); as an official, check the list and Accept all; as an assignor, check Needs Attention shows availability.

### Added (availability: confirm each month, assignors see the gaps, and a nudge, #206)

- **Officials confirm their availability for the month ahead.** Availability is recorded as dates you are away, so "I have nothing to add" and "I have not looked" used to be the same. From the 20th of each month the official's home page shows **"Confirm your availability for December 2026"** with one button, **"My availability for December 2026 is up to date"**, and a link to add the dates they are away. Adding any date for that month also counts, and the banner disappears. A confirmation can be given for this month and the next three, saying it twice does no harm, and it is only ever recorded for the person who is signed in.
- **Assignors see who has not looked.** Needs Attention gets a card: **"12 officials have not confirmed availability for December 2026"**, with the list (only officials in the assignor's own leagues; a Super Admin sees every league) and **"Send a reminder email"** for the people they tick. An official can be reminded **once every 7 days**, however many assignors ask; the list says when someone can be reminded again. The assignor sees what happened for each person (sent, skipped and why, or could not be sent), and a reminder that could not be sent is never counted as sent.
- **A reminder email on the 25th.** Officials who have not set next month get one email around the 25th (a new script, `scripts/send_availability_reminders.py`, run once a day from cron; it does nothing before the 25th and never sends the same month twice). It goes through the normal outbox and email caps, is never combined with other emails, and has an unsubscribe link. Someone who has already confirmed, or who turned these reminders off, is never emailed.
- **New setting: "Monthly availability reminder"** in the Profile (on by default). The unsubscribe link in the email and "unsubscribe from all email reminders" both switch it off; unsubscribing from only the 24 or 48 hour reminders leaves it on.
- **A quiet note in the candidate list.** A candidate who has not confirmed or entered availability for the fixture's month gets an **"Availability not confirmed"** note. It is information only: it never blocks an appointment, never changes a clash result and never changes the order.
- **Months follow UK time** (summer time included), so a date range that only touches the first or last instant of a month does not count for that month.
- **The demo site is unchanged:** no banner, no card, no emails.
- After deploying: restart the Python app; hard refresh once; as an official, check the banner appears from the 20th (or set your computer's date to try it) and that one tap clears it; as an assignor, open Needs Attention and send a reminder to yourself; then add the cron line from "Availability reminders" in the README.

### Added (what needs your answer, in one list, and an unread count, #205)

- **Officials get a "Needs your response" list at the top of their portal.** Every appointment waiting for an answer, soonest first, with the fixture, role, date and time, venue and fee, and a plain-words check against your diary for each one: a double booking, too little travel time between two venues, a time you blocked out, or a short rest gap. Clashes are marked with a word and a shape (▲ clash, ◆ warning, ✓ clear), never by colour alone. Each one has Accept (or "Accept anyway" when there is a clash) and Decline (the same reason box as before).
- **Accept all (clear ones only).** One button accepts every appointment with no clash or warning, after a confirmation that lists exactly what will be accepted. Appointments with a clash or warning are always left for you. Each one is checked again at the moment it is accepted, so something that clashed in the meantime (another tab, another assignor) is left alone and you are told. Pressing it twice, or in two tabs, accepts each appointment once. Up to 50 at a time; one audit entry for each appointment, as if you had accepted them one by one. New routes: `GET /api/officials/appointments/needs-response` and `POST /api/officials/appointments/accept-batch` (your own appointments only; someone else's, a draft the assignor has not published and one that does not exist all read as "not found").
- **The "Open my appointments" button in the combined email now opens that list** (before, it opened a page that did not exist).
- **The bell now shows how many notifications are unread, and everyone signed in has it.** It was only shown to assignors. The number is the server's own count of your unread notifications (never other people's, never sign-in codes), it also appears in the page title, and the notifications window marks new ones and has "Mark read" and "Mark all read". Notifications that exist when you upgrade count as already read; only what arrives afterwards is unread. New routes: `GET /api/notifications/unread-count` and `POST /api/notifications/mark-read`.
- After deploying: restart the Python app; hard refresh once; as an official with several waiting appointments open the list, check a clashing one is explained and "Accept all" only offers the clear ones; check the bell shows a number and "Mark all read" clears it.

### Fixed (links into the app open the page they name, #205)

- **A link to a page inside the app (the button in an email, a shared link) now opens that page when you are already signed in.** Before, the app replaced the address with the page you used last, so a link to "#/expenses" opened the portal and the email button would have opened whichever page you had left open.

### Added (officials' season statement, #209)

- **Officials can see and download a statement of their fees, mileage and expenses.** In **Expenses, My statement** an official picks a **UK tax year** (6 April to 5 April; the current one is selected) or one of the leagues' seasons, and sees: fixtures officiated, match fees, mileage (miles, the rate used on each claim and the pounds), parking and public transport, and totals split into **paid**, **awaiting payment** and **rejected**, with every line showing the fixture, league, date and claim reference. **Download as CSV** (opens safely in a spreadsheet: text that starts with `=`, `+`, `-` or `@` is neutralised) or **Print / save as PDF** (a clean black-and-white print layout, no PDF library). It says plainly that it is a summary of what is recorded, **not tax advice**.
- **It is only ever your own.** The statement is always the signed-in official's; an `official_id` in the address is ignored, other leagues' private data never appears, and bank details are shown as the last four digits at most. An official who works in two leagues sees both, with the league named on each line.
- **It never invents a number.** Money is added in whole pence, so the totals match the claims to the penny. A match fee counts once a claim has been made; fixtures you played that have **no claim yet** are listed separately as "not yet claimed" with the fixture's standard fee, and are left out of every total. A rejected claim is listed but never added. The app records no separate paid date, only when a claim's status last changed, so the statement says **"marked paid"** and never "paid on", and shows "not recorded" when there is no time. Fixtures are grouped by their UK date (British Summer Time included), so a game at 00:30 on 6 April belongs to the new tax year.
- New routes `GET /api/officials/me/statement` and `GET /api/officials/me/statement.csv` (signed-in officials only; listed in the API description).
- After deploying: restart the Python app; hard-refresh once on each device (footer should read Build 20261125n); as an official, open Expenses, My statement, check the totals against your own claims for a tax year, download the CSV and print the page.

### Added (a reminder to secure your account, #204)

- **Assignors and admins are now reminded to add a passkey or an authenticator app.** After you sign in with a password, a banner says "Secure your account: add a passkey or an authenticator app so you can sign in without waiting for an email", with buttons that take you straight to the right set-up in your Profile. It goes away by itself as soon as a passkey or an authenticator app is on. It is only shown to assignors, league admins and Super Admins on a real site: never to officials, never on the demo site, and not when you signed in with Google (your security is Google's then).
- **"Remind me in 7 days" and "Not now (30 days)".** Your choice is remembered on the server, so it follows you to your other devices. A Super Admin can only be reminded again in 7 days.
- **An "Account Security" checklist in your Profile** shows, with a tick or an empty circle and plain words (not colour alone): passkey added, authenticator app on, and recovery codes left, each with a button that takes you to the right place when something is missing.
- **Nothing secret is involved.** The page only learns whether you have a passkey or an app, how many recovery codes are left, and when a reminder ends: never a secret, a code or a recovery code. New routes: `GET /api/account/security` and `POST /api/account/security/snooze` (for the signed-in person only). One small table, `account_security_prompts`, is added automatically.
- After deploying: restart the Python app, hard-refresh once, and sign in as an assignor with only a password: the banner should appear. Add a passkey or turn on the authenticator app and it should go away; "Remind me in 7 days" should hide it.

### Changed (internal, finding the next #192, #199)

- **A test-only switch and a real-site sweep, so a mistake like #192 cannot hide again.** Tests run on a demo build, where an action that names nobody is recorded against the demo assignor; a real site refuses it. That is why no test noticed that nobody could create a fixture (#192). `REFSYNC_STRICT_ACTORS=1` turns the demo fallback off so the whole test suite can be run the way a real site behaves (see the README). A new sweep, `tests/test_issue_199_real_mode_actor_sweep.py`, calls every action the page makes (about 80 requests across fixtures, appointments, auto-appoint, cover, evaluations, expenses, availability, imports, the league wizard, members, users and the platform routes) in a real-site world, and checks each one works, that none is refused for want of an acting user and that none answers with a server error. It also checks that every repository method that asks who is acting was reached by some route, and that every route call to such a method passes the signed-in person.
- **Result of the audit:** no other route had the #192 problem. Nothing a visitor can see changes in this release.

### Changed (internal, #147)

- **The start-up handler in `app.js` is being split into wiring scripts (first of three steps).** `app.js` was one 3,479-line closure that registers every button and form of the page. Four areas of it (dialog focus, close buttons, map links, form validity and the theme switch; the rulebook; the view switchers, print button and toolbar menus; the install prompt, "Chase all" and demo reset) now live in `app-13-wire-chrome.js`, each as one `initXxx()` function that `app.js` calls where that code used to be, and the four names that both the handler and the rest of the page use (`openChangelog`, `handleVerify2FACode`, `refreshSuperAdminOverview`, `renderSuperAdminLeaguesTable`) are plain top-level declarations in `app-12-wire-shared.js`. The handler is 570 lines shorter (2,909, from 3,479). **Nothing you can see or do changes.** Listeners on one element fire in the order they were registered, so each call sits exactly where its code was, and this was checked in a real browser: all 587 registrations made while the page starts, every later registration, every request, the page and a click through the main views are identical, signed out and as an assignor, and moving one call to the wrong place makes that check fail and name the displaced button.
- For developers: `scripts/app_split/` holds the tools that did and prove the move (see the README); `tests/test_issue_191_app_start_up_handler.py` pins the order of the start-up calls, that each wiring function is called once, that wiring scripts only declare, that a lifted block reads nothing the handler declares, and that the handler does not grow back. Two older tests now look at all the app scripts instead of `app.js` alone. After deploying, hard-refresh once.
- **Second of three steps: five more areas moved out of the start-up handler.** The backup, expense pre-fill, season block-out, pilot feedback and season report buttons; the fixture modal, crew templates, position types and bulk import; and the user and venue, court, club and team directory forms now live in `app-14-wire-forms.js`. The expense calculation and printing, calendar sync, iCal and BACS exports, test email, mobile navigation, service worker and offline banner; and the cover request, evaluation, expense claim, create fixture, bulk upload and the override, removal and decline dialogs now live in `app-15-wire-actions.js`. Each area is one `initXxx()` function that `app.js` calls where that code used to be. The handler is now 1,654 lines (from 2,909 after the first step and 3,479 before it) and 228 top-level statements (from 301). **Nothing you can see or do changes**, and this was checked the same way as before, in a real browser: the 587 registrations made while the page starts are identical and in the same order, as are every later registration (3,192), every request, the page and a click through the main views, signed out and as an assignor; moving one call to the wrong place makes the check fail and name the displaced button (`btn-open-create-user-modal`). The proof tool now ignores messages that Google's own sign-in script logs from its own code (it is blocked from the network here and logs only sometimes). After deploying, hard-refresh once.
- For developers: the page-size baseline lists the two new scripts (the page grows by 32 bytes for their tags, the scripts by 2,374 bytes, +1.4%, because each file is compressed on its own and the new `initXxx()` wrappers add a few lines). `tests/test_issue_191_app_start_up_handler.py` now also pins which wiring function lives in which script, and the handler line limit is 1,654.

### Added (page size budget, #3)

- **A check now stops the page getting bigger.** `scripts/check_page_budget.py` adds up how many bytes a visitor downloads (each file compressed the way the server sends it) for the page, the stylesheet and the app scripts, and compares them with a baseline kept in `tests/data/page_budget.json`. CI fails when a group is more than 3% bigger than its baseline, and the message names the group and how far over it is. Splitting a file into several does not change the total, so it does not fail. If the growth is justified, `--update` accepts the new size (say why in the pull request); `--report` shows the sizes and how far each is from the long-term goals. Nothing changes for visitors.
- **Where it stands today:** the page is 93.3 KB, the stylesheet 33.1 KB and the scripts 171.8 KB compressed, against the goals in issue #3 of 60, 25 and 100 KB. The baseline starts at today's sizes and is lowered as the files get smaller.

## [2.27.1] — 2026-11-25

> **Hotfix: creating a fixture works again.** Since v2.25.0, creating a fixture from the Create fixture dialog, the quick-add form or the bulk preset failed on a real site with "An acting user is required for this action." and created nothing (#192). A fixture is now always recorded as created by the signed-in person, and a request can no longer name someone else as the creator. After deploying: restart the Python app on RochenHost; hard-refresh once on each device (footer should read v2.27.1, Build 20261125j); sign in as an assignor and create a fixture from the Create fixture dialog.

### Fixed (creating a fixture on a real site, #192)

- **Creating a fixture works again on a real site.** Since v2.25.0, the Create fixture dialog, the quick-add form and the bulk preset answered "An acting user is required for this action." and made nothing: the fixture's creator was meant to come from the request, which the page never sends, and the old default person was removed in #173. The creator is now always the signed-in person.
- **A request can no longer name someone else as the creator.** Before, a signed-in assignor could put any user id in `createdBy` and have the fixture recorded against that person. On a real site that field is ignored. Demo and test builds behave as before.
- After deploying: restart the Python app, sign in as an assignor and create a fixture from the Create fixture dialog.

## [2.27.0] — 2026-11-25

> **Feature release: one email instead of many.** An official with several appointments awaiting a response, or several chases or fixture changes, now gets one email listing them instead of one per game, with each game's own accept-or-decline link (#187). Sign-in codes, password resets, emergency cover calls and the 24 and 48-hour reminders are never combined or delayed. With the outbox on, these emails can arrive up to 10 minutes later than before (`EMAIL_DIGEST_HOLD_MINUTES`, default 10; `0` turns combining off). After deploying: run the RochenHost deploy and restart the Python app; hard-refresh once on each device (footer should read v2.27.0, Build 20261125d); the outbox gains three columns automatically; with `EMAIL_DELIVERY_MODE=outbox` on, appoint yourself to two fixtures a minute apart, wait 10 minutes and check you get one email with two links; and press "Chase all" for an official with several unconfirmed appointments and check they get one email.

### Added (one email instead of many, #187)

- **An official with several appointments awaiting a response now gets ONE email listing them, not one email per fixture.** The same goes for chases and for fixture-change alerts: one email per person and kind, with every fixture's date, venue and role. **Each fixture keeps its own accept-or-decline link** (a link still works for that one appointment only), and one button opens the app. The first 25 fixtures are listed, then "and N more". Someone with exactly one item gets exactly the email they always got. **Never combined or delayed:** sign-in codes, password resets, emergency cover calls and the 24-hour and 48-hour reminders.
- **"Chase all" now sends one request**, so an official chased about three fixtures gets one email, not three (the page falls back to chasing one by one on an older server). New route `POST /api/appointments/remind-batch` (assignors only, at most 200 appointments, another league's appointments are refused as "not found"); each chase still counts, is audited and has its own link.
- **With the outbox, these emails wait up to 10 minutes so later ones can join them (`EMAIL_DIGEST_HOLD_MINUTES`, default 10; `0` turns combining off).** The trade-off: appointment, chase and fixture-change emails now arrive up to that long after the change, on the first cron run after the wait. When the oldest email for a person has waited that long, everything due for that person and kind goes out as one email. If that send fails, every fixture in it is retried together and none is marked sent. **A combined email counts once** against the sending caps and RochenHost's limits, so a digest of six fixtures is one of the 100 emails in ten minutes, not six. Without the outbox (`direct` mode) nothing waits: one operation (publishing drafts, applying an auto-appointment batch, "Chase all") sends one email per person when it finishes; separate requests are only combined by the outbox. Emails queued by an earlier version go out one by one as before.
- `scripts/dispatch_outbox.py` says how many emails were combined and how many are waiting for their hold, and `scripts/check_email_setup.py` shows the hold and no longer warns about an email that is only waiting for it. After deploying: nothing changes until `EMAIL_DELIVERY_MODE=outbox` is on; then appoint yourself to two fixtures a minute apart, wait 10 minutes and check you get one email with two links; and press "Chase all" on a fixture list where one official has several unconfirmed appointments.

## [2.26.0] — 2026-11-25

> **Email upgrade & RochenHost CGI mail delivery.** Outgoing emails are now rebranded from RefSync UK to **CrewChief UK**, use readable role names (`Crew Chief` instead of `CREW_CHIEF`), and render as responsive HTML cards with clickable action buttons and a highlighted 6-digit code box for 2-Step Verification (#182). On RochenHost, LiteSpeed CGI (`public/api.cgi`) now reads `/home/USER/.crewchief_mail_env` at startup so live web traffic and 2FA sign-in share the same authenticated mailbox settings as cron (#181). After deploying: hard-refresh once on each device (footer should read v2.26.0, Build 20261125a); confirm a test email renders in HTML; verify assignor 2FA + TOTP sign-in; then enable `EMAIL_DELIVERY_MODE=outbox` and the 5-minute `/opt/alt/python313/bin/python3 scripts/dispatch_outbox.py` cron job.

### Added (RochenHost CGI private mail environment, #181)

- **Web requests load `/home/USER/.crewchief_mail_env` automatically on RochenHost.** Added `load_env_file()` at startup in `public/api.cgi` so `SMTP_*` and `EMAIL_DELIVERY_MODE` settings stored in `/home/USER/.crewchief_mail_env` (`chmod 600`) apply to live web requests without committing secrets or modifying `.htaccess` (explicit environment variables still take precedence, and missing/unreadable files are safely ignored).

### Fixed (hosting account name in the changelog, #185)

- **The changelog no longer names the hosting account.** The #181 entry (here and in the in-app changelog) showed the full path of the private mail settings file, which includes the hosting account's login name. It now says `/home/USER/.crewchief_mail_env`, like the README.

### Added (CrewChief UK HTML emails, #182)

- **Outgoing emails are rebranded to CrewChief UK with human-readable role labels.** Updated the default sender display name (`CrewChief UK <noreply@refsync.newhamyoungbloods.co.uk>`) and outgoing notification subjects and bodies from `RefSync UK` to `CrewChief UK`, replacing raw role enums (`CREW_CHIEF`, `UMPIRE_1`, `TABLE_SCORER`) with readable titles (`Crew Chief`, `Umpire 1`, `Table Scorer`).
- **Emails include responsive HTML templates with clickable action buttons.** Added `backend/email_templates.py` wired into `send_smtp_email()` (covering both direct sends and outbox dispatches alongside `text/plain`), featuring CrewChief UK header branding, category badges, structured fixture detail cards, interactive CTA buttons (`Accept or Decline Appointment →`, `Claim Cover Slot →`, `Add Fixture to Calendar →`), and a highlighted 6-digit code card for 2-Step Verification emails.

## [2.25.0] — 2026-11-25

> **Security release: deploy to every environment.** Assignors can now sign in with an authenticator app, and the assignor's emailed sign-in code is finally sent (before, the screen said it was sent but nothing was; after deploying, assignor password sign-in needs working outgoing email until they set up an app, a passkey or Google) (#172). On a real site nothing acts as a default demo assignor any more, which closes six routes that skipped identity checks when called without credentials and a league-scoping bypass for `@test.local` addresses (#173). Passkey registration is cross-checked (#171). The mail cron job can stay under RochenHost's limits of 100 emails per 10 minutes and 1,000 per day (#170). Tabs now keep each other in step (#169). After deploying: run the RochenHost deploy and restart the Python app; hard-refresh once on each device so the new page loads (footer should read v2.25.0, Build 20261124k); create a mailbox for the app and put the `SMTP_*` settings in the web app's settings and in a private file for cron, then run `scripts/check_email_setup.py` (it sends nothing) and fix any PROBLEM it reports; set `EMAIL_MAX_PER_10_MIN=80` and `EMAIL_MAX_PER_DAY=900`; sign in as an assignor and check the code arrives by email; set up an authenticator app in Profile and sign in with it; and keep the server key (`REFSYNC_BACKUP_KEY`, `REFSYNC_SECRET_KEY` or `db/.backup_key`) in place, or authenticator codes stop working.

### Added (sign in with an authenticator app, #172)

- **Assignors and Super Admins can use an authenticator app for the second step.** In **Profile, Authenticator App** you type a setup key into your app (Google Authenticator, Microsoft Authenticator, Authy, 1Password and similar; there is also a link to open on your phone), confirm it with a first code, and are shown **eight recovery codes, once**. From then on, signing in with your password asks for the app's 6-digit code, or one of the recovery codes, and **nothing is emailed**. A set-up you started but did not confirm does nothing. There is no QR picture yet (it would need a library): the key and the link are shown.
- **Turning it off, or getting new recovery codes, needs a fresh code** (from the app or a recovery code), so someone who only has your signed-in browser cannot remove your second step. New recovery codes make the old ones stop working.
- **A code only works once, and wrong ones are limited.** The step that signed you in is remembered in the same database change that starts your session, so the same code cannot sign in twice, even from two requests at the same moment. One 30-second step either side of your phone's clock is allowed. Five wrong tries end that sign-in attempt, and ten wrong codes in 15 minutes pause that account. Recovery codes are stored only as slow salted hashes, and the app's secret is stored encrypted with the server key (it is never sent back to the page after set-up).
- **Lost phone and no recovery codes?** The person who runs the server can clear one person's authenticator app with `python3 scripts/reset_mfa.py <database> <email>` (it signs them out and writes a backup first). Nothing in the website can do this. See "Two-step sign-in" in the README.
- The sign-in screens show the right words for the kind of code asked for, with a "Use a recovery code instead" switch, an error message next to the box, and Enter now checks the code instead of sending the password form again. The demo site is unchanged: it keeps its fixed demo code and does not offer the authenticator app.
- After deploying: restart the Python app; hard refresh once; sign in as an assignor and open Profile to set it up; check that you are asked for the app's code next time and that a recovery code works once. **Keep the server key** (`REFSYNC_BACKUP_KEY`, `REFSYNC_SECRET_KEY` or `db/.backup_key`): without it the app's codes stop working (recovery codes still do).

### Fixed (the assignor's sign-in code is now really emailed, #172)

- **The sign-in code is now sent by email, directly, while you sign in.** Before, the app said "a 6-digit code has been sent to you" but never sent anything: the code was only written to the notifications table (which is why a code could not be used from your inbox). It is now emailed straight away through your mail settings with a 4-second limit, and is **no longer stored as text anywhere**.
- **If the email cannot be sent, you are told, and nothing says it was.** The sign-in answers "We could not email your sign-in code, so you are not signed in. Try again in a minute, or sign in with a passkey or Google instead." A failed email does not count as a wrong password. At most 6 codes are emailed to one account in 15 minutes.
- **The emailed code is single use even under a race**: two requests with the same code at the same moment make one session, not two.
- **It counts towards RochenHost's mail limits**: each sign-in code that a mail server accepts is noted in the sent-mail ledger (#170), so the outbox's 10-minute and 24-hour send caps see it. Sign-in codes themselves are never held back by those caps.
- **This means assignor sign-in needs working outgoing email** (until they set up an authenticator app, a passkey or Google sign-in). After deploying, sign in as an assignor and check that the code arrives; if it does not, set the `SMTP_*` settings for the web app. The email provider is still not chosen: this uses the same mail settings as the other email.

### Security (no default assignor, #173)

- **Test-only shortcuts are gone from the request router.** When the router was called in code with no headers at all (never over the web, where every request carries headers), it acted as the seeded demo assignor `usr-assignor-1`, or as any user id named in the request body, and even invented an assignor for an id that did not exist; six routes (the expiry scan, incident reports, claiming cover, confirming a venue, requesting a reschedule, entering a result) also skipped their own identity or permission checks in that case. A request with no valid session is now simply signed out, everywhere. A sweep of every route in a real two-league deployment found 73 of 2,040 credential-less calls answered with success before (including creating an appointment) and none now.
- **No email address is treated specially.** The router skipped league scoping for any account whose address ended in `@test.local`. It cannot be reached by signing up (accounts are created by administrators), but an administrator creating such an account would have given it every league's data. Every account is now scoped the same way.
- **The audit-log CSV export uses the person who asked for it.** It checked the role of `usr-assignor-1` for everyone, which does not exist on a real site, so it could not work there. It now checks the caller (a Super Admin can export; an official is refused).
- **Real sites no longer record actions against a demo person.** About 25 places wrote `usr-assignor-1` when nobody was named. On a real site, an action with no user now records `system` (in the audit trail) or the official who used an emailed link, and refuses to run where a real user is required; demo and test builds behave exactly as before. Pilot feedback notifications go to the Super Admins on a real site.
- For developers: tests that relied on the old shortcut now call `tests/api_harness.py` (`dispatch_as_test_actor`), which signs in as the named user through a normal session. The router is called directly in every new test.

### Security (passkey registration cross-checks, #171)

- **A passkey's pieces now have to agree when it is registered.** A browser sends the passkey's data twice (the authenticator data, and the attestation object that contains it) and the public key a third time. The server used to read whichever came first and not compare them. Now, on a real site, both forms of the authenticator data must be exactly the same, and a public key that is sent must be the very key inside that data and belong to that passkey. Anything else is refused ("does not match"), and nothing is saved. Browsers that send only one form still register as before, and every genuine passkey (including synced ones whose counter stays at 0) is accepted: this was checked with a real browser's own output.
- **"A person was present" can no longer be skipped.** The server used to find that flag by searching the attestation object for the word `authData`, and treated the flag as set when the search failed or the data was only 32 to 36 bytes long. The flag, the counter, the authenticator model and the "synced passkey" marks now come from the one strictly read copy of the data.
- **Malformed registrations get an ordinary "bad request", never a crash.** Fields of the wrong type (a number or a list where text belongs), text that is not valid base64url, stray characters inside it, extension data that is not exactly one map, trailing bytes and oversized fields (more than about 6 KB of authenticator data, 24 KB of attestation object, 1.5 KB of public key, 200 characters of passkey name) are all refused with a 400. The demo site is unchanged.
- After deploying: restart the Python app. From Profile, Security, add a passkey on a phone or computer and check it appears and signs you in. Nothing changes for passkeys already registered.

### Added (using RochenHost's own mail safely, #170)

- **The outbox cron job can stay under RochenHost's sending limits.** RochenHost allows **100 emails in any 10 minutes and 1,000 in any 24 hours**, counted for the whole hosting account, and a matchday burst can pass the first. New settings `EMAIL_MAX_PER_10_MIN`, `EMAIL_MAX_PER_DAY` (a rolling 24 hours, not a calendar day) and `EMAIL_MAX_PER_RUN` make `scripts/dispatch_outbox.py` send no more than that. Emails over a cap wait in the outbox for a later run (no attempt is used up and nothing is marked failed), and the cron log says how many were held back and by which cap. **Unset or 0 means no cap, so nothing changes until you set them.** Recommended: `EMAIL_MAX_PER_10_MIN=80` and `EMAIL_MAX_PER_DAY=900` (about 20% headroom for mail sent straight away and for other mailboxes on the same account), with the cron job every 5 minutes: a 600-email matchday then drains in roughly an hour. A cap setting that is not a whole number stops the run with an error and sends nothing.
- **Mail sent straight away counts towards those windows.** The sign-in code, the Super Admin's test email and everything sent while `EMAIL_DELIVERY_MODE` is `direct` use up the host's allowance although they have no outbox row, so each one is now noted in a tiny file under `db/sent_mail/` (one line per email holding only the time, no address or subject; files older than yesterday are deleted automatically). Those emails are never delayed by a cap; a sign-in code queued in the outbox is never held back either.
- **New `scripts/check_email_setup.py`: look before real mail depends on it.** Read-only and sends nothing unless you add `--send-to ADDRESS`. It shows which way mail would be sent, which `SMTP_*` settings are set (names only, never values), whether the sender looks right, whether the mail server accepts the connection, encryption and login, the outbox backlog, how much was sent in the last 10 minutes and 24 hours against your caps and the host's limits (it warns when no caps are set or a cap is above the host's limit), and whether SPF, DKIM and DMARC records exist for the sender's domain. It exits with 1 when it finds a problem.
- **README: "Email on RochenHost".** Make a mailbox for the app, keep the mail settings in a private file the cron job reads (cron does not see the web app's settings), the cron line, the caps, cPanel's Email Deliverability and Track Delivery pages, and the honest limits: plain SMTP gives no delivery or bounce receipts, and the host counts every mailbox on the account.
- Additive database change: the outbox table gains a `sent_at` column (added automatically; nothing is lost).
- After deploying: restart the Python app; follow "Email on RochenHost" in the README (mailbox, private settings file, `python3 scripts/check_email_setup.py`, the five-minute cron line); then set `EMAIL_DELIVERY_MODE=outbox`. Nothing changes until you do.

### Fixed (signing in and out across browser tabs, #169)

- **Signing in, switching person or signing out in one tab now reaches your other tabs.** The code for this existed but never ran (it looked for a function that had been renamed), so a second tab kept showing the previous person until it was refreshed by hand. Now when the signed-in person changes in one tab, every other tab of this browser reloads and starts up from the session the browser holds, so it can never keep showing, or act as, someone who is no longer signed in. A tab shows a short note when this happens ("You were signed out in another tab"). The message between tabs carries only who is signed in, never a sign-in token, and a tab never adopts anything from it.
- **Choosing a league in one tab moves the other tabs to it**, but only a league that tab already lists for that person.
- The offline copy of your data (#151) is handled by the normal start-up of each tab, so it always belongs to whoever is signed in after the change.

### Fixed (backup wording, #169)

- **The backup dialog no longer overclaims.** It called the backups "256-Bit Authenticated Encrypted Snapshots" with "Bank-Grade Safeguarding", said they were copied off the server, and labelled each file "AES/HMAC Encrypted". The backups are encrypted with a key kept on the server using a method built from the standard library's HMAC (not AES), are checked for changes when opened, and stay on the server unless a second location has been set up. The dialog now says that, how often backups run, how old ones are cleared (7 daily and 4 weekly), what is checked before a restore, and that the key must be kept somewhere else. The file label now just says "Encrypted".

## [2.24.0] — 2026-11-24

> **Security release: deploy to every environment.** On a shared phone or computer the next person could see the previous person's data offline (#151); RochenHost counted every visitor's sign-in attempts together and let a caller choose the address counted (#150); the app claimed emails were sent when they were not and showed the demo sign-in code on real sites (#152); a backup was attempted on every request (#155); and several cross-league gaps are closed (#132). Passkeys now work on more devices (#164); the email outbox (#163) and the authenticator-app library (#154) are groundwork and change nothing until switched on. After deploying: run the RochenHost deploy and restart the Python app; hard-refresh once on each device (or reopen the installed app) so the new offline worker takes over; add the daily backup cron (`scripts/daily_backup.py`) and run `scripts/prune_backups.py` once as a dry run before `--apply`; from two networks, try six wrong passwords on one and check the other still gets an ordinary "wrong password" (if both are throttled, set `REFSYNC_TRUSTED_PROXY_HOPS`); check a Super Admin can still send the test email; and add a passkey from a desktop browser.

### Fixed (passkeys on more devices, #164)

- **Passkeys can be added on any browser that supports them**, including desktop browsers without passkey autofill and USB or NFC security keys. The Create Passkey button used to be hidden unless the browser also offered autofill sign-in.
- **Browsers that don't hand over the passkey's public key can register too.** The key is now read from the passkey's own registration data and stored in the same form as before, so sign-in checks it exactly as it always has.
- **A passkey belongs to one account.** Registering a passkey that is already on another account is refused ("already registered to another account") instead of silently moving it to the new account. The owner keeps it and can still sign in with it.
- **A passkey registration must include the authenticator's data**, so the website check and the "a person was present" check always run.
- **Renaming a passkey happens in place**, in a labelled text box with Save and Cancel (Escape cancels), instead of a browser pop-up.
- **The landing page no longer asks the server for a passkey sign-in on every visit.** Passkey autofill starts when the sign-in screen opens.
- Checked and unchanged: synced passkeys whose counter always stays at 0 already sign in normally, and a counter that goes backwards is still refused. Tests now pin both.
- After deploying: hard refresh once (or reopen the installed app). On a desktop browser or with a security key, open Profile, Security, and Create Passkey should be offered.

### Added (email outbox, #163)

- **Email can now be queued and sent by a scheduled job, with retries.** Appointment, chase, fixture-change, join-request, published-draft, emergency-cover and fixture-reminder emails are written to a new outbox table in the same database transaction as the change that caused them, and `scripts/dispatch_outbox.py` (run from cron) sends them. A slow or broken mail server no longer holds up a page, an email is never sent for a change that was rolled back, and a failed send is tried again after 1, 2, 4 and 8 minutes before it is marked failed (5 attempts). Each notification record now also says what happened to its email (queued, sent, to retry, failed).
- **Off until you switch it on.** Email is still sent straight away unless `EMAIL_DELIVERY_MODE=outbox` is set, so this deploy changes nothing by itself. First add the cron job, then switch it on (see "Email outbox" in the README). The sign-in code is never queued.
- **The email provider is not chosen yet.** The cron job sends through the existing SMTP settings (`EMAIL_TRANSPORT=smtp`, the default) or, for testing only, writes each email to the log and delivers nothing (`EMAIL_TRANSPORT=log`; recorded as "logged", never "sent"). An HTTP email provider and its bounce reports come in a later change.

### Added (authenticator-app sign-in groundwork, #154)

- **Building blocks for sign-in with an authenticator app.** A new `backend/totp.py` can make and check the 6-digit codes that authenticator apps show (RFC 6238, with one 30-second step of clock drift allowed), say which step a code belonged to so the same code cannot be used twice, build the QR-code link, make eight single-use recovery codes (stored only as slow salted hashes), and encrypt the shared secret before it is stored. Nothing uses it yet, so sign-in behaves exactly as before; turning it on comes in a later change.

### Changed (pull request template, #143)

- The pull request checklist now only lists what the author can check before merging (tests, JavaScript syntax, the accessibility audit). What to try on the live sites moved to an "After deploy" note of plain bullets, so merged pull requests no longer show an unticked task. The stale hard-coded test count was removed.

### Security (shared devices, #151)

- **The offline copy of your data belongs to you alone.** The app keeps a copy of your fixtures, people and leagues so it still opens without a signal. That copy used to be one shared pile, so on a phone or computer used by more than one person, someone who signed in (or was signed out) while offline could be shown the last person's data. Now each person has their own copy, kept only while they are signed in, and it is deleted when they sign out, when the session ends (a 401), or when someone else signs in. Only reads of fixtures, people, leagues, crew settings and the start-up bundle are kept; sign-in routes, changes and failed answers never are. Copies left by the old version are removed the first time the new one starts. The service worker identifies the owner by a hash of the sign-in token (the token itself is not stored).
- After deploying, hard refresh once (or close and reopen the app) so the new service worker takes over. The first load afterwards re-fetches your data, so the offline copy is ready from then on.

### Fixed (backups, #155)

- **A backup was made on every page request.** The app tried to make an encrypted backup each time a request found the database in use, because it looked for the wrong kind of file (`.sqlite3` instead of `.enc`), never saw one, and so made a new one every time, never cleaning any up. That could fill the disk and cost CPU for anyone who could load a page. The app now makes no backup while serving requests.
- **Backups run once a day from a scheduled job, one at a time.** `scripts/daily_backup.py` takes a lock so two runs never overlap, makes and checks the backup, and no longer deletes anything unless you ask (`--prune`). The README has a new "Backups on RochenHost" section with the exact cron line, what to check in cPanel, and how to restore.
- **Clearing old backups is safe and checked first.** New `scripts/prune_backups.py` only lists what it would delete unless you add `--apply`. It keeps 7 daily and 4 weekly backups, never touches the newest backup, deletes nothing if the newest does not verify, and only removes files named exactly like a backup directly inside the backups folder (never links or anything else).
- **The health check no longer guesses.** `/healthz` and `/api/health` read a small `LATEST` note written by each backup, so the answer is quick and right however many files there are. Its answer has the same shape as before.
- **The pre-update snapshot of the database includes recent writes.** `scripts/setup_remote.py` copied the database file directly, which misses changes still held in the `-wal` file, and restored it over a live file with stale `-wal`/`-shm` files. It now checkpoints and uses SQLite's own backup, and clears the stale files on restore.

> **After deploying:** add the cron job from the README, run `python3 scripts/prune_backups.py` (a dry run) and read the list, then `python3 scripts/prune_backups.py --apply` to clear the old backups, and check `/healthz` shows a recent `lastBackupAt` after the first cron run.

### Security (web push, #156)

- **Browser push alerts are switched off, honestly.** The old push code carried a private signing key inside the source (so anyone who could read the code could sign as the site), started a `node` process for every alert, and sent messages in a form push services do not accept, while telling you the alert had been sent. All of that is gone: nothing is sent, nothing is started, and nothing is recorded as delivered. The "Browser / Push Alerts" option in your profile and the Push button in the top bar no longer appear while the server says push is unavailable. `GET /api/push/vapid-public-key` now says push is off, and subscribing or sending a test push answers "unavailable" (409) instead of "ok". Existing stored subscriptions are kept and can still be removed. Email and in-app alerts are unchanged. **The old key is still in the repository's history: treat it as compromised and never reuse it.** Push will come back later, with a properly encrypted sender and keys set in the host's environment settings.

### Fixed (privacy wording, #156)

- **The privacy wording no longer says bank details are "encrypted at rest".** They are not: the sort code and account number you enter on an expense claim are stored as ordinary text in the platform's database. The Terms and Privacy dialog and the Privacy Policy now say how they are stored, who can see them (you, the assignors and league administrators who pay claims for your league, and the platform's administrators), that some lists show only the last four digits on screen, that your browser remembers them on your device (clear site data on a shared device), that backups are encrypted and integrity-checked, and that stronger protection is planned. No date is promised.

### Fixed (honest email and sign-in hints, #152)

- **The app no longer says an email was sent when no mail server took it.** Before, when the server's own mail program and port 25 both failed, every outgoing email was quietly reported as sent. Now that is reported as a failure everywhere (only the demo site still pretends). The "send test email" button in Settings tells you the message was not sent and why, and the audit trail records "failed" instead of "sent".
- **Fixture reminders are no longer marked as sent when they were not.** A reminder whose email could not be sent is left pending, so the next run tries it again; the scan's result lists what failed, and `scripts/send_reminders.py` prints it and exits with an error so a cron job shows the problem.
- **The demo two-step code is shown only on the demo site.** The sign-in screen no longer tells everyone to "enter 749201" or shows it as a placeholder.
- **Sign-in codes and password-reset links never appear in the notifications list**, which also feeds the app's start-up data. League staff could previously see them for the people in their leagues.
- **Not changed yet:** an assignor's sign-in code is still not emailed to them (it needs an email service to be chosen); until then the sign-in screen says a code was sent although none is.
- After deploying: restart the Python app; use Settings, "send test email" and check it reports honestly; and check that the sign-in code field no longer shows `749201`.

### Security (known gaps closed, #132)

- **The test email is for Super Admins only.** It goes out through the platform's mail settings, so any assignor could use the platform to send mail to any address. The box is now only shown to a Super Admin, the server refuses everyone else, and a recipient has to be typed (there is no built-in address any more, and the box no longer comes pre-filled).
- **The expiry scan and the reminder scan only reach your own leagues.** An assignor could run them for every league's officials, warning or emailing people in other leagues. Each now covers only the leagues you administer. Super Admins and the automatic background job are not limited.
- **Crew templates: the standard ones are shared, the rest belong to a league.** Every league's custom templates were listed to everyone (signed-out visitors included). Now the standard templates every league uses are marked shared, and you see those plus your own leagues' templates; a signed-out visitor sees only the shared ones. A brand-new league still gets all the standard ones. Saving a template can never make another league's template shared or unshared.
- **Feedback.** Signed-out feedback is still welcome, but it is now limited per address (10 in 15 minutes), a message is capped at 2,000 characters and a rating must be 1 to 5. When you are signed in, who it is from (account, email, role) comes from your session, never from what the request says.
- **The league switch only accepts a league you can see.** Any other league answers "not found".

### Security (RochenHost sign-in limits, #150)

- **Sign-in limits on RochenHost now count each visitor by their own address.** The server file RochenHost uses for the API (`api.cgi`) didn't pass the connection's address on, so every visitor shared one "unknown" limit (one person mistyping a password could use up the allowance for everyone), and a caller could send their own `X-CrewChief-Peer` header to pick the address the limits counted, which let guessing dodge them. It now takes the address from the connection and removes any copy the caller sent, as the other ways of serving the app already did.
- The raw-file responses of that same file (calendar and CSV downloads) now report their real status text instead of always "OK".

### Changed (internal, #140)

- **The app's JavaScript is split by feature.** `public/app.js` (16,098 lines) is now ten smaller scripts plus a start-up script (`app-01-state-sync.js` to `app-10-sync-wizard-admin.js`, then `app.js`), loaded in order. Nothing you can see or do changes: the browser runs exactly the same code in exactly the same order (the new files joined together are the old file, byte for byte, and a real-browser check of every top-level function, the page and its errors is identical before and after). It makes the code easier to find and review. A test keeps the page, the service worker and the files in step.

## [2.23.0] — 2026-11-23

> **Security release: deploy to every environment.** It closes several ways data could be read or changed by someone who shouldn't: incident reports, officials' licence and DBS expiry dates (with names and emails), sync logs and the committee report could be read without signing in (#128); the demo reset could be run on a real site (#128); and an official or assignor of one league could claim a cover request, or delete or overwrite a crew template, in another league (#131). After deploying: restart the Python app on RochenHost; check "Add to calendar" on a fixture, creating and deleting your own crew template, and an official claiming a cover request in their own league; and look in your host's access log for signed-out requests to `/api/reports/incident`, `/api/assignor/expiry-warnings` and `/api/demo/reset`.

### Security (cross-league writes, #131)

- **An official could take a slot in another league.** Claiming a cover request now needs membership of that fixture's league pool; for anyone else it reads exactly like a request that doesn't exist. Before, an official from one league could claim another league's cover request, which moved the appointment to them, and then the call failed with an internal error message after the change was already saved.
- **An assignor could delete or overwrite another league's crew template.** Saving or deleting a crew template now needs you to administer the league that owns it (Super Admins can still do both). Replacing a template keeps its league (it used to reset it to the primary league), and a new template belongs to the league of whoever made it.
- **Fixture calendar links need you to be signed in, and the fixture must be in your league.** Anyone who knew a fixture's id could download its calendar file, whichever league it belonged to. "Add to calendar" still works (the app's session cookie carries your sign-in).
- The league-switch route (`/api/auth/active-league`) refuses signed-out requests, and the expiry scan's answer lists only the people you may see.

### Added (tenancy test, #123)

- An automatic test (`tests/test_issue_123_tenancy_matrix.py`) classifies every route the server handles and calls each one, with every HTTP method, as a signed-out visitor, an official, one league's assignor and another league's assignor on a deployment with two leagues. It checks that nothing is open that shouldn't be, that officials and assignors are refused where they should be, that nothing of another league is returned or changed, and that no route ever answers with a server error. A new route fails the test until someone says who may use it. Known, deliberate exceptions are listed in the test and must be removed once fixed.

### Security (reports and demo reset, #128)

- **Some reports could be read without signing in.** The match incident reports (including the offender and notes) and their summary, every official's licence and DBS expiry warnings (with names and email addresses), the schedule sync logs and the season committee report page all answered a signed-out request. They now need a signed-in assignor.
- **Those reports now only show your own league.** An assignor of one league could read the same reports for other leagues. Each now covers only the leagues you administer (and, for expiry warnings, only the people you may see). Super Admins still see everything.
- **The demo reset can't be used on a real site.** `POST /api/demo/reset` had no sign-in or demo-mode check and could delete and re-create the demo league's fixtures on any deployment. It now works only on demo deployments and for a signed-in assignor.
- A claim sent without an appointment gives a clear error (400) instead of a server error (500).

### Fixed (phone layout, #124)

- **The profile screen is usable on a phone again.** On an iPhone the sections under the form (Officiating Qualifications, Passkeys, Fixture Reminders) were squashed to thin strips with their text cut off, so passkeys and reminder settings couldn't be used. Sections in any pop-up window now keep their full height and the window scrolls instead.

### Fixed (releases, #117)

- The Release workflow could not release an existing tag, because older tags don't contain the checker script. It now runs the checker from `main` against the tag's own files (and skips `backend/version.py` for versions that predate it).

### Added (releases, #115)

- A **Release** workflow on GitHub (Actions → Release → Run workflow, type the version). It checks the version is the same in `package.json`, `package-lock.json`, `backend/version.py`, the service worker, the app footer and the newest changelog section, creates the `vX.Y.Z` tag if it doesn't exist (it never moves an existing tag), and publishes the GitHub release with that version's changelog section as the notes. `python3 scripts/release_notes.py 2.22.0` runs the same check on your own machine.

## [2.22.0] — 2026-11-23

> **Security release: deploy to every environment.** It closes a hole that let someone sign in with a passkey without a valid signature (#104) and one that let a league's fixture import overwrite another league's fixtures (#110). After deploying: restart the Python app on RochenHost, test one real passkey sign-in on each host (a passkey registered before this release without a real key must be deleted in the profile and registered again), and point an uptime monitor at `/healthz`.

### Added (fixture import, #110)

- Assignors can import fixtures from a CSV file (Tools menu → Import fixtures). The file is checked first and every problem is shown row by row; nothing is saved until every row is correct, and the import is all-or-nothing. It is recorded in the activity log.

### Security (#110)

- The older bulk import (`POST /api/import`) could overwrite a fixture belonging to a different league if its fixture code matched. It now refuses rows outside the caller's own league.

### Added (league activity, #108)
- **Each league can now see its own activity.** League Members has a new **Activity** tab for league admins and assignors (and Super Admins) showing who did what in that league, newest first: credential verifications, join requests and approvals, officials and viewers added or removed, auto-appoint and undo, appointments, results and reschedules, and settings changes. Filter by *People and access*, *Appointments*, *Fixtures and results*, *Settings* or *Other*, and load older entries a page at a time. Each line is a plain-English sentence with names (the league's name, not an internal id), and no contact details or personal numbers.
- **Only that league's activity is shown.** Every audit entry now records which league it belongs to (older entries are filled in from their fixture or the league they mention), so a league never sees another league's activity, and platform-level entries (a test email, a database reset, the default-password clean-up) are never shown in any league's feed. Read-only viewers can't see it.
- Credential verifications, undoing an auto-appoint batch and the season setup wizard now record their league; verifying someone who belongs to two leagues appears in each league's activity (only in the leagues the verifier administers). The sentence names the person instead of an internal id.
- API: `GET /api/league/activity` with `leagueId`, `category`, `limit` and `cursor`.

### Added (health check, #106)
- **`GET /healthz`: a health check for uptime monitors and your host.** No sign-in needed. It answers `200` with the version, whether the database can be read, and when the last automatic backup was made (with a `"backup": "stale"` warning if it is more than 48 hours old), or `503` if the database can't be read. It never shows paths, errors, settings or anything about people, and it changes nothing. `/api/health` is the same check. Point an uptime monitor at it and alert on anything but `200`.
- Docker and Railway now use it as their health check (instead of loading the whole start-up data), and Railway won't promote a deploy that fails it.
- The version it reports comes from `backend/version.py`, and a test keeps that equal to `package.json` and the latest changelog release, so a release can't forget it.

### Security (passkeys, #104)
- **Passkey sign-in now checks the signature.** Before, a passkey sign-in was accepted if the challenge and the credential id existed, so anyone who learned a credential id could sign in as its owner with a made-up signature. The server now checks the signature over the authenticator data and the client data with the key saved at registration (ES256, the common case, or RS256), that the passkey was made for this website and an origin it serves, that the user was present, that the signature counter goes up (so a copied passkey is caught; passkeys that always send 0 still work), the account the passkey belongs to, and that the challenge is fresh (5 minutes) and used once, even after a failed attempt.
- **Registration only stores a real key.** A real public key (ES256 or RS256) for this website is required; placeholder keys are no longer stored.
- **Passkeys saved in the old format can't be used.** If a passkey was registered before this fix without a real key, the server can't verify it, so sign-in with it is refused with "register it again". Delete it under your profile and add it again.
- Requesting passkey challenges and failed passkey sign-ins are limited per address, and unused challenges are cleaned up.
- Demo and staging builds keep their demo passkey flow. New optional setting `WEBAUTHN_ORIGINS` (comma-separated exact origins) for sites served from more than one address; see the README.

## [2.21.0] — 2026-11-23

> **Security release: deploy to every environment straight away.** It closes two ways of signing in as someone else without proving who you are (#95, #100). After deploying: (1) run `python3 scripts/revoke_sessions.py <database>` as a dry run and then with `--apply`, so any session created through the old holes stops working; (2) look in the audit log for `DEFAULT_PASSWORDS_DISABLED` to see which accounts had the published default password; (3) make sure `DEMO_MODE` is **not** set; (4) restart the Python app on RochenHost; (5) give a password (`python3 scripts/set_password.py <database> <email>`) to anyone who can't use Google, or let them sign in with Google using the same email. See the README for the sign-in settings.

### Security (passwords, #100) — deploy this straight away
- **Critical: every account an admin registered had a published default password.** The database gave any account created without an explicit password the value `BasketballUK2026!`, which sits in the public source. Accounts registered in Users & Roles, officials invited by the setup wizard, and the accounts of older seeded databases all had it, and password sign-in accepted it. Someone who knew such an account's email address could sign in as that person (assignors had a second step; officials did not).
- **That password is now refused everywhere.** On start-up, every account still on it is switched to "no password" and the list is written to the audit ledger (`DEFAULT_PASSWORDS_DISABLED`), so you can see who was exposed. New accounts made in Users & Roles or by the setup wizard start with no password too.
- **Passwords are no longer stored in plain text.** They are stored as a salted, slow hash (PBKDF2-HMAC-SHA256, 600,000 rounds, a random salt per password, the round count kept with the hash so it can be raised later). Any remaining plain-text password is hashed at start-up, or the first time it is used. The hash is never sent to the browser. Every refused sign-in takes the same time, so it doesn't reveal which accounts exist.
- **Effect on people:** anyone whose only way in was that default password can no longer sign in with a password. They can sign in with Google using the same email address, or you can give them a password with `python3 scripts/set_password.py <database> <their email>` (typed at a prompt, never on the command line; at least 12 characters; signs their other sessions out; makes a backup first).
- Demo and staging builds keep their demo passwords.

### Security (sign-in throttling, #98)
- **Guessing passwords can no longer dodge the limit by forging a header.** Sign-in attempts were counted per address, but the address was taken from the first `X-Forwarded-For` value, which the caller writes. A different value on every request meant the limit never applied. The address now comes from the connection itself (behind a known number of proxies, from the entry that the last trusted proxy added; Railway is detected automatically) and a caller's own copy of the internal header is removed.
- **The limits survive a restart and are shared by every worker.** They were counted in memory (lost on every deploy, per process, and never cleaned up); they now live in the database and old entries age out.
- **Three independent limits on password sign-in** (all over 15 minutes): 5 failures per address and account, 20 per account from any addresses (stops guessing from many places), 50 per address across accounts (stops one source trying many accounts). A good sign-in clears the person's own mistakes only. Blocked requests are not counted again, and a made-up account and a real one look the same.
- **Wrong two-step codes** (30 per address) and **failed Google or Apple verifications** (30 per address) are limited too. "Forgot password" is limited per address and per address and account.
- New optional setting `REFSYNC_TRUSTED_PROXY_HOPS`. If everyone appears to come from one address on your host (sign-ins throttled together), set it to the number of proxies in front of the app. See the README.

### Security (sign-in, #95) — deploy this straight away
- **Critical: anyone could sign in as any user, including the Super Admin, without a password or a Google token (#95).** The "sign in with Google/Apple" route trusted whatever email address a request named, and never checked with Google or Apple. The password route also let a request skip the password check by naming another sign-in method or leaving the password out, matched email addresses loosely (part of an email, a first or last name), and the second step for assignors used a fixed code (`749201`). This was live on every deployment, including the Super Admin account.
- **Sign-in with Google is now verified by the server.** It checks Google's own signature on the sign-in token (or asks Google about the popup's token), that the token was issued to this app, that it has not expired, and that the email is verified. The email and name in the request are ignored; the person is whoever Google vouches for. Apple sign-in is refused unless `APPLE_CLIENT_ID` is set, and then it is checked the same way. If Google can't be reached, nobody is signed in that way (password sign-in is unaffected).
- **Password sign-in is strict on a real deployment.** Only `PASSWORD`, only an exact email address, and a password is required. Accounts that use Google only can't be signed into with a password. Other methods (`MAGIC_LINK`, `GOOGLE`, `PASSKEY`, anything else) can no longer be used on the password route.
- **The second step for assignors is real.** A random 6-digit code, stored hashed, valid for 10 minutes, five tries, used once. "Forgot password" no longer starts a session behind the scenes.
- An account that has a Google identity on file can no longer be taken over by a different Google identity using the same email. Accounts created before this fix get their real Google id recorded the first time they sign in.
- Demo and staging builds (`DEMO_MODE`) keep their conveniences; real deployments never do.
- **Deployment checklist:** deploy to every environment, then run `python3 scripts/revoke_sessions.py <database>` (a dry run) and `... --apply` to sign everyone out, because sessions created through the old hole stay valid. Review your users, roles and the audit log for anything you don't recognise. Everyone then signs in again with Google.

### Added (read-only league viewers, #93)
- **A look-only account for a league.** A league admin or assignor (or a Super Admin) can make an existing account a **viewer** from *League Members → Viewers*, by exact email address. A viewer sees one screen, *Fixtures & coverage*: the league's fixtures, whether each has a full crew, and the crew names. They can search, and switch between upcoming and past fixtures.
- **They can never change anything.** The server refuses every write from a viewer (`403 READ_ONLY_ACCOUNT`) before it looks at the route, so no route can forget to check, and the app doesn't send changes for a read-only account either. A viewer can only read fixtures, their own leagues and their own profile.
- **They don't see people's details, money or messages.** No people lists, emails, phone numbers, licence numbers, expense claims, bank details, exports, availability, evaluations, notifications or settings. A viewer is not treated as a league administrator (no alerts, not shown in the administrators list).
- **Who can be a viewer.** Existing accounts only, and not anyone who can already change things (administrators, assignors, club reps) or who has appointments or is in an official pool. Adding and removing a viewer is written to the audit ledger, and removing one ends their access at once. A person who is no longer a viewer anywhere goes back to a plain sign-up account.
- API: `GET`/`POST /api/league/viewers`, `DELETE /api/league/viewers/{userId}`.

### Added (continuous integration, #91)
- **Every pull request and every push to `main` now runs the full verification suite on GitHub:** JavaScript syntax, the unit tests (including the no-secrets check), the WCAG audit, the changelog sync check and `npm audit`. A test makes sure the workflow keeps running those checks. To make it a gate, require the `verify` check in the branch protection rules for `main`.
- A date-dependent test (`test_fixture_date_filters`) that checked hard-coded November 2026 dates, and so failed on any later day, now checks dates relative to today.
- Five tests relied on a leftover demo database on disk and failed on a clean machine (and so in CI), now that demo data is only seeded in demo builds. They now build their own demo database.

## [2.20.0] — 2026-11-13

### Added (landing page)
- **A single-message front door.** Signed-out visitors now land on a focused page with one promise ("Every game covered. Every official confirmed.") and one button (**Get started**), instead of a full sign-in form. **Get started** (or **Sign in** in the top corner) opens the sign-in step, with a **Back** link. Everything else (What is CrewChief UK?, Privacy, Terms, Safeguarding) sits quietly in the footer. Demo mode still opens the sign-in step directly so testers keep the one-click personas. An expired session goes straight to sign-in rather than the landing page.
- Below the first screen, a short **Built for everyone on matchday** section explains the benefit for assignors, officials and clubs. It has no extra buttons, so the first screen stays a single hook.

### Changed (look and feel)
- Calmer top bar, softer shadows and a larger sign-in card radius across the app.
- Signed-out visitors no longer see Feedback, API Docs or the phone bottom bar, and the sign-in screen title now reads "Sign in to CrewChief UK".
- The main filled buttons on the landing page and sign-in form use a darker orange so white text meets the AA contrast standard.

### Fixed (demo data in real deployments, #85)
- **A real deployment no longer starts with demo fixtures.** Demo people, clubs, venues, fixtures (`gm-101` to `gm-140`), appointments, expense claims and notifications are now created only in demo mode. A real first start has the grade and position lists, crew templates, the primary league and the platform owner, and nothing else. This is why a league could show "upcoming fixtures" that nobody had entered.
- **For deployments that already have demo data:** `scripts/report_seed_fixtures.py` (read-only) lists each league's upcoming fixtures and flags demo ones; `scripts/purge_demo_data.py` removes demo fixtures and what hangs off them. It is a dry run unless you pass `--apply`, writes a backup first, and keeps any demo fixture that has a real person attached. It does not touch people, clubs, teams or venues, or fixtures that users created.

### Security (signed-out data, #86)
- **A signed-out visitor no longer receives every league's venues, courts, clubs and teams.** The public start-up data now contains only the grade and position lists the sign-in screens need. Signed-in people are unaffected.

## [2.19.0] — 2026-11-13

### Security (repository and deployment, #81)
- A committed GitHub token was removed from the repository files; helper scripts now read `GITHUB_TOKEN` from the environment, and a test fails the build if a token-like secret is committed.
- Added `scripts/deploy_rochen.sh` (deploys to RochenHost only); `scripts/deploy_all.sh` now pushes `main` only.
- **Action needed:** revoke the old token in GitHub settings.

### Changed (auto-appoint improvement pass, #70)
- **Hardest slots first now fills every slot that can be filled** (with each person doing one game a day or within your daily limit). After the first pass, if a slot is still empty it searches for a chain of moves that frees someone up: give the slot to a candidate, re-home whatever that person was doing that now clashes, and so on, keeping the change only if every displaced slot finds a new official. It only ever uses officials who already passed every safety rule, never double-books, and always finishes (it is limited in depth and effort). The current game-by-game method is unchanged. The Compare screen shows the extra slots filled.

### Added (operations, #69)
- **`scripts/report_unverified_sso_accounts.py`: a read-only report** to find accounts created with the old SSO defaults (top floor and table grade, DBS "verified", a made-up `BE-SSO-` licence number, a placeholder phone number) that nobody has verified, with their leagues, any upcoming appointments and a suggested action, plus a count of leftover demo sign-in sessions. It opens the database in read-only mode, never prints password hashes or full tokens, and supports `--csv` and `--json`.

### Added (auto-appoint settings and comparison, #62)
- **Auto-Appoint can now be set up per league.** League admins and assignors get an *Auto-Appoint Settings* screen with a plain-English **How it works** page (the safety rules that are always on, this league's ranking points, how slots are filled, how fairness works) and a **Settings** tab to change: how slots are filled, fairness, an optional daily limit per official, mentor pairing, and the ranking points for twelve factors. Values are checked (whole numbers in a safe range), changes are written to the audit ledger with before and after, and *Reset to defaults* puts a league back to the standard settings. The safety rules (double-booking, DBS, licence, grade, club conflicts, travel buffer, league membership) can't be changed here. Each league has its own settings.
- **A better way to fill slots.** *Hardest slots first* fills the slots that only a few people can do before the easy ones, so easy slots no longer use up the one person a hard slot needs. The current *game by game* method stays the default and behaves exactly as before.
- **Fairer sharing.** A new fairness mode compares each official's games so far with how much availability they have offered, instead of just counting games. Season-count fairness (the default) and "off" are still available.
- **See why.** Every proposed appointment has *Why this official?* (score breakdown, how many people could do it, the next best), and every slot that couldn't be filled says why (for example "3 blocked by DBS_SAFEGUARDING_EXPIRED").
- **Compare methods.** A side-by-side view of the current and improved methods on the same open slots: how many each fills, who each picks, and which slots differ. Nothing is sent from it. You can review either method's picks in the normal preview (tick or untick, confirm, undo), or make the improved method this league's default.
- API: `GET`/`PUT /api/league/auto-assign-settings`, `POST /api/assignor/auto-assign/compare`; the preview accepts a `strategy`.
- Accessibility: the active tab colour on League Members and Auto-Appoint now has strong contrast in light and dark themes.

### Security (sign-in, #68)
- **Critical: anyone could sign in as any user, including the Super Admin, without a password (#68).** A set of public "demo" bearer tokens, and a rule accepting `tok-<any user id>`, were honoured on every deployment, and the web app shipped a default token and signed a fresh visitor in as the demo assignor. These now work **only in demo mode**, which is a server setting (`DEMO_MODE`) and can no longer be switched on by a request (`?demo=1` or a header). Outside demo mode they are refused, are no longer seeded, and any already in the database are removed at start-up.
- A signed-in person can no longer mint a session for someone else, and an assignor can no longer "switch persona" to another user (including the Super Admin) outside demo mode.
- The web app no longer has a built-in token: with no real session it shows the login gate, and an expired session signs you out instead of quietly using another person's.
- **Deployment:** deploy this to every environment straight away, make sure `DEMO_MODE` is **not** set on real deployments, and review recent activity for sessions you don't recognise.

### Added
- **League join requests and League Members screen (#63)**:
  - New sign-ups (for example Google or Apple SSO) no longer join any league automatically. They choose which league(s) they officiate in, add an optional message, and wait. Membership is only created when an assignor or league admin of that league approves. Until then they see only the league chooser and their own requests, and no fixtures or other officials.
  - New **League Members** tab for assignors and league admins (scoped to the active league): a Join requests inbox with approve and decline (optional reason, with a confirmation step) and a badge showing how many are waiting, and an Official pool list with search and remove. Officials are added by exact email address, so nobody can browse other leagues' officials.
  - People are emailed when a request is decided, and only the chosen league's administrators are told about a new request. Applicants can withdraw a waiting request. A declined request can be repeated after 7 days, and at most 5 can be open at once.
  - The Super Admin dialog shows how many requests are waiting in each league.
  - Accessibility: keyboard operable tabs and dialogs, announcements for results, status shown as text plus icon, 44px touch targets, no horizontal scrolling on phones.

### Security
- Leagues are now private to their members: `GET /api/leagues` only lists leagues you belong to, and `GET /api/leagues/{id}` now needs sign-in and membership (it previously needed neither and exposed league administrators' names and emails). `GET /api/leagues/public` returns only league names and codes.
- A signed-in official with no league is blocked server-side from league data (`LEAGUE_MEMBERSHIP_REQUIRED`), not just hidden in the interface.

### Changed (sign-up, #67)
- **The login-gate "Request access" form is replaced by "How to join".** The old form only sent one notification to one fixed person, stored nothing, and never reached the chosen league's own administrators. Sign-in is now the way in: sign in with Google, choose your league(s), and an administrator of each league approves you. The guidance also covers people who can't use Google (ask your league administrator to register you) and league organisers and club fixtures secretaries.
- `POST /api/auth/request-access` now returns `410 Gone` with the same guidance, and sends and stores nothing.

### Safeguarding (ungraded and unverified sign-ups, #66)
- **New sign-ups no longer start as fully qualified.** Every new SSO account was created as a FIBA International floor referee with top table grade, DBS "verified" and a made-up licence number, so after approval a stranger looked fully qualified, including for youth fixtures. New accounts now start with no grade, DBS unverified and no licence, and no placeholder phone number.
- **People declare their own details on the sign-up screen:** floor and table grade, Enhanced DBS certificate number and issue date (and whether they are on the Update Service), and Basketball England licence number and expiry. Nothing declared counts for eligibility until verified.
- **League admins and assignors verify** from a new *Verify credentials* dialog on a join request or on any pool member. They set the verified grades and tick what they have actually seen (an expiry date is required, and an expired certificate can't be marked verified). Each verification is recorded with their name and the date in the audit ledger. Super Admins can verify anyone; league staff can verify people in their league or waiting to join it.
- Until verified, a person is never offered or appointable for fixtures. A missing licence expiry no longer counts as a valid licence.
- If someone changes their declared DBS or licence after it was verified, that item goes back to unverified, because what was checked was the old certificate.
- The Join requests and Official pool lists show grade, DBS and licence as verified or not verified (text and icon, not colour alone) next to what the person declared.
- Existing accounts are unaffected.

### Security (people visibility, #65)
- **Only Super Admins can browse everyone.** The platform-wide user list (with emails, licence numbers and sign-in details) was sent to every signed-in person, and the availability heatmap, workload analytics and exports covered every league. Now league admins and assignors see only the members of the leagues they administer, and officials and club reps see only themselves. People who have asked to join a league appear to its approvers only in the join-request list until approved.
- Assignors can only view or edit people in their own league's list (profile, travel preferences, availability, evaluations, earnings summary). Someone outside it answers "not found".
- Fixture crews no longer expose colleagues' email addresses or Basketball England licence numbers to other officials and club reps. Names still show so a crew can see who they work with.
- Club reps no longer receive the officials list at all (this replaces masking their phone numbers and postcodes).

### Security (tenancy hardening, #64)
- **An assignor can no longer reach another league's data.** Previously an assignor of one league could revoke appointments, cancel fixtures, post results, and read fixtures, exports, claims and notifications of other leagues by id. Every endpoint that takes a fixture, appointment, claim, cover request or league id now checks the league, and another league's record is reported as "not found". Lists and exports (bootstrap, fixtures, needs-attention, CSV/JSON/BACS/treasurer/club invoices, expenses, evaluations, cover requests, audit log, notifications) only include the leagues you belong to; Super Admins still see everything.
- **No more self-promotion to Super Admin.** Any assignor could previously make themselves (or anyone) a Super Admin, and strip the real one, through the users endpoints. Only a Super Admin can grant that role, nobody else can edit a Super Admin, and league staff can only edit people in their own league. Promoting an official to assignor makes them an admin of the promoter's league.
- **Database backups, restore and demo reset are Super Admin only.** They act on every league's data. The Backups button is hidden for everyone else.
- Alerts (declines, incidents, expense claims, cover requests, reschedules) go to the fixture's own league instead of one fixed assignor, and are visible to that league's administrators in the notification centre.
- Fixtures, clubs, imports, schedule feeds and the setup wizard now create records in the league you are working in (they all landed in the primary league before). A schedule feed can't overwrite another league's fixture.
- Existing assignors are made league admins of the primary league by a one-off migration (this narrows their reach; it never widens it).

### Security (auto-assign tenancy, #62)
- **Auto-assign is now scoped to a single league (#62)**:
  - Auto-assign preview, apply, undo and one-fixture auto-fill only act on fixtures in the league the assignor is working in. They can no longer read or change another league's fixtures, even with crafted fixture or batch IDs.
  - The server checks that the assignor belongs to the requested league (platform Super Admins may act in any single league). A batch containing a fixture from another league is rejected as a whole.
  - Officials remain a shared pool: an appointment in any league still blocks double-booking in every other league.
  - Fixtures returned by the API now include `leagueId`.
  - **Officials now belong to leagues.** A league's candidate pool is the officials who are members of it; officials can belong to several leagues and stay one shared account. Auto-assign, suggestions and manual appointments only use a league's own members, and cross-league appointments still block double-booking. Appointing a non-member is refused and cannot be bypassed by a dispensation.
  - Existing officials are placed in the primary league by a one-off migration (sample sandbox officials also join the demo league). It is recorded, so an official an admin later removes is never silently re-added.
  - New API for assignors: `GET`/`POST /api/league/officials` and `DELETE /api/league/officials/{userId}` (removal is blocked while the official has upcoming appointments in that league). Officials created by an assignor join that assignor's league.
  - An official's pool membership never grants assignor access in that league.

- **Critical: anyone could sign in as any user, including the Super Admin, without a password (#68).** A set of public "demo" bearer tokens, and a rule accepting `tok-<any user id>`, were honoured on every deployment, and the web app shipped a default token and signed a fresh visitor in as the demo assignor. These now work **only in demo mode**, which is a server setting (`DEMO_MODE`) and can no longer be switched on by a request (`?demo=1` or a header). Outside demo mode they are refused, are no longer seeded, and any already in the database are removed at start-up.
- A signed-in person can no longer mint a session for someone else, and an assignor can no longer "switch persona" to another user (including the Super Admin) outside demo mode.
- The web app no longer has a built-in token: with no real session it shows the login gate, and an expired session signs you out instead of quietly using another person's.
- **Deployment:** deploy this to every environment straight away, make sure `DEMO_MODE` is **not** set on real deployments, and review recent activity for sessions you don't recognise.

## [2.18.0] — 2026-11-12

### Fixed
- **Match Official Expense Claim Submissions & Persona Delegation (#41)**:
  - Fixed 400 Bad Request rejection on long journeys (≥100 mi return) by properly appending `otherClaimsDesc` justification notes to `notesParts` on form submission.
  - Enabled assignors and platform administrators to submit expense claims on behalf of appointed officials without encountering client-side or backend authorization mismatch errors.
  - Corrected `renderExpensesView()` persona resolution to honor `state.activeOfficialId` when an assignor or administrator switches active official personas in the header selector.
  - Seeded an accepted match appointment (`apt-aaron-1` on fixture `gm-108`) for platform administrator Aaron Senior (`usr-aaron-senior`) to ensure immediate personal expense claim capability.
  - Synchronized live changelog records across all deployment environments.

## [2.17.0] — 2026-11-12

### Milestone M4 & M5 Completed: Fees, Pay & Mileage (P3) and Assessments & Evaluations (P4)

#### 👤 Forward-Facing User Summary
- **Split Claim Form & Finance Ledger by Role (P3-1 / #23)**:
  - Match officials see a dedicated "My Claims" view with the official claim form and their personal submission history.
  - Assignors and Finance officers access a full-width approval ledger with real-time KPI total cards: **Awaiting Approval**, **Approved Unpaid**, and **Paid (BACS Settled)**.
  - Added 4 multi-dimensional filters: Status (`All`, `Submitted`, `Approved`, `Paid`, `Rejected`), Date Window (`All`, `Last 7 Days`, `Last 30 Days`, `This Season`), Official, and Home Club.
  - Multi-select row checkboxes with 1-click batch actions: **✓ Approve Selected** and **💷 Mark Selected Paid**.
- **Expense Form Usability & Receipt Uploads (P3-2 / #24)**:
  - Auto-fills return travel mileage from official's home postcode with live calculated route descriptions (`📍 Route: Origin ⇄ Venue`).
  - Added mandatory justification reason field (`#exp-mileage-change-reason`) that appears automatically if an official manually modifies automated route calculations.
  - Added receipt file upload (`#exp-receipt-file`) supporting images and PDFs for ticket, parking, and toll claims.
  - Remembered and masked BACS details (`••••5678`) to protect sensitive financial records, masked in all read-only views for non-privileged viewers.
  - Added an unclaimed completed fixtures banner with a 1-click **"⚡ Pre-fill Next Claim"** button.
  - Collapsed lengthy HMRC tax text behind a readable toggle link with a mandatory agreement checkbox before submission.
- **BACS Export & Mark as Paid Workflow (P3-3 / #25)**:
  - Retains the exact 14-column official UK BACS CSV payment schedule export format.
  - Immediately prompts an interactive confirmation modal (`#dialog-confirm-bacs-paid`) after export, allowing assignors to mark exported batches as **Exported / Paid (BACS)** in one click.
- **Role-Based Assessment Views & Permissions (P4-1 / #26)**:
  - Match Commissioners and Assessors view the post-fixture evaluation form.
  - Assignors access an executive assessment review list across all league officials.
  - Officials access only evaluations where they are the subject, with strict backend authorization preventing cross-official evaluation access.
- **Official Acknowledge / Reflection Actions & Scoring Transparency (P4-2 / #27)**:
  - Officials can acknowledge received assessments and record optional reflection notes directly to their assignor via `POST /api/evaluations/acknowledge`.
  - Transparent weighted scoring calculation display: **Mechanics (35%)**, **Game Control (40%)**, and **Communication (25%)**.
  - Highlights follow-up items automatically for in-game incidents (Technical/Disqualifying fouls, Venue defects), low performance scores (<75), or unacknowledged feedback.
  - Clickable deep-links on each evaluation card linking directly to the fixture in the Assignor Workbench.

#### 🛠️ Technical & Admin Specifications
- **New REST API Endpoints**:
  - `POST /api/expenses/batch-review`: Atomic batch review (approve, mark paid, reject) with strict assignor role checks.
  - `POST /api/evaluations/acknowledge`: Allows evaluated officials to acknowledge and submit reflection notes.
- **Database Schema Upgrades**:
  - Added `acknowledged_at` and `official_response` columns to `official_evaluations` table with backward-compatible migrations.
- **WCAG 2.1 AA Compliance**: 100% pass across all 21 accessibility checkpoints (21/21 passed).
- **Automated Verification**:
  - `tests/test_p3_1_expenses_role_split.py` (3/3 passed).
  - `tests/test_p3_2_expense_form_improvements.py` (3/3 passed).
  - `tests/test_p3_3_bacs_export_paid.py` (3/3 passed).
  - `tests/test_p4_1_evaluations_role_permissions.py` (3/3 passed).
  - `tests/test_p4_2_evaluation_scoring_acknowledge.py` (3/3 passed).

---

## [2.16.0] — 2026-11-12

### Milestone 8 Completed: National Officials Availability Matrix & Heatmap Overhaul

#### 👤 Forward-Facing User Summary
- **Continuous Calendar & Month Navigation (M8-1)**:
  - Transformed the disjointed fixture-only date columns into a continuous calendar covering every day of the selected month (1st through 30th/31st).
  - Added month pagination controls (`◀ Prev Month`, `Next Month ▶`, and `🎯 Current Month`) with an interactive current-month badge.
  - Added quick period presets: **Full Month**, **Next 14 Days**, **Next 30 Days**, **Matchdays Only**, and a **Custom Date Range** picker.
- **Multi-Dimensional Filters & Official Search (M8-2)**:
  - Added live universal text search to locate officials instantly by name, email, or Basketball England licence number.
  - Added qualification filter dropdowns for Floor Referees (FIBA, L4, L3, L2) and Table Officials (FIBA Table, Table L4, Table L3, Table L2).
  - Added availability status filter (`Has Free Days`, `Has Appointments`, `Has Declared Blocks`) and geographical region selector (North, Midlands, London, South/Bristol).
  - Added active results count (`Showing N of N officials • N days`) and 1-click filter reset.
- **Interactive Cell Popovers & Quick Slot Appoint Drawer (M8-3)**:
  - Clicking an **Appointed** slot (`🏀 GameCode`) opens a fixture details modal displaying matchup, venue, tip-off time, crew breakdown, and a direct link to open the fixture in the Assignor Workbench.
  - Clicking an **Available** or **Open** cell opens a quick-appointment drawer showing all unfilled game slots on that date, allowing assignors to appoint the official in one click.
- **Sticky Column Navigation & Demand Analytics (M8-4)**:
  - The "Official & Grades" column remains frozen on the left during horizontal scrolling.
  - Added a sticky "Period Totals" column on the right displaying period counts: `Appointed`, `Available`, and `Blocked`.
  - Added a top Fixture Demand row displaying daily game counts and open unassigned slot indicators.
  - Added a display density toggle: **Comfortable** vs **Compact** mode.

#### 🛠️ Technical & Admin Specifications
- **Dedicated REST API Endpoint**: Added `GET /api/availability/heatmap` in `server.py` supporting `?month=YYYY-MM`, `?startDate=YYYY-MM-DD`, `?endDate=YYYY-MM-DD`, and `?matchdaysOnly=true`.
- **Backend Analytics Calculation**: Refactored `get_availability_heatmap()` in `backend/database.py` to generate continuous date sequences, `datesMeta` demand metrics, and official `summary` counters.
- **Accessible Modal Controls**: Added `<dialog id="dialog-heatmap-fixture-details">` and `<dialog id="dialog-heatmap-slot-picker">` with full keyboard navigation and accessible aria attributes.
- **WCAG 2.1 AA Compliance**: 100% pass across all 21 accessibility checkpoints (labels, contrast, touch targets, and focus rings).
- **Automated Verification**: Added `tests/test_availability_heatmap_overhaul.py` (6/6 tests passing), maintaining 100% pass rate across 830 test cases.

---

## [2.15.1] — 2026-11-12

### Urgent Hotfix: Sign-In Availability & Auth Pipeline Restoration

#### 👤 Forward-Facing User Summary
- **Restored Interactive Sign-In & Login Gate**:
  - Fixed a bundle parsing issue that prevented click events and sign-in submissions on the login gate from firing.
  - One-click quick sign-in buttons for Super Admin, Assignor, Official, and Club Secretary now operate immediately with proper role redirection.
  - Eliminated unexpected session resets on page refresh, ensuring officials and assignors remain logged in seamlessly across browser reloads.

#### 🛠️ Technical & Admin Specifications
- **Resolved Fatal Front-End Syntax Error**: Removed extraneous closing bracket on candidate card interaction handler (`public/app.js:3252`) that blocked bundle parsing; restored browser event listener binding for all login gate actions, quick sign-in personas, and modal triggers.
- **Fixed Constant Assignment Exception on Session Boot**: Corrected `savedToken` declaration to mutable `let` in `loadBootstrapData()` to prevent unhandled TypeError exceptions resetting active sessions on browser reload.
- **Permissive Session Initialization Endpoint**: Updated `/api/auth/session` to allow self-session token issuance across all roles (Officials, Team Reps, Assignors, Super Admins) without triggering administrative persona-switch permission checks.
- **Corrected Super Admin Role Resolution**: Ensured `SUPER_ADMIN` grants `is_admin`, `is_assignor`, and `is_super_admin` in request context helpers.
- **Aligned Seeded Persona IDs**: Mapped Super Admin quick sign-in button directly to seeded `usr-aaron-senior`.
- **Automated Verification**: Added `tests/test_auth_signin_flows.py` (5/5 tests passing) verifying syntax, DOM persona bindings, password logins, 2FA challenges, and authenticated header parsing.

---

## [2.15.0] — 2026-11-12

### Priorities P0 & P1 Completed: Core Data Accuracy, Usability Quick Wins, Safer Removals & Plain-English Terminology

#### 👤 Forward-Facing User Summary
- **Accurate Travel Calculations & Club Recharges (P0-1)**:
  - Eliminated erroneous 340-mile travel estimates on local fixtures. Seeded local Bristol officials (`BS3 2EJ`, `BS34 8LP`) for Bristol Academy games.
  - Transparent ledger displays the complete journey calculation on every reimbursement row (`from postcode → to postcode`, miles, HMRC £0.45/mi rate).
  - High-mileage safeguard: Any one-way or return journey exceeding 100 miles automatically surfaces a `Long journey, confirm` warning badge requiring written justification.
- **Real-Time "Upcoming" Scheduling Logic (P0-2)**:
  - Appointments are now split cleanly into **Upcoming** and **Completed** using real-time UK date/time (`Europe/London`).
  - Completed fixtures immediately transition action buttons to **Submit Match Report** and **Claim Expenses**, removing outdated Accept/Decline/Withdraw prompts.
  - Official Hub hero card renders a friendly empty state when no future fixtures are booked, with 1-click links to open marketplace slots and the availability calendar.
  - The open officiating marketplace automatically marks past tip-offs as expired and prevents claims on bygone games.
- **Unified Assignor Dashboard Counts (P0-3)**:
  - Unified banner metrics, dashboard summary tiles, and sidebar queue counters from a single shared data selector. All tiles and banner messages are strictly synchronized, count only future fixtures, and clicking any tile instantly filters the fixture grid to that exact count.
- **Clear Incident Reporting on Official Assessments (P0-4)**:
  - Relabeled assessment badges to explicitly differentiate game incidents (`Game incident: bench technical (Art. 36)`) from the official's evaluation score.
  - Evaluation form initializes with empty score fields and unselected fixtures to prevent accidental submission of prefilled scores.
- **Optimized Fixture Grid Readability (P1-1)**:
  - Clean two-line Date & Tip-Off column (`Wed 28 Oct` / `16:00–17:30`) with timezone specified once in the column header.
  - Sticky day headers group consecutive matches on the same date with fixture counts.
  - Shorter arena names rendered first (`NBPC · Court 2`) with full street addresses available on hover.
  - Row action buttons consolidated into primary workflow (`+ Appoint` / `✎ Edit`) with secondary actions under an accessible `···` popover.
- **Declutter Candidate Inspector (P1-2)**:
  - Candidate Inspector defaults to qualified and available officials, hiding conflicted officials behind an informative toggle with a live counter (`Show N unavailable / conflicted officials...`).
  - Streamlined 3-line candidate cards fit 5–6 candidates in the drawer's initial view without scrolling.
  - Interactive sort selector supports sorting candidates by Distance (closest first), Grade (highest first), Recent assignments (fewest first), or Suitability score.
- **Safer Removal of Officials with 5-Second Undo (P1-3)**:
  - Accidental clicks on remove buttons are prevented by a modal confirmation dialog: `Remove [Name] from [Role] on [Game]?`.
  - Two distinct options: **🔔 Remove and notify official** (dispatches cancellation email alert) vs **🚪 Remove and leave open** (silent vacation).
  - 5-second undo toast (`Official removed. [Undo]`) allows assignors to instantly restore the appointment if misclicked.
- **Plain-English Terminology & Role Guidance (P1-4)**:
  - Replaced technical jargon with plain English: `Solo referee (1PO)`, `Two-referee crew (2PO)`, `Three-referee crew (3PO)`, and `Table officials (scorer, timer, shot clock)`.
  - Added accessible `(?)` help icons next to column headers and crew template selectors with one-sentence format tooltips.
  - Candidate Inspector explains role responsibilities (e.g. `U1 = Umpire 1, responsible for lead/trail mechanics opposite Crew Chief`).
- **Travel Radius Limits on Candidate Cards (P1-5)**:
  - Every candidate card displays travel distance directly against the official's chosen limit: `18 mi / 30 mi limit`.
  - Three-tier styling: neutral for within-limit trips, amber warning badge for trips exceeding the official's radius (`⚠️ Over preferred radius`), and red badge for journeys exceeding league maximums (`🚨 Exceeds max travel`).
- **WCAG AA Contrast & Readability (P1-6)**:
  - Enforced minimum 12px font size across all small text, subtext, and audit entries.
  - Text contrast verified $\ge 4.5:1$ across both light and dark themes.
  - Every interactive row element (expand toggle, slot pills, unassign, clash, popovers) is reachable by Tab and activatable by Enter/Space.

#### 🛠️ Technical & Architectural Summary
- **Backend & Database**:
  - `DatabaseRepository.revoke_appointment`: Added `notify: bool = False` parameter with automated logging into `notification_logs`.
  - `DatabaseRepository.restore_appointment`: New method and REST route `POST /api/assignor/appointments/:id/restore` reverting appointments to `ACCEPTED` and logging audit entries.
  - `DatabaseRepository.suggest_officials_for_game`: Attaches `maxTravelMiles` and `leagueMaxTravelMiles` per candidate.
- **Frontend Engine**:
  - `public/app.js`: Added `showUndoToast`, `findAppointmentDetails`, `getPositionDutyDescription`, `formatPositionPlainEnglish`, `formatCrewTemplateExplanation`.
  - Added keyboard interaction listeners (`Enter`, `Space`, `ArrowDown`, `Escape`) across `.crew-pill`, `.slot-chip`, `[data-row-menu-toggle]`, and `.game-row`.
- **Test Infrastructure**:
  - Added `tests/test_p1_3_safer_removal.py`, `tests/test_p1_4_role_jargon.py`, `tests/test_p1_5_travel_radius_limit.py`, and `tests/test_p1_6_contrast_readability_a11y.py`.
  - Total automated test suite expanded to 819 tests (100% passing). WCAG 2.1 AA audit 100% passing (21/21 checks).

---

## [2.14.0] — 2026-11-11

### Feature & UX: Fixture Grid Date & Range Filters, Universal Multi-Field Search & Responsive 2-Tier Toolbar

#### 👤 Forward-Facing User Summary
- **One-Click Quick Date Presets**:
  - Assignors can now instantly isolate fixture slates with one click using the new segmented date pills:
    - **All Dates**: Displays the complete season schedule (default).
    - **Today**: Isolates fixtures scheduled on the current date.
    - **This Weekend**: Automatically targets the upcoming Saturday and Sunday slate (e.g. 14–15 Nov).
    - **Next 7 Days**: Rolling 7-day outlook for active weekly appointing.
    - **Next 30 Days**: Month-ahead schedule overview.
    - **Past Fixtures**: Prior fixtures for historical review, match report verification, and BACS payment audit.
    - **📅 Custom Range...**: Seamlessly activates explicit calendar start and end date pickers.
- **Precision Date Range Pickers**:
  - Added dedicated **From Date** and **To Date** pickers (`<input type="date">`) supporting single-day targeting or custom scheduling windows.
- **Universal Multi-Field Fuzzy Search**:
  - The search bar now indexes formatted dates in both British and ISO formats (`"14 Nov"`, `"14/11/2026"`, `"2026-11-14"`), days of the week (`"Saturday"`, `"Sat"`, `"Wednesday"`), competition tiers (`"NBL Division 1"`, `"Jnr NBL"`, `"SLB"`), age categories & genders (`"U18"`, `"MENS"`, `"WOMENS"`), and crew roles (`"Crew Chief"`, `"Umpire"`).
  - Multi-term queries (e.g., `"Manchester 14 Nov"`, `"U18 Saturday"`, or `"London D1"`) match across all terms simultaneously.
  - Added a 1-click `✕` clear button inside the search input.
- **Dedicated Competition & Tier Dropdown**:
  - Filter fixtures directly by competition: *NBL Division 1*, *Jnr NBL (U14/U16/U18)*, *SLB / National Cup*, *Men's Competitions*, or *Women's Competitions*.
- **Live Fixture Count Pill & Active Filter Chips Strip**:
  - An inline live status pill announces matching fixtures in real time (e.g. `Showing 11 of 40 fixtures`).
  - Active filters render as dismissal chips (e.g. `[🗓️ This Weekend ✕]`, `[📍 NBPC Manchester ✕]`, `[Search: "lions" ✕]`) allowing assignors to remove individual criteria with a single tap, plus a `Clear all` button that resets the grid.
- **Mobile-First Responsive Ergonomics (< 768px)**:
  - Date preset pills feature smooth edge-to-edge touch horizontal scrolling (`-webkit-overflow-scrolling: touch`).
  - Detailed filters are housed in a collapsible secondary drawer (`[🎛️ Filters (N)]` button with active count badge) to preserve screen real estate and prevent the fixture grid from being pushed below the fold.
  - Touch targets strictly meet the 44px minimum sizing standard (WCAG 2.5.5) and inputs use 16px typography to eliminate iOS Safari auto-zoom.

#### 🔧 Technical & Architectural Summary
- **Frontend Architecture (`public/app.js` & `public/styles.css`)**:
  - Implemented `getSystemDate()`, `getWeekendDates()`, `updateFilterStatusUI()`, and `clearAllFilters()`.
  - Added `datePreset`, `dateFrom`, `dateTo`, `competitionFilter` to state, and updated `getFilteredGames()` to evaluate compound date and text predicates.
  - Added 2-tier CSS layout (`.filter-tier-1`, `.filter-tier-2`, `.date-preset-pills`, `.active-filter-chips-strip`).
- **Automated Regression Suite (`tests/test_fixture_date_filters.py`)**:
  - Added 4 test cases validating HTML markup, CSS styling, date calculation algorithms, and multi-word universal search, bringing test suite count to 782 passing tests.

---

## [2.13.0] — 2026-11-11

### Feature & UX: Workbench Split-Pane Drawer, Fixture Grid Consolidation, Smart Slot Targeting & Safeguarding Hard Blocks

#### 👤 Forward-Facing User Summary
- **Responsive Split-Pane Layout & Collapsible Candidate Inspector Drawer**:
  - The right-hand Candidate Inspector panel can now be collapsed with the new **[✕ Close]** button or toolbar drawer toggle (**◀/▶**), allowing the Fixture Grid to expand to full 100% viewport width for high-density scheduling.
  - When opened on desktop displays, the inspector drawer is constrained between 380px and 420px with independent scrolling, preventing the actions column or fixture status pills from being clipped or pushed offscreen.
- **Consolidated Fixture & Competition Table Column**:
  - Merged the previous separate `COMPETITION` and `MATCHUP` columns into a single high-contrast `FIXTURE & COMPETITION` column.
  - **Top line**: Bold team matchup (e.g., *Manchester Magic NBL D1 vs London Lions NBL D1*) and travel carpool badge.
  - **Bottom line**: Compact metadata subtext showing competition tier, division, gender, and crew officiating template (*NBL Division 1 • MENS • FIBA 3PO*).
- **Smart Target Slot Selection & Visual Active States**:
  - When selecting a fixture (via table row click, direct URL parameter `?fixture=gm-101`, or initial page load), the Candidate Inspector no longer defaults blindly to Crew Chief (`CC`) if Crew Chief is already filled. It automatically targets the first unappointed (`+ Appoint`) or declined slot (e.g. `U1` or `U2`).
  - Active fixtures receive a high-contrast orange indicator bar (`4px solid #f97316`) and subtle background tint, while the active target slot pill pulses with an orange focus ring.
  - Fixtures loaded via URL parameter automatically scroll into view.
- **Safeguarding & Licensing Hard Blocks (Zero-Tolerance Statutory Protection)**:
  - Critical statutory violations can no longer be bypassed via routine assignor dispensation:
    - **Expired DBS Checks (`DBS_SAFEGUARDING_EXPIRED`)**: Hard-blocked across all U18 and youth fixtures per UK safeguarding law.
    - **Expired Licences (`LICENCE_EXPIRED`)**: Hard-blocked across all senior and youth fixtures due to invalid public liability insurance.
    - **Schedule Overlaps (`DOUBLE_BOOKED`)**: Hard-blocked against simultaneous tip-off times.
  - On candidate cards, the **[⚠️ Dispensation Override...]** button is replaced with a disabled **[🚫 Blocked: Renew Credentials]** or **[🚫 Blocked: Time Clash]** action, and slot drag-and-drop is disabled.
  - Routine dispensation overrides remain available strictly for waivable soft rules (e.g., travel radius exceeded, club conflict of interest, grade progression, or <60m travel buffer).
- **Compact Conflict Diagnostics in Candidate Cards**:
  - When *Show Conflicted Officials* is toggled, candidate cards no longer balloon in height.
  - Candidates display compact summary chips by default (e.g., `⚠️ Below Grade (L3 < L4)`, `⚠️ >30mi Radius (206.8mi)`, `⚠️ <60m Buffer`, `🚨 DBS Expired`).
  - Full rule explanations and remediation guidance ("What would fix it") are neatly collapsed inside a `<details class="conflict-details-accordion">` dropdown.
- **Relocated Webhook Banner & Primary CTA Polish**:
  - Fixed duplicate plus sign on the workbench primary CTA button (`+ Add Fixture`).
  - Replaced the large standalone League Schedule Webhook banner with an inline toolbar status pill (`🟢 Webhook Ready • Last sync: Never` with compact `[⚡ Sync Now]`), relocating the live webhook URL (`/api/league/sync-schedule`) and sync breakdown telemetry into a modal accessible under **Tools & Sync**.
- **Realistic UK Regional Travel & Postcode Distance Seed Data**:
  - Audited mock officials' home postcodes and fixture assignments across regional pools (Manchester, London, Bristol). Routine local matches now reflect realistic travel under 30 miles (2.5 mi – 28.0 mi), reserving long-distance travel exclusively for National Cup and Super League Basketball (SLB) fixtures.

#### 🔧 Technical & Architectural Summary
- **Conflict Evaluation Engine (`backend/conflict_engine.py`)**:
  - Added `CRITICAL_HARD_BLOCK_CODES` set and `isHardBlock` flag to `ConflictViolation.to_dict()`.
  - Added `has_hard_block`, `hard_block_reason`, and `hard_block_code` properties to `EvaluationResult` dataclass and JSON serialization.
- **Database & Appointment Repository (`backend/database.py`)**:
  - Added postcode coordinates for `M12 4TF`, `BS34 8LP`, `SK1 3XE`, `M13 9PL`, `SW9 8PS`, `SE15 4QN`, and `M20 2WS`.
  - Enforced zero-tolerance hard blocks in `create_appointment()` for `LICENCE_EXPIRED`, `DOUBLE_BOOKED`, and `SAFEGUARDING_HARD_BLOCK` on youth fixtures.
  - Regionalized dynamic fixture pools in `dyn_appts` so Manchester, London, and Bristol fixtures recruit from matching regional official rosters.
- **Workbench Frontend Engine (`public/app.js` & `public/styles.css`)**:
  - Implemented `getSmartDefaultSlot()`, `initCandidateInspectorDrawer()`, and slot autofocus styling with `@keyframes pulseOrangeRing`.
  - Consolidated grid header and row DOM to 7 columns (`colspan="7"` on empty states and child rows).
  - Implemented compact conflict chips and `<details>` accordions in `renderSuggestionDrawerList()`.
- **Regression Test Suite (`tests/test_workbench_six_changes.py`)**:
  - Added 6 dedicated unit test cases validating all acceptance criteria, bringing total passing test suite count to 778 tests.

---

## [2.12.0] — 2026-11-11

### Feature & Governance: OpenAPI 3.1, Interactive Swagger UI, Multi-Tab Sync, Rulebook KB & WCAG Focus Trapping

#### 👤 Forward-Facing User Summary
- **Interactive OpenAPI 3.1 & Swagger UI (`/api/docs`) [Issue #8]**: Added an interactive Swagger documentation portal at `/api/docs` and exported the full OpenAPI 3.1.0 specification at `/api/openapi.json`. Developers, league committee secretaries, and third-party scoring systems (e.g. Genius Sports, NBL LiveStats) can now test, inspect, and integrate with over 50 REST endpoints directly from their browser.
- **Multi-Tab Session & Theme Synchronization [Issue #9]**: When working across multiple browser tabs (e.g., Fixture Workbench in Tab 1 and Audit Ledger or Finance Reports in Tab 2):
  - Toggling light/dark theme in any tab immediately updates all open tabs in real-time.
  - Switching user personas automatically syncs credentials and session state across tabs.
  - Modifying appointments quietly updates fixture coverage pills and counters across all open tabs via `BroadcastChannel` and `storage` events without requiring a manual page refresh.
- **Basketball England & FIBA Governance Knowledge Base (`/api/governance/rules`) [Issue #10]**:
  - Added an in-app searchable regulations modal accessible via the new `📖 Rulebook` topbar button.
  - Pre-seeded official regulatory guidance covering:
    - **BE Regulation 4**: Official appointments, crew sizes (SLB/NBL D1 3PO vs NBL D2/D3 2PO), priority competitions, and solo officiating dispensation limits.
    - **BE Safeguarding & DBS**: Mandatory Enhanced DBS checks for U18 fixtures, adult chaperone protocols, and 24h disclosure reporting.
    - **Table Officiating Mechanics**: FIBA Article 29 shot clock resets (24s backcourt/frontcourt vs 14s offensive rebound reset and defensive foul under 14s).
    - **FIBA 2024 Floor Mechanics**: 2PO Lead/Trail switches, 3PO strong-side rotations, and pre-match conference checklists.
    - **Uniforms & Equipment**: Light (home) vs Dark (away) clash protocols, compression sleeve color alignment, and whistle standards.
    - **Forfeits & Defaults**: 15-minute grace period, 20–0 scoresheet notation, and 100% referee travel & fee entitlement.
  - Real-time instant search input with dynamic category pills.
- **WCAG 2.1 AA Focus Trapping & Colorblind-Safe Coverage Markers [Issue #5]**:
  - Implemented active focus trapping inside all `<dialog>` modals: Tab and Shift+Tab navigation stays strictly contained within active modals.
  - Standardized `Escape` key handling to cleanly dismiss active dialogs and automatically return focus to the triggering element.
  - Added distinct geometric shapes and symbols alongside coverage status dots (`●` Circle for Full, `◆` Diamond for Awaiting Acceptance, `▲` Triangle for Partial, `■` Octagon for Declined/Replacement, `⬢` Rhombus for Critical Unassigned), enabling users with deuteranopia or protanopia to differentiate fixture urgency without relying solely on color.
  - Added an `aria-live="polite"` region to the appointment drawer announcing candidate suggestion counts to screen readers.
- **Frontend In-App Changelog Modal Synchronized**: Updated `#dialog-changelog` and footer version pill to `v2.12.0 (Build 20261111w)`, fully synchronizing release cards for v2.9.0, v2.10.0, v2.11.0, v2.11.1, v2.11.2, and v2.12.0 with interactive User and Technical mode tabs. Added automated regression assertions in `tests/test_phase8_issues_5_8_9_10.py` to ensure the frontend modal remains strictly synchronized with this changelog going forward.

#### ⚙️ Technical Architecture & Administrator Log
- **Backend Architecture & Endpoints (`server.py`, `backend/governance.py`, `scripts/generate_openapi.py`)**:
  - Implemented `backend/governance.py` with categorized regulations data and `list_governance_rules(query, category)`.
  - Added REST endpoint `GET /api/governance/rules` supporting keyword and category filtering.
  - Generated full OpenAPI 3.1.0 specification at `docs/openapi.json` and mounted interactive Swagger UI at `GET /api/docs` and `GET /docs`.
- **Frontend Architecture (`public/app.js`, `public/styles.css`, `public/index.html`)**:
  - Initialized `new BroadcastChannel("crewchief_sync")` with fallback to `storage` events for `THEME_CHANGED`, `PERSONA_SWITCHED`, and `APPOINTMENT_UPDATED`.
  - Added `initAccessibleDialogFocusTrapping()` wrapping `showModal` and binding keyboard Tab cycling and Esc dismissal with trigger restoration.
  - Updated `formatHealthLabel` and `.health-dot` CSS rules with clip-path geometric shapes.
  - Integrated `#drawer-live-announcer` in `#suggestion-drawer`.
- **Verification**:
  - Added 11 automated unit tests in `tests/test_phase8_issues_5_8_9_10.py`.
  - Total automated test suite expanded to 771 tests (100% passing in ~34s).
  - 100% WCAG 2.1 AA accessibility audit pass across all 21 checkpoints.

---

## [2.11.2] — 2026-11-11

### Feature & Fix: Assignor Audit Ledger Field Mapping & Per-Fixture History Timeline

#### 👤 Forward-Facing User Summary
- **Assignor Audit Ledger Display Restored**: Resolved an issue where audit rows appeared blank inside the Assignor Audit Ledger modal. All past dispensation overrides, self-appointments, auto-assign batches, and chase reminders now render with complete timestamps, action tags, assignor names, and mandatory audit justifications.
- **Session Token Authorization Self-Healing**: Fixed an authorization failure ("Failed to retrieve audit ledger") caused when navigating without an active server session token or with an unseeded token from `localStorage`. Client network requests now automatically guarantee an authorized assignor session (`tok-assignor-dana`) and transparently self-heal upon 401 token expiration.
- **Printable Season Report & Direct Browser Navigation**: Resolved `UNAUTHORIZED` errors when opening `/api/reports/season-committee-summary.html` directly in the browser address bar or via printable preview buttons. Direct browser tab navigations and downloads now synchronize session cookies, support query parameter tokens (`?token=...`), and gracefully render the A4 printable executive committee report.
- **Per-Fixture Appointment History**: Assignors can now inspect the complete chronological audit and appointment trail for any specific fixture:
  - Added dedicated `📜 History` buttons directly in the assignor workbench grid, the card view deck, and the candidate drawer.
  - Interactive fixture filter dropdown inside the audit modal allows isolating any single fixture or returning to "All UK Fixtures".
  - Clicking any fixture code in the ledger automatically isolates that match's timeline.
- **Lifecycle Event Auditing**: Every status transition across the appointment lifecycle—including appointments offered, two-tap acceptances, declines with reasons, and revocations—is now captured in the ledger and per-fixture timeline.
- **Filtered CSV Export**: Assignors can export either the entire league audit ledger or an isolated fixture's audit history to CSV with a single click.

#### ⚙️ Technical Architecture & Administrator Log
- **Frontend-Backend Field Alignment (`public/app.js`, `backend/database.py`)**:
  - Normalized backend database output to supply both camelCase (`createdAt`, `actionType`, `assignorName`, `gameCode`, `officialName`, `reason`) and snake_case aliases (`created_at`, `action_type`, `actor_name`, `game_code`, `official_name`, `reason_or_details`) for backwards and forwards compatibility.
  - Updated `openAssignorAuditLogs(filterGameId)` in `public/app.js` with defensive fallbacks across all fields, rich action badges, and dynamic title/subtext bindings.
- **Per-Fixture History & Filtering (`backend/database.py`, `server.py`)**:
  - Added `game_id` filtering support to `list_assignor_audit_logs(limit, actor_user_id, game_id)`.
  - Implemented `get_fixture_history(game_id, actor_user_id)` synthesizing direct audit logs and appointment lifecycle transitions into a unified chronological descending stream.
  - Added REST endpoint routes `/api/assignor/audit-logs?game_id={id}` and `/api/games/{id}/history`.
  - Updated `export_audit_logs_csv(game_id=...)` to generate fixture-specific CSV filenames and data.
- **UI & Modal Enhancements (`public/index.html`)**:
  - Added `<select id="select-audit-fixture-filter">`, `#btn-audit-clear-fixture`, and `#audit-log-counter` controls bar.
  - Added action buttons in `renderAssignorGamesGrid()`, `renderAssignorCardsDeck()`, and `selectSlotAndLoadCandidates()`.
- **Verification**:
  - Added 4 new integration unit tests in `tests/test_safeguarding_mentor_finance.py` verifying casing, fixture history, and CSV export.
  - All 756+ tests passing; 100% WCAG 2.1 AA audit pass.

---

## [2.11.1] — 2026-11-11

### Bug Fix: Dark / Light Mode Selector CSS Selector Syntax & Meta Alignment

#### 👤 Forward-Facing User Summary
- **Dark / Light Mode Selector Resolved**: Fixed an issue where clicking the topbar theme toggle (Auto / Dark / Light) produced no visible change. Both Arena Dark Mode and Daylight Court-Side Light Mode now switch immediately and persist seamlessly across browser sessions.
- **Dynamic Meta Color-Scheme Alignment**: The `<meta name="color-scheme">` tag now synchronizes dynamically with user theme overrides, adapting native browser controls, scrollbars, and canvas backgrounds to the selected theme.

#### ⚙️ Technical Architecture & Administrator Log
- **CSS Architecture (`public/styles.css`)**:
  - Fixed invalid CSS selector list syntax at line 107 where `:root[data-theme="dark"], @media` caused browsers to discard the entire dark mode stylesheet rule.
  - Separated `:root[data-theme="dark"], html[data-theme="dark"]` from `@media (prefers-color-scheme: dark)` into distinct, standards-compliant CSS rule blocks per modern web standards.
- **Client Application (`public/app.js`, `public/index.html`)**:
  - Updated theme toggle handler and early inline head script to keep `<meta name="color-scheme">`, `document.documentElement.dataset.theme`, and `document.documentElement.style.colorScheme` strictly in sync.
  - Bumped version hash to `v=20261111t` across `index.html`.

---

## [2.11.0] — 2026-11-11

### GitHub Actions CI/CD Pipeline, Issue Tracking Backlog & PR Quality Templates

#### 👤 Forward-Facing User Summary
- **GitHub Issue Tracking & Product Roadmap**: Established the platform's public tracking backlog with standardized issue templates:
  - Issue #1: Hosting Infrastructure Evaluation (Railway Container vs. RochenHost LiteSpeed).
  - Issue #2: Production Custom Domain Setup (`crewchief.uk`) and Passkey RP / OAuth alignment.
  - Issue #3: Automated Core Web Vitals (CWV) & Mobile PageSpeed Budget Checks.
  - Issue #4: PWA Web Push Notifications & Offline Appointment Sync.
- **Formalized Contribution & Pull Request Standards**: Added `.github/PULL_REQUEST_TEMPLATE.md` with mandatory quality gates (all 756 unit tests passing, zero JS syntax errors, 100% WCAG 2.1 AA audit, and dual-deployment verification).
- **Issue Templates**: Added structured bug report and feature request templates in `.github/ISSUE_TEMPLATE/`.

#### ⚙️ Technical Architecture & Administrator Log
- **Continuous Integration Pipeline (`workflows/ci.yml`)**:
  - Automated testing workflow executing on Python 3.13 and Node.js 20.
  - Executes `node --check public/app.js` syntax verification.
  - Executes automated WCAG 2.1 AA accessibility audit (`python3 scripts/wcag_audit.py`).
  - Executes full 756-test suite (`python3 -m unittest discover -s tests`).
  - Performance budget gate asserting >60% Gzip reduction on all frontend bundles.

---

## [2.10.0] — 2026-11-11

### Mobile Performance & Core Web Vitals Optimization (LiteSpeed Gzip, INP Task Slicing, Non-Blocking CSS)

#### 👤 Forward-Facing User Summary
- **Dramatic Payload Reduction (>78%–82%)**: Enabled server-side Gzip compression on LiteSpeed and Railway, slashing initial download size across all devices:
  - HTML document reduced from 285 KB to **57.0 KB** (80.0% reduction).
  - Stylesheet bundle reduced from 136 KB to **23.4 KB** (82.7% reduction).
  - JavaScript application bundle reduced from 455 KB to **99.5 KB** (78.3% reduction).
- **Eliminated Render-Blocking Resources**: Interactive map styles (`leaflet.css`) now load asynchronously via `<link rel="preload">`, unblocking the first paint.
- **Prioritized Script Loading**: Core application logic now loads with `fetchpriority="high"`, while non-critical map engines and Google GIS load with `fetchpriority="low"`.
- **Smoother Mobile Interactions (INP & Task Slicing)**: Replaced monolithic sequential DOM rendering with on-demand view rendering (`renderActiveView()`), deferring background views with `requestIdleCallback` and `scheduler.yield()`.
- **Zero Cumulative Layout Shift (CLS)**: Added explicit `width` and `height` dimensions to all 41 SVG icons across the interface.
- **Mobile Touch Target Conformance**: Expanded `@media (pointer: coarse)` touch target minimum sizes to 44px (`min-block-size: 44px; min-inline-size: 44px;`) complying with WCAG 2.5.8.

#### ⚙️ Technical Architecture & Administrator Log
- **Web Server Configuration (`public/.htaccess`, `scripts/setup_remote.py`)**:
  - Configured Apache/LiteSpeed `mod_deflate`, `mod_expires`, and `mod_headers`.
  - Configured 1-year immutable caching (`public, max-age=31536000, immutable`) for versioned CSS/JS/images/fonts.
  - Enforced `no-cache, must-revalidate` on HTML documents and added modern security headers (`X-Content-Type-Options: nosniff`, `X-Frame-Options: SAMEORIGIN`).
- **Python Static Server (`server.py`)**:
  - Upgraded `_serve_static` to parse URL query parameters, validate version hashes (`v=...`), and deliver immutable caching headers.
- **Client Application (`public/app.js`, `public/index.html`)**:
  - Implemented `yieldToMain()` with `scheduler.yield()` fallback.
  - Guarded Assignor-only API requests on unauthenticated loads and parallelized authenticated calls via `Promise.allSettled`.

---

## [2.9.0] — 2026-11-11

### Platform Rebrand to CrewChief UK, WebAuthn Passkeys & Containerized Dual-Deployment (Railway + Rochen)

#### 👤 Forward-Facing User Summary
- **Platform Rebrand to CrewChief UK**: Comprehensive rebranding from "RefSync UK" to **"CrewChief UK"** across all user interfaces, brand badges, PWA manifest, service worker, email communications, and system meta tags.
- **Biometric FIDO2 / WebAuthn Passkeys**: Added native TouchID, FaceID, Windows Hello, and hardware security key authentication. Users can register and manage multiple passkeys from their profile, enabling 1-tap sign-in without passwords.
- **Streamlined Authentication**: Streamlined third-party options by retiring the unconfigured Apple Sign-In UI in favor of native Passkeys, Google Identity Services, and cryptographic Magic Links.
- **Dual Production Hosting**: Deployed simultaneously to both Railway (`https://refsync-uk-production.up.railway.app/`) and RochenHost (`https://refsync.newhamyoungbloods.co.uk/`).
- **Google Search Console Verification**: Injected verification meta tags and hosted `google6bb3e241f0a81bd6.html`.

#### ⚙️ Technical Architecture & Administrator Log
- **WebAuthn Endpoints & Engine (`backend/database.py`, `server.py`)**:
  - Added `/api/auth/passkey/register/options`, `/api/auth/passkey/register/verify`.
  - Added `/api/auth/passkey/login/options`, `/api/auth/passkey/login/verify`.
  - Added `/api/auth/passkey/credentials` (list, rename, delete).
  - Dynamic `rpId` calculation inspecting `X-Forwarded-Host` across custom domains and Railway subdomains.
- **Container Infrastructure (`Dockerfile`, `railway.json`)**:
  - Configured Python 3.13-slim container with non-root security user (`crewchief`), automated health checks, and persistent SQLite volume mount.
- **Dual Deployment Orchestrator (`scripts/deploy_all.sh`)**:
  - Automated deployment pipeline pushing to GitHub (triggering Railway build) and securely uploading and executing remote setup on RochenHost.
- **Test Suite Expansion**:
  - Added `tests/test_passkeys_and_branding.py` verifying WebAuthn registration, login assertion, credential lifecycle, and domain rpId resolution.
  - Expanded test suite from 749 to **756 unit tests** (100% passing).

---

## [2.8.0] — 2026-11-11

### Streamlined Assignor Toolbar, Non-Overridable DBS Hard Gates, Mentor/Mentee Pairing & Split Financial Reports

#### 👤 Forward-Facing User Summary
- **Decluttered Assignor Action Bar**: Replaced 13 horizontal scattered buttons with a focused daily action toolbar and three categorized dropdown menus:
  - *Operations & Approvals*: Expiry & Safeguarding Warnings, Reschedule Queue, Crew & Table Templates, Setup Wizard.
  - *Finance & Reports*: Official BACS Payouts (CSV), Club Recharge Invoices (CSV), Workload Fairness, Audit Logs, Bulk Import/Export.
  - *Tools & Sync*: League Schedule Feed Webhook, Database Backup.
- **Live Operations Alert Badge**: A real-time amber badge indicator directly on the Operations trigger button showing the combined count of pending credential warnings and reschedule requests.
- **UK DBS & Safeguarding Hard Gate**: Enforced strict zero-tolerance gatekeeping for youth fixtures (U12, U14, U16, U18, Jnr NBL, Central Venue). Officials with unverified or expired DBS checks are permanently locked out of youth appointments with a `⛔ Safeguarding Gate` badge in the candidate drawer; casual overrides are blocked.
- **Mentor / Mentee Smart Pairing**:
  - Developing and rookie officials are paired with vetted Level 3+ mentors on multi-official crews (2PO/3PO).
  - Candidates drawer highlights mentors with a `🎓 Level 3+ Mentor` badge and awards a +30 suitability boost when partnering developing officials.
  - Auto-assigner prevents pairing two novices together without an experienced mentor on court.
- **Split Treasurer Reports**:
  - **Official BACS Payout Schedule (CSV)**: 1-click export formatted with official names, sort codes, account numbers, match fees, and HMRC £0.45/mile expenses ready for bank batch upload.
  - **Club Recharge Invoices (CSV)**: Dedicated billing schedule itemizing every fixture hosted by a club, detailing floor fees, table official fees, and travel reimbursements.

#### ⚙️ Technical Architecture & Administrator Log
- **Domain Conflict Engine (`backend/conflict_engine.py`)**:
  - Added `has_safeguarding_block` and `safeguarding_block_reason` fields to `EvaluationResult` and `to_dict()`.
  - Added `NOVICE_PAIRING_ADVISORY` soft violation when multiple developing officials are paired without a mentor.
  - Boosted mentoring partner score by +30 points (`+30 Mentoring Partner Boost`) and added `-15 Dual-Novice Advisory` penalty.
- **Database & Business Logic (`backend/database.py`)**:
  - Hardened `create_appointment`: blocks overrides on youth fixtures unless formal Safeguarding / Welfare Officer clearance is documented (>= 20 characters).
  - Enhanced `preview_auto_assign` and `auto_assign_open_slots` to re-rank candidate pools for companion slots when a developing official is on the crew.
  - Implemented `export_club_recharge_invoices_csv`.
- **REST API Endpoints (`server.py`)**:
  - Added `/api/export/bacs-payouts.csv` (and `/api/export/bacs-payouts-csv`).
  - Added `/api/export/club-recharge-invoices.csv` (and `/api/export/club-invoices.csv`).
- **Frontend Architecture (`public/index.html`, `public/app.js`)**:
  - Toolbar dropdowns initialized with `setupToolbarDropdown('btn-trigger-ops-menu', 'menu-ops')`.
  - Added `updateOpsAlertBadge()` synchronizing alert badges across views.
  - Disabled assignment buttons and drag events for candidates with safeguarding hard blocks.
- **Automated Verification**:
  - Created `tests/test_safeguarding_mentor_finance.py` verifying DBS hard blocks, mentor pairing bonuses, and both CSV exports.
  - 749 / 749 unit and integration tests passing cleanly.

---

## [2.7.0] — 2026-11-11

### Multi-League Tenancy, Super Admin Control Center, Shared Cross-League Pool & Python 3.13 Upgrade

#### 👤 Forward-Facing User Summary
- **Multi-League Tenancy Architecture**: Enables independent UK basketball leagues (e.g. Newham Youngbloods, Surrey Basketball, Essex Met) to operate on RefSync UK with complete data isolation. Each league owns and manages its own fixtures, clubs, venues, fee schedules, and crew templates without seeing other leagues' data.
- **Unified Cross-League Officials Pool**: Floor referees and table officials have a single, unified login, a single DBS & safeguarding record, and a single availability calendar across all leagues.
- **Platform-Wide Double-Booking & Clash Prevention**: If an official is appointed to a game in League A, the system immediately recognizes the booking across the entire platform and flags a hard double-booking clash if League B attempts to appoint them for an overlapping time slot or within travel buffer limits.
- **Super Admin Control Panel**: Designated platform super administrator (Aaron Senior) can provision new league tenancies in seconds, assign league administrators, and inspect platform-wide health metrics (active leagues, total officials pool, global fixture coverage).
- **Dedicated Online Sandbox Demo Environment**: Prospective league administrators and committees can safely test RefSync UK in a dedicated sandbox tenancy (`lg-demo`) with sample games, auto-appoint simulations, and a 1-click "Reset Demo Sandbox" button that refreshes test fixtures without touching live league data.
- **League Tenancy Switcher**: A modern league selector dropdown in the navigation header allowing administrators with multi-league access to switch active tenancy context seamlessly.
- **Python 3.13 Modern Runtime**: Upgraded server CGI runtime from Python 3.11 to Python 3.13.18 on production, ensuring modern performance, future-proof reliability, and support through October 2029.

#### ⚙️ Technical Architecture & Administrator Log
- **Python 3.13 Runtime Migration**:
  - Updated `public/api.cgi` and `dist/setup_remote.py` shebangs to `#!/opt/alt/python313/bin/python3` (Python 3.13.18 on Rochen cPanel).
- **Database Schema & Tenancy Layer (`backend/database.py`)**:
  - Added `SUPER_ADMIN` to `VALID_ROLES`.
  - Created `leagues` table (`id`, `name`, `code`, `description`, `season_label`, `logo_url`, `contact_email`, `is_active`, `created_at`, `created_by`).
  - Created `user_league_memberships` table (`id`, `user_id`, `league_id`, `league_role`, `created_at`).
  - Added additive `league_id TEXT DEFAULT 'lg-primary'` to `games`, `clubs`, and `crew_templates`.
  - Seeded default tenancies: `lg-primary` ("Newham Youngbloods Basketball League", `NYBL`) and `lg-demo` ("Demo Basketball League (Sandbox)", `DEMO`).
  - Designated Aaron Senior (`usr-aaron-senior`) as `SUPER_ADMIN` with platform-wide tenancy provisioning privileges.
  - Implemented `list_leagues`, `get_league_by_id`, `create_league`, `assign_league_membership`, `get_super_admin_overview`, and `reset_demo_data`.
- **Cross-League Conflict Detection (`backend/conflict_engine.py` & `backend/database.py`)**:
  - `_build_official_context` queries active appointments across all tenancies, ensuring double-booking conflicts and travel clashes are detected and blocked globally.
- **REST Endpoints (`server.py`)**:
  - `GET /api/leagues`: lists active leagues and memberships.
  - `GET /api/leagues/{id}`: returns tenancy details and admin list.
  - `POST /api/super-admin/leagues`: provisions new league tenancy (restricted to `SUPER_ADMIN`).
  - `POST /api/super-admin/leagues/{id}/memberships`: assigns league administrator.
  - `GET /api/super-admin/overview`: platform overview KPIs (restricted to `SUPER_ADMIN`).
  - `POST /api/demo/reset`: non-destructive reset of `lg-demo` sandbox data.
  - `PUT /api/auth/active-league`: updates active tenancy context in session.
- **Frontend Architecture (`public/index.html`, `public/styles.css`, `public/app.js`)**:
  - Added `#topbar-league-switcher` dropdown pill with basketball icon.
  - Added `#btn-open-super-admin` visible only to `SUPER_ADMIN`.
  - Added `#dialog-super-admin` with overview metrics, tenancies table, provisioning form, and 1-click sandbox reset.
  - Scoped fixture workbench display to active tenancy.
- **Automated Verification**:
  - Added `tests/test_multi_league_super_admin.py` covering tenancy creation, RBAC barriers, cross-league double-booking conflict engine enforcement, and sandbox reset.
  - 744 / 744 unit tests passing cleanly.

---

## [2.6.0] — 2026-11-11

### Modernized Month-by-Month Availability Calendar & Travel Boundaries

#### 👤 Forward-Facing User Summary
- **Interactive Full Month-by-Month Calendar**: Replaces the cramped, static 7-day strip with a full month-by-month calendar with intuitive month navigation (`◀ Prev Month`, `Next Month ▶`, `Today`), UK standard Mon–Sun week layout with highlighted basketball weekends, today indicators, and side-by-side visibility of confirmed fixture appointments and availability windows.
- **Designed for Effortless User Input**: Clicking or tapping any date cell opens a purpose-built modal designed for quick scheduling, complete with 1-tap presets (`All Day Available`, `Morning 08:00–13:00`, `Afternoon/Evening 13:00–22:00`, `All Day Unavailable`, `Evening Block 17:00–22:00`, and `Custom Times`).
- **Travel Mileage & Geographic Boundaries**: Referees and table officials can declare maximum travel mileage from their home postcode (e.g. 10 mi, 15 mi, 25 mi, 35 mi, 50 mi, or Unlimited), declare preferred regions or venue clusters (e.g. "East London, Newham, Essex"), and toggle acceptance for out-of-area / national fixtures.
- **Official Season Travel Profile Baseline**: A dedicated travel settings bar and dialog allows officials to save their baseline home postcode, default radius, and preferred areas so they don't have to re-enter them on every individual date.
- **Multi-Day Holiday & Exam Block-Out**: A dedicated tab within the modal enables instant blocking out of multi-week periods for university exams, family holidays, or injury recovery in a single step with 1-tap reason chips.
- **Assignor Heatmap & Conflict Engine Integration**: The conflict engine checks venue distance against the official's declared travel radius, warning assignors when a game is outside an official's travel limit while providing proximity score bonuses when games are local.

#### ⚙️ Technical Architecture & Administrator Log
- **Database Migrations (`backend/database.py`)**:
  - Added additive columns to `official_availabilities`: `max_travel_miles INTEGER`, `preferred_area TEXT`, `willing_out_of_area INTEGER DEFAULT 0`, `all_day INTEGER DEFAULT 0`.
  - Added additive columns to `users`: `default_max_travel_miles INTEGER DEFAULT 30`, `default_willing_out_of_area INTEGER DEFAULT 0`, `preferred_areas TEXT DEFAULT ''`.
  - Updated `add_availability`, `batch_add_availability_block`, `update_user_profile`, `get_user_by_id`, and `list_users` to store and project all travel parameters.
- **Strict IDOR Ownership Protection on Deletion**:
  - Implemented `get_availability_owner(avail_id)` and updated `delete_availability` so non-assignor officials can only delete their own availability records, raising a 403 Forbidden on unauthorized deletion attempts.
- **Conflict Engine Travel Radius Evaluation (`backend/conflict_engine.py`)**:
  - Extended `AvailabilityWindow` and `OfficialContext` dataclasses with `max_travel_miles`, `preferred_area`, `willing_out_of_area`, and `all_day`.
  - In `_check_availability_constraints`, evaluates road distance from official's home postcode against date-specific or profile default radius. Flags `TRAVEL_RADIUS_EXCEEDED` soft violation if distance exceeds limit and official has not opted into out-of-area fixtures.
- **REST Endpoints (`server.py`)**:
  - Updated `POST /api/officials/availabilities` to support `maxTravelMiles`, `preferredArea`, `willingOutOfArea`, `allDay`.
  - Updated `POST /api/officials/availabilities/batch-block` to support travel parameters.
  - Added `PUT /api/officials/{id}/travel-preferences` for rapid baseline travel updates.
  - Enforced ownership check in `DELETE /api/officials/availabilities/{id}`.
- **Frontend Architecture (`public/index.html`, `public/styles.css`, `public/app.js`)**:
  - Rendered `#official-avail-month-grid` with UTC calendar date calculation, weekend highlighting, status badges (`.avail-chip-full-avail`, `.avail-chip-partial-avail`, `.avail-chip-unavail`, `.avail-chip-fixture`), and keyboard accessible cell navigation (`Enter`/`Space`).
  - Added `#dialog-set-availability` with single-day/batch-block switcher and 1-tap quick preset handlers.
  - Added `#dialog-travel-preferences` for baseline travel setup.
  - Maintained 100% automated WCAG 2.1 AA audit pass (21/21 checks passed, 0 violations).

---

## [2.5.0] — 2026-11-11

### Phase 5: Automated Fixture Reminders, Universal Feedback & Season Committee Reports

#### 👤 Forward-Facing User Summary
- **Automated 48-Hour & 24-Hour Email Reminders**: Referees and table officials receive automated reminders for upcoming confirmed fixtures (at 48 hours and 24 hours before tipoff), complete with match details, venue address, assigned court, officiating crew contacts, and a 1-click `.ics` calendar sync button.
- **Granular Reminder Preferences & 1-Click Unsubscribe**: Officials can customize reminder timing or unsubscribe at any time directly in *👤 My Profile*, or via a secure 1-click unsubscribe link in every reminder email without needing to enter a password.
- **Universal Minimal-PII Feedback Widget**: A floating feedback trigger is now accessible across every page of the application, allowing officials, club reps, and assignors to submit feedback, report issues, or suggest improvements. In compliance with UK GDPR data minimization, personal email is optional and context (page and role) is transparently captured.
- **Season Committee Executive Report & PDF Export**: Assignors and league committee members have access to an executive performance report summarizing fixtures covered, appointment coverage percentage, unfilled rate, decline reasons, and an officials game count and match fees ledger, formatted for instant A4 PDF printing or export.

#### ⚙️ Technical Architecture & Administrator Log
- **Database Migrations (`backend/database.py`)**:
  - Non-destructive additive column migrations: `users.email_reminders_48h`, `users.email_reminders_24h`, `appointments.reminder_48h_sent`, `appointments.reminder_24h_sent`, `user_feedback.page_url`, and `user_feedback.user_role`.
- **HMAC Unsubscribe Cryptography**:
  - Implemented `generate_unsubscribe_token(user_id)` and `verify_unsubscribe_token(user_id, token)` using PBKDF2/SHA-256 HMAC for secure, tamper-proof 1-click email preference unsubscription.
- **Automated Reminder Engine & CLI Daemon (`scripts/send_reminders.py`)**:
  - Implemented `scan_and_send_fixture_reminders(as_of_time)` scanning upcoming confirmed appointments with strict idempotency and notification audit logging.
  - Built CLI runner `scripts/send_reminders.py` with `--as-of` testing and `--json` structured output, ready for cron invocation (`15 * * * *`).
- **Season Committee Analytics Engine (`backend/database.py`)**:
  - Implemented `get_season_committee_report(season_id)` aggregating total fixtures, completed fixtures, required slots, covered slots, unfilled rate, decline breakdown, and individual official fee ledgers.
- **REST Endpoints (`server.py`)**:
  - `GET /api/notifications/preferences` & `POST /api/notifications/preferences` (authenticated user preferences).
  - `GET /api/notifications/unsubscribe` (public HMAC token unsubscribe).
  - `GET /api/reports/season-committee-summary` (JSON) & `GET /api/reports/season-committee-summary.html` (print-optimized A4 HTML template).
  - `POST /api/admin/reminders/scan` (assignor manual scan trigger).
  - `POST /api/feedback` & `GET /api/feedback` (feedback submission and assignor review).
- **Frontend Integration (`public/index.html`, `public/styles.css`, `public/app.js`)**:
  - Added floating feedback button (`.floating-feedback-btn`) with 44px touch ergonomics and page context display.
  - Added notification preferences toggle in Profile modal.
  - Added `#dialog-season-report` with KPI cards, decline analysis, and officials ledger with 1-click "Print / Save as PDF".

---

## [2.4.0] — 2026-11-11

### Phase 4: Mobile-First Official View, Next-Fixture Hero & 1-Tap Calendar Sync

#### 👤 Forward-Facing User Summary
- **Large Next-Fixture Hero Card**: When referees or table officials open their hub, their immediate next fixture is prominently displayed at the top with matchup, tip-off time, venue, court, and match fee.
- **One-Tap Accept & Decline**: Referees can confirm upcoming fixture appointments with a single tap on mobile or desktop, with instant schedule feedback.
- **Add to Calendar (.ics)**: 1-click button downloads an `.ics` file for the specific fixture, seamlessly opening Apple Calendar, Google Calendar, or Outlook on phone or desktop.
- **Mobile Ergonomics (360px Checked)**: Designed phone-first with large touch buttons (>= 48px), clean vertical stacking on narrow viewports, and 1-tap driving directions to the venue.

#### ⚙️ Technical Architecture & Administrator Log
- **RFC 5545 Single-Fixture iCalendar API**:
  - Implemented `export_game_ical(game_id)` in `backend/database.py`.
  - Exposed `GET /api/calendar/game/{game_id}.ics` in `server.py` returning `text/calendar; charset=utf-8` with `VEVENT`, `DTSTART`, `DTEND`, `UID`, and venue geolocation text.
- **Mobile-First CSS Architecture (`public/styles.css`)**:
  - Hero card styles `.next-fixture-hero-card`, `.hero-matchup`, `.hero-details-grid`, and `.hero-action-footer`.
  - Mobile query `@media (max-width: 640px)` collapses buttons full width with `min-height: 48px;` for thumb reach.
- **Frontend Reactive Workflow (`public/app.js`)**:
  - Implemented hero card dynamic rendering in `renderOfficialPortal()`, identifying the chronological next upcoming assignment.
  - Event listeners for `[data-hero-accept]` and `[data-hero-decline]` with immediate visual confirmation.
- **Test Suite**:
  - Added `tests/test_phase4_mobile_official_view.py` with 5 automated test cases validating `.ics` generation, HTTP delivery, and 1-tap appointment confirmation.

---

## [2.3.0] — 2026-11-11

### Phase 3: Visual Design System, SVG Icons, Skeleton Loaders & WCAG AA Accessibility

#### 👤 Forward-Facing User Summary
- **Unified Visual Identity**: Adopted a single, refined court accent colour palette with balanced spacing, clear text hierarchy, and rounded geometry across every screen.
- **Accessible SVG Icons**: Replaced all emoji icons throughout the navigation bar, buttons, and alert feeds with sharp, accessible vector SVG icons that render crisply at any device resolution.
- **Arena Dark & Daylight Light Themes**: Upgraded theme switcher (`🌗 Theme`) to support a true high-contrast "Arena Mode" (deep sports hall dark) and "Daylight Court-Side" (crisp light), fully adapting to device preferences.
- **Skeleton Loaders**: Replaced blank loading screens with animated shimmering skeleton cards and rows, providing smooth visual feedback during data loading and queue refreshes.
- **Mobile-First Touch Ergonomics**: Streamlined layout for mobile screens down to 360px wide, ensuring touch targets exceed 44×44px, modals fit phone viewports, and action buttons span full width on phones for easy thumb access.

#### ⚙️ Technical Architecture & Administrator Log
- **Design Tokens (`public/styles.css`)**:
  - Centralized `:root` custom properties: single primary accent `--color-accent: #ea580c;` (light) / `#f97316;` (dark), `--color-accent-subtle`, `--color-accent-contrast: #ffffff;`.
  - Spacing scale: `--space-1` (4px) through `--space-16` (64px) on a 4px modular scale.
  - Typography scale: `--text-2xs` (11px) through `--text-4xl` (36px) with fluid modular scaling.
  - Border radii scale: `--radius-xs` (3px) through `--radius-full` (9999px).
  - Elevation & focus tokens: `--focus-ring: 0 0 0 3px rgba(234, 88, 12, 0.45);`, `--focus-outline: 2px solid var(--color-accent);`.
- **WCAG 2.1 AA Compliance**:
  - High-visibility focus indicators (`*:focus-visible`) across all interactive controls.
  - Skip-to-content keyboard link (`.skip-link`) placed immediately under `<body>`.
  - Contrast ratios verified >= 4.5:1 for body copy and >= 3:1 for large headings and UI borders.
  - Screen reader text and `aria-hidden="true"` applied to all decorative vector icons.
  - Reduced motion support (`@media (prefers-reduced-motion: reduce)`) disabling shimmer animations.
- **Responsive Layout Engine**:
  - Horizontal swipeable tabs (`touch-action: pan-x; -webkit-overflow-scrolling: touch; scrollbar-width: none;`).
  - Fluid mobile grid stacking (`@media (max-width: 640px)`) for Attention cards, KPI counters, and modal dialogs.
  - Minimum tap area >= 44×44px enforced on all interactive controls under 768px viewports.

---

## [2.2.0] — 2026-11-10

### Phase 2: Role-Based Navigation & Unified "Needs Attention" Resolution Center

#### 👤 Forward-Facing User Summary
- **Role-Dedicated Navigation**: Each role now only sees its own relevant workspace tabs:
  - **Assignors**: Needs Attention, Fixture Grid & Appointments, Crew Templates, Venues & Clubs, Users & Roles, Availability Heatmap.
  - **Referees & Table Officials**: Schedule, Cover Board & Availability, £ Fees & Mileage Claims, Assessments & Incidents.
  - **Club Representatives**: Submit & Track Club Fixtures.
- **Single "Needs Attention" List**: Replaced scattered alert badges across multiple screens with one unified, prioritized queue for assignors covering declined appointments, unfilled slots, pending match reschedules, and expiring safeguarding DBS checks.
- **Direct 1-Click Action Links**: Every attention card features a direct action button linking straight to the resolving tool (e.g. `Find Replacement →`, `Appoint Official →`, `Review Reschedule →`, `Review Credential →`).
- **Clean Top Bar**: Streamlined top bar controls so officials and club reps see only their identity badge, profile, theme toggle, and sign out.

#### ⚙️ Technical Architecture & Administrator Log
- **RBAC Server-Side Enforcement**:
  - Endpoint `GET /api/assignor/needs-attention` strictly protected with `require_assignor()`.
  - Unauthenticated access returns HTTP 401; non-assignors (referees, club reps) receive HTTP 403 Forbidden.
- **Aggregation Engine (`get_assignor_needs_attention`)**:
  - Implemented in `backend/database.py`, scanning appointments (`DECLINED`), game slots (`OPEN`/`UNFILLED`), fixture reschedule requests (`PENDING`), and safeguarding credentials (DBS within 30-day window or expired).
  - Severity calculation (`CRITICAL`, `URGENT`, `ACTION_REQUIRED`, `WARNING`) and chronological sorting.
- **Test Coverage**:
  - Dedicated test suite `tests/test_phase2_navigation_and_attention.py` covering authentication, role isolation, aggregation logic, and action metadata.

---

## [2.1.1] — 2026-11-08

### Phase 1: Security Hardening, Server-Side Sessions & Encrypted Backups

#### 👤 Forward-Facing User Summary
- **Enterprise-Grade Security**: Enhanced session security ensuring that user accounts and appointments cannot be accessed or altered by unauthorized users.
- **Strict Data Ownership**: Referees can only view, accept, or claim expenses for fixtures to which they have personally been appointed; club reps can only request changes for their own club's games.
- **Admin Backup & Restore Portal**: Appointments officers and system administrators can create encrypted database backups on demand, inspect backup archives, and restore system state with safety safeguards.

#### ⚙️ Technical Architecture & Administrator Log
- **Server Sessions & IDOR Remediation**:
  - Eliminated reliance on client-supplied user identifiers (`actor_user_id`, `userId`, `officialId`); all requests derive actor identity from server-side bearer session tokens in `auth_sessions`.
  - Added strict ownership validation for appointments (`POST /api/appointments/{id}/respond`), cover requests, expense claims, incident reports, and club reschedule requests.
- **Encrypted Backup Engine (`backend/backup.py`)**:
  - Authenticated encryption using PBKDF2-HMAC-SHA256 key derivation (100,000 iterations) with AES-compatible authenticated cipher block chaining.
  - Pre-restore safety snapshots and sandbox integrity verification before restoring database state.
- **Automated CLI Backup (`scripts/daily_backup.py`)**:
  - Scheduled daily backup script with off-server archive copy capability, retention pruning, and JSON manifest.
- **Test Coverage**:
  - Dedicated test suite `tests/test_phase1_security.py` with 16 automated tests validating IDOR mitigation, session validation, encryption, and restore integrity.

---

## [2.1.0] — 2026-11-04

### Added
- **Outbound SMTP Email Dispatch System**:
  - Implemented `POST /api/settings/smtp/test` endpoint in [`server.py`](file:///Users/aaronsenior/Documents/officials_appointments/server.py) and [`backend/database.py`](file:///Users/aaronsenior/Documents/officials_appointments/backend/database.py).
  - Multi-tier dispatch mechanism supporting:
    1. Custom external authenticated SMTP (`SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASS`, `SMTP_FROM`, `SMTP_USE_TLS`).
    2. Local sendmail MTA (`/usr/sbin/sendmail -t -i`) on Linux/cPanel/Rochen hosting environments.
    3. Localhost SMTP daemon (`localhost:25`).
    4. Safe fallback and offline audit simulation for sandboxed testing.
  - Automated dispatch wired into floor/table appointments, chase reminders (`/api/appointments/{id}/remind`), decline alerts, and the Notification Outbox test utility (`#btn-send-test-email`).
  - Outgoing test messages and live status recorded in `notification_logs` and the assignor audit ledger (`SMTP_TEST_SENT`).
  - Unit test `test_18_smtp_test_dispatch` added to [`tests/test_system.py`](file:///Users/aaronsenior/Documents/officials_appointments/tests/test_system.py).
  - Verified live delivery on Rochen production server (`https://refsync.newhamyoungbloods.co.uk`).

---

## [2.0.0] — 2026-11-02

### Added
- **Default Compact Assignor Grid**:
  - High-density 1-row-per-fixture layout showing Date, Tip-Off (UK time), Competition, UK Venue & Court, Matchup, and Full Crew.
  - Short role codes (`CC`, `U1`, `U2`, `SR`, `TR`, `SCO`, `24S`, `AS`, `COMM`) with official names.
  - Simple colour coding: green (`status-confirmed`) for confirmed, red/amber (`status-unconfirmed`) for unconfirmed/pending, declined (`status-declined`), open (`status-open`).
  - Clear clash warning marker (⚠️ `btn-clash-warning`) on conflicted or overridden appointments that opens the conflict panel on click.
  - Single-fixture row expansion card view (`btn-expand-row`) toggling full slot controls, drag-and-drop, and match fee details.
  - Court Timeline view highlighted on busy days with double-header detection and venue bonuses.
- **Enhanced Conflict & Suitability Engine**:
  - Officials ranked by fit (distance, availability, workload, grade) with short reason tags (`cand.fitReason`).
  - Conflicted officials kept behind checkbox with clear remedy guidance ("What would fix it", e.g. "Eligible for Level 3 only", "Free after 19:30").
  - Mandatory documented dispensation override reasons (10+ characters) logged to an immutable ledger.
  - Self-appointments by assignors tracked and flagged (`SELF_APPOINTMENT`) in the audit log.
- **Auto-Appoint Safety Pipeline**:
  - Modal proposal preview (`/api/assignor/auto-assign/preview`) displaying proposed count, unfilled count, fit reasons, and estimated fees + travel before committing.
  - Assignors can inspect and untick individual proposals before applying.
  - Notifications dispatched only upon explicit assignor confirmation.
  - One-click undo for the last applied batch (`/api/assignor/auto-assign/undo`).
- **Assignor Workflow & Reminders**:
  - Slot chase/reminder button (`🔔`) for appointments stuck on "Awaiting Acceptance" (`POST /api/appointments/{id}/remind`) with batch chase option.
  - Transparent match fees and HMRC £0.45/mi travel calculations displayed per official on the crew.
  - Inter-venue travel buffer (60 minutes) and rest gaps enforced between cross-venue assignments.
- **Data & Safeguarding Compliance**:
  - Role-based contact shielding: phone numbers and home postcodes masked for club representatives (`TEAM_REP`).
  - Strict DBS data protection: only DBS status (`VERIFIED`/`EXPIRED`) and expiry dates stored, never certificate or disclosure details.
  - Persona switcher, reset demo button, and demo password hints hidden outside demo mode (`?demo=1`).
  - Privacy notice updated with data retention rules (3 years fixtures, 6 years HMRC records, 30 days account deletion) and under-18 safeguarding.
  - Realistic rolling UK demo schedule (35–40 fixtures) anchored to today's date in Europe/London UK time.

---

## [1.9.1] — 2026-11-02

### Changed
- **Platform Independence & Non-Affiliation**: Removed all references claiming or implying that RefSync UK was made for or by Basketball England.
  - Added explicit independent platform disclaimer in the website footer, Privacy Policy (`privacy.html`), and Terms of Service (`terms.html`).
  - Updated match claim and sign-in terminology to emphasize independent scheduling and appointment management compatible with UK/FIBA standards.
  - Replaced governing body insignia in the brand header, printable expense form, and application footer with the independent RefSync UK officiating emblem.

---

## [1.9.0] — 2026-11-02

### Added
- **Match Officials’ Expense Form (1:1 Replica)**: Implemented an exact digital replica of the standard UK *MATCH OFFICIALS’ EXPENSE FORM*, including:
  - Official's Details: First Name, Surname, Full Street Address, Postcode, and Officiating Licence Number.
  - Match Details: Match No., Venue Name & Postcode, Game Date, Tip-Off Time, and circled `APPOINTED AS` pills (`REFEREE`, `TABLE OFFICIAL`, `STATISTICIAN`, `OTHER`).
  - Cost Details: Travel From, Travel To, Car mileage (@ 45p/mile), Company car mileage (@ 18p/mile), Public transport ticket costs with receipt notification, Match Fees claimed from Home Club, and Other Claims (parking/tolls/ULEZ).
  - UK BACS Banking Box: Dual boxed entry fields for Sort Code (`XX-XX-XX`) and 8-digit Account Number with local persistence.
  - Statutory Certification Notice: Full legal Basketball England non-taxed declaration and digital cursive signature with timestamp.
- **Strict Appointee Expense Filtering**: Officials and referees can strictly only view, select, and claim expenses for fixtures to which they have personally been appointed.
- **Profile Street Address Management**: Added full street address editing in `👤 My Profile` (`profile-address`) that automatically synchronizes with official expense forms.
- **Application Footer & Interactive Changelog**: Added accessible website footer with quick links to Privacy, Terms, Safeguarding policy, and an interactive popup Changelog modal.

### Fixed
- **Authentication State Persistence Across Page Reloads**: Resolved issue where refreshing (`CMD+R` / `F5`) reset visitors back to the login gate; sessions now cleanly restore `localStorage` user ID, token, and role portal view.
- **Role Isolation for Non-Assignors**: Strictly hidden the `Switch Persona` dropdown for non-assignor accounts so referees and club representatives only ever see their own appointments and credentials.
- **LiteSpeed CGI Raw Stream Delivery**: Updated `api.cgi` to support streaming raw `text/calendar` (`.ics`) and `text/csv` (`.csv`) responses alongside JSON.

---

## [1.8.0] — 2026-11-02

### Added
- **Progressive Web App (PWA)**: Added `manifest.json` with standalone display, brand colors (`#f97316` and `#0b0f19`), and Basketball England roundel app icon.
- **Offline Service Worker (`service-worker.js`)**: Implemented service worker caching core shell assets (CSS, JS, Leaflet maps, icons) and offering network-first fallback for court-side sports halls with intermittent connectivity.
- **Mobile Bottom Navigation Bar**: Sticky touch-friendly bottom navigation bar (`Hub`, `Fixtures`, `Expenses`, `Profile`) for iOS and Android viewports (<= 768px).

---

## [1.7.0] — 2026-11-02

### Added
- **Live Subscribed Calendar Sync Feed (`webcal://`)**:
  - Dynamic `GET /api/calendar/feed/{official_id}.ics` endpoint providing RFC 5545 iCalendar feeds.
  - 1-click **Add to Apple Calendar** (`webcal://`) and **Add to Google Calendar** (`https://calendar.google.com/calendar/render?cid=...`) buttons in the Official Hub.
  - Automatic synchronization when appointments are accepted, updated, or tip-off times change.

---

## [1.6.0] — 2026-11-02

### Added
- **Interactive Availability Heatmap & Scheduler Matrix**:
  - Live matrix view under Assignor Workbench mapping all registered officials against upcoming competition game dates.
  - Color-coded availability chips: 🟢 Available, 🏀 Appointed Fixture, 🔴 Unavailable, ⚪ Open.
  - Real-time tooltips displaying game matchups, tip-off times, and declared unavailability reasons.

---

## [1.5.0] — 2026-11-02

### Added
- **Consolidated Weekend BACS Payment Batch CSV Export**:
  - Implemented `GET /api/export/bacs.csv` generating standard UK BACS payment files compatible with Barclays, Lloyds, NatWest, HSBC, Santander, and Metro Bank.
  - Columns: `ClaimId`, `BeneficiaryName`, `BELicenceNumber`, `OriginPostcode`, `FixtureCode`, `Matchup`, `Position`, `MatchFeeGBP`, `RoundTripMiles`, `HMRCMileageGBP`, `ParkingTollsGBP`, `TotalPayableGBP`, `ClaimStatus`, `BACSPaymentReference`.
- **Club Officiating Fee Recharge Ledger**:
  - Club recharge summaries calculating total fixture officiating costs and travel allowances owed by each home club.

---

## [1.4.0] — 2026-11-01

### Added
- **Interactive Leaflet.js 1.9.4 Arena Mapping & Directions**:
  - Local embedded Leaflet mapping engine (zero external CDN dependency) displaying exact arena court locations.
  - Direct 1-click links for **Google Maps Turn-by-Turn GPS Directions** and **Apple Maps**.
  - Venue travel distance estimates calculated from the official's home postcode.

---

## [1.3.0] — 2026-10-30

### Added
- **UK Safeguarding & Enhanced DBS Verification**:
  - Enhanced DBS certification tracking with status checks (`VERIFIED`, `EXPIRED`, `PENDING`) and expiry dates.
  - Mandatory DBS compliance enforcement blocking unverified officials from youth/junior (`U12`-`U18`) fixtures under UK safeguarding guidelines.
- **Emergency Slot Cover Workflow**:
  - One-click cover request broadcasting to certified and available officials when an official is injured or delayed.
  - Cover request acceptance and assignor review workflow.

---

## [1.2.0] — 2026-10-29

### Added
- **Dual Qualification Hierarchy**:
  - Floor Referee Qualifications: `Level 1`, `Level 2`, `Level 3`, `Level 4`, `Level 5 FIBA`.
  - Table Official Qualifications: `Table Level 1`, `Table Level 2`, `Table Level 3`, `Table Level 4`, `FIBA Table / Statistician`.
- **Custom Crew & Table Templates**:
  - Assignor-customisable crew configurations: 1PO Solo Referee, 2PO, 3PO, Table Scorer, Timekeeper, 24s Shot Clock, Commissioner, and custom slots.
  - Match-by-match slot override capabilities with custom floor/table match fees (£ GBP).
- **Printable Match Officiating Crew Sheet**:
  - Formatted printable A4 match appointment sheets with crew contacts and venue details.

---

## [1.1.0] — 2026-10-28

### Added
- **Three-Tier Multi-Role Workspaces**:
  - **Assignor Workbench**: Game dashboard grid, urgency badges (`CRITICAL_UNASSIGNED`, `DECLINED_REPLACEMENT_NEEDED`, `PARTIALLY_ASSIGNED`), drag-and-drop appointments, and automated suggestion drawer.
  - **Official Hub**: Appointment acceptance/decline with reason logging, personal availability calendar, and declared club affiliation conflicts.
  - **Club & League Secretary Portal**: Fixture submission, CSV tournament slate bulk import, and appointed crew tracking.
- **Bulk Import & Export**: Comprehensive CSV and JSON import/export for fixtures and appointments.

---

## [1.0.0] — 2026-10-27

### Added
- **Initial Core Platform Architecture**:
  - RESTful JSON API server and SQLite database repository (`DatabaseRepository`).
  - Production PostgreSQL schema (`db/schema.postgres.sql`) with GiST indexes.
  - Modular domain conflict engine (`ConflictDetectionEngine`) detecting:
    - Double-booking overlap (`[start, end)` time intervals).
    - 60-minute inter-venue travel buffer enforcement.
    - Declared team and club affiliation conflicts (coach, player, parent).
    - Minimum certification grade constraints.
    - Explicit availability vs. unavailability windows.
  - Automated unit and integration test suite (`tests/test_system.py`).
