carlok — zsh — 88×30

cat _posts/2026-10-23-pickmydegree-a-catalogue-that-rebuilds-itself-from-the-universities-own-data-a-game-and-accessibility-pass-and-a-deploy-on-every-push.md

pickmydegree: a catalogue that rebuilds itself from the universities' own data, a game and accessibility pass, and a deploy on every push

pickmydegree — the degree chooser that narrows a university choice through tournament-style pairwise comparisons — grew the thing it had been missing: a catalogue that can be rebuilt instead of hand-edited. catalog/ is a separate subproject, outside the Vite build and the Docker image, whose catalog.py uses only the standard library to fetch PoliTo’s open-data CSV and course pages, UniTo’s paginated course listing (with a five-second crawl delay) and the MUR Offerta formativa file as a cross-check, merge them into out/courses.json, and diff the result against src/data/degrees.json through mapping.json; only enrich --write touches the site’s data, and only the university and url fields (6d6f459). The first refresh is for 2026/27: 100 cards gain a university and a course URL (76 UniTo, 24 PoliTo), one new card arrives — Economics and Finance with Data Science — the welcome text moves to 2026-27, and nothing is deleted: deg-033, deg-017 and deg-028 are flagged in out/TODO-possibly-discontinued.md for a decision rather than dropped.

The game pass (e7272d8) is mostly about the ways a bracket can be clicked wrongly: a pick with no live match, or with an id outside it, is ignored, so a double tap can no longer choose from the next unseen match or throw after the final one; a short lock swallows a second tap on the next pair; undo restores only phase-one removals; saves now hold ids and a schema version instead of whole degree records, dropping ids that have left the data and resetting a save it cannot use. Sound and storage no longer throw when localStorage or AudioContext is blocked, the phase-two countdown pauses while a description is open or the tab is hidden, and a real bug went with it — the hidden.bs.modal handlers were attached by hand and never fired, because Vue read .bs and .modal as event modifiers, so modal state was never reset. On the interface side the pick cards, category chips and ? are real, non-nested buttons with 44px touch targets, the progress bar, timer and round changes carry ARIA, contrast is fixed for the primary, info, danger and outline-primary text, prefers-reduced-motion is honoured and hover only where hover exists; the results screen names runner-up and semi-final losers and links their course pages, with html2canvas and confetti loaded lazily and the interface chrome kept out of the saved image. There are 175 tests, including degrees.json integrity and locale-key parity.

Build and delivery were addressed in the same batch (b4ab48d): everything aligns on Node 22, nginx gets gzip, a one-year cache for hashed assets and no-cache for index.html, security headers, a pinned tag and a HEALTHCHECK; a Vite plugin splits degrees.json into a light core list and per-language text chunks; HelloWorld.vue, style.css, a stale degrees.old.json and committed __pycache__ are gone. Deployment left the laptop: PR #8 adds a GitHub Actions workflow that tests, builds and deploys to Surge on every push to main and on workflow_dispatch, sets APP_VERSION from the git commit count and skips the deploy with a clear message when SURGE_TOKEN is unset (bec1a8f); a follow-up then stopped ci.yml running on main, where deploy.yml already tests and builds (ede45ec). Dependabot moved vite to 7.3.7 (#6) and vitest to 4.1.12 (#7).