Every app on krburchel.github.io shares one cache store, so clearing every
unknown cache wiped the other apps' offline files on each update.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The stadium photo credit was nowrap, so its full width set the inning
card's minimum and left the bases card ~90-120px (and pushed the row past
the column between 901-1150px). Let the inning and bases cards shrink,
stack the caption, and let the credit wrap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Show the step in the sequence on each selected fielder: the primary fielder
gets a "1" badge (when a chain exists) and each Thrown-to fielder gets 2, 3,
… so a 4-6-3 reads 4(1) 6(2) 3(3) before recording. The badge uses --blue on
--surface so it stays legible in both themes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The "Thrown to" selection in Outs & fielding is now an ordered chain instead
of a single fielder: tap each fielder in sequence (4, 6, 3) to record G4-6-3.
Applies to groundouts and fielder's choice, so DPs/TPs read as 4-6-3, 6-4-3,
5-4-3, etc. outState.throwTo becomes an ordered array; the sequence flows into
the batter cell, play log and record button, and old saves / undo snapshots
are normalized on load. Tests updated to the array form, plus a new G4-6-3
double-play regression test (82 tests).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove the "Keep the game." header over the scoring controls and the "The
scorecard" header over the grid; the columns start at their content. The
smaller "On the mound" / "Play by play" labels stay.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The name column had spare width, so bump the player name text (sc-pname
10->12px live, 13->14px on the Scorecard tab) and the position label
(sc-ppos 8->9px) for easier reading while scoring.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Once scoring starts, auto-hide the site header and the page heading (date /
title / auto-saves) so the collapsed board strip and the scoring workspace
lead. A "Show menu / Hide top" control in the view-tab row reveals them on
demand; Undo stays available via Ctrl/Cmd-Z or U. Auto by default (body
.game-focus set in renderWorkspace), session override via the control, resets
to automatic on reload. The control only shows during a game (has-plays).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The board now folds to the slim score strip automatically when the game has
plays (handled in renderWorkspace), so the scoring controls and scorecard
lead without scrolling. The Collapse / Show board control is a session
override; a reload returns to the automatic behavior. Drops the per-device
persistence from the manual-only version.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a "Collapse" control to the scoreboard's bottom bar that folds the board
to a slim strip (score + inning + a "Show board" expander), so the Live
scoring controls and scorecard lead instead of sitting below the board. Click
the strip or press Enter/Space to expand. State is remembered per device
(localStorage sb-board-collapsed) and restored on load; the collapsed summary
is filled by renderWorkspace. No automatic behavior, nothing else moved.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the separate top status band and fold its two labels onto the bottom
line with the inning: left = game status + inning/outs/bases, right = venue +
Follow MLB. Removes a whole row (and its divider/padding) so the scoreboard
is shorter. Same element ids, so the live updates are unchanged; dead
.board-topline rules removed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Second size pass: matchup score 36->32px, desktop badges 35->32px, content
padding 13->10px, topline 11->9px, bottom bar 9->8px. From the original the
board is score 43->32 and content padding 18->10 — a clearly shorter board.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Trim the scoreboard's height: smaller matchup score (43->36px) and team
badges, tighter content/topline/bottom padding, and less padding on
extra-wide screens, so the matchup and line score lead without pushing
scoring down the page.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a night-ballpark dark palette and a header control to pick Auto (follow
the device), Light, or Dark, remembered per device. Dark values live in both
@media (prefers-color-scheme:dark):root:not([data-theme=light]) and
:root[data-theme=dark] so the toggle wins in either direction, with
color-scheme:dark for native controls; a tiny <head> script applies a saved
choice before paint to avoid a flash. Tokenize the hardcoded light surfaces
(scorecard grid, tab bars, pitcher/lineup headers, setup tip, brand/footer)
so they flip, keep the deep-green scoreboard, and give the cream action
buttons dark fills. All introduced pairs clear WCAG AA.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wire the redesigned interface into the live page: index.html loads
css/scorebook.css and js/workspace.js and restructures into a matchup
scoreboard plus a four-tab workspace (Live scoring, Scorecard, Lineups,
Game notes), with the out dots now keyboard-operable buttons. workspace.js
handles view switching and the scoreboard, wrapping the existing render
functions — all scoring still runs on the current game model, so follow,
sync, saved games and backups are unchanged. sw.js (cache v10) precaches the
two new assets so it installs and runs offline; manifest renamed to
Scorebook with the ballpark palette. Adds tests/workspace.test.js.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The light-theme --out-color token was defined as var(--out-color) — a
self-reference, which is invalid, so .dot.out.on had no background and the
out dots never filled in while balls (green) and strikes (red) did. Dark mode
was unaffected because it redefines the token. Give it a real warm-grey value
so outs fill as they happen, and so the .t-out play-log text is readable.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brings css/scorebook.css under version control with the recent styling:
platform-universal font tokens (--font-serif / --font-sans, no Apple-only
Avenir Next) and background color on the two flat spots — the current-batter
bar gets the light ballpark-green tint, the scoreboard a subtle green
gradient for a lit-board look.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
At a half-inning boundary MLB's live feed can briefly leave the previous
half's runner on the new half's in-progress at-bat matchup. The follow/
catch-up code copied matchup.postOnFirst/Second/Third into G.bases without
checking the runner's team, so with the scorecard already flipped to the new
half, that runner stuck on base — e.g. a Rays batter showing on base during
a Guardians at-bat.
Add mlbOnBase(feed, runner, side), which drops any runner on the fielding
team before placing them on base (a runner not yet in the box score is kept,
so genuine new runners are never dropped), and use it at the three spots that
read MLB's postOn* runners. Regression test included.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A second line under the at-bat bar shows how the batter has hit in your other
saved games (cached until My Games changes; today's game is left out — its chips
already show it) and their career line against the pitcher on the mound, from
MLB's vsPlayer stats (once per matchup; roster entries now keep MLB ids).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
☰ Menu → Follow MLB live (or Check vs MLB) keeps the game caught up while
watching: every ~20 s it fetches MLB's small list of update times and downloads
the play-by-play only when it changed, adds plays the scorecard doesn't have
(same code as Catch up, one Undo step per batch), and moves the count of the
at-bat in progress forward only. Waits while a dialog or unfinished entry is
open, pauses in the background, stops at the final out, and runs on one device
(the game records which). Undo while following stops following so it sticks.
A header pill shows the state; tap to stop or take over.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Infield / Full field switch on the Bases card (remembered per device). Full
field draws the home team's park: the outfield wall and warning track for all
30 parks, MLB's posted distance signs where the wall measures them, the foul
lines to the poles, and the same tappable bases and runner tags as the infield.
Walls come from the stadium editor (js/fields.js, generated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Safari ignores CSS content:url() on images, so the dark-background logos never
showed there. Swap the image sources instead: logos are pointed at MLB's
dark-background versions as they appear (a MutationObserver), follow light/dark
changes, and switch back to the regular logos while printing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The box score's team names are the team pickers (tap the name to change
team), so the separate picker row is gone and the buttons move up.
- Pickers are sized to the chosen team, not the longest name.
- In dark mode every team logo uses MLB's dark-background version, so dark
logos like the Yankees' stay visible.
- Removed the old header-logo code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When MLB is mid at-bat on the same batter, a Current at-bat row offers MLB's
balls, strikes and fouls (and the pitcher's pitch count with them). Taking
MLB's pitching line for the pitcher on the mound brings the count along, so
the pitch count and the count dots always agree. Catch up also sets fouls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Catch up counts errors on runners (throwing errors and the like), not just
the batter's own E / CI, so tonight's three Yankees errors all count.
- Check vs MLB compares each team's errors with MLB's once caught up, and
Use MLB's fixes the total (repairs games caught up before these fixes).
- A passed ball is no longer charged as an error; runs scoring on it stay
unearned.
- Tests: tonight's ALDS Game 2 (saved mid-game) as a fixture; error checks for
every caught-up game; passed ball.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At 1300px and wider, scoring controls stay on the left and the scorecard,
pitchers and play log sit in a column on the right that stays in view while
scrolling. Phones, iPads and printing keep the single column.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CI · Catcher int. (Shift+C): batter awarded first, not an at-bat; forced
runners move up; an error on the fielding team; a run forced in gets an RBI
but is unearned, as is the batter's own run.
- The cell editor offers CI, and CI from Catch up / Check vs MLB now counts
as an error too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- My Games opens with a Postseason section: saved playoff games grouped by
year, round and teams, with the series score, a chip per game, and gaps
marked 'not scored'.
- The backup reminder no longer counts games whose saved version is already
in the cloud on a synced device; the menu hint says 'Backed up by sync'.
- Sync: a game's updatedAt only ever grows, so two edits queued in the same
millisecond while offline can't share a time and get the second rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- assets/postseason/nlds-2026.png (SportsLogos.net primary logo, trimmed
and resized to 450 px; transparent, no watermark), precached (cache
scorecard-v6). 2026 NLDS games show it with the game number in the
scorecard badge, PDF header and Share final image.
- Tests: 2026 NLDS uses the official logo; 2025 NLDS and 2026 ALCS keep the
league logo.
- Sync tests wait for the expected state instead of fixed pauses, and each
simulated device stops syncing and settles before it's closed (a timer
firing after close was reported as a failure when the suite ran in
parallel). 53 passing, stable across repeated runs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bug: syncPush stayed "busy" until every upload reached the server. Firestore
holds queued writes until it's back online, so one slow upload made every
later sync (including "Sync now") silently do nothing. Now "busy" only
covers the scan, each game tracks its own in-flight upload so it isn't
queued twice, and later changes still upload.
"Sync now" shows Syncing…, then "✓ Synced at 1:05 PM — 2 games uploaded"
(or "nothing new to upload", or that uploads are queued on a slow
connection). The panel shows games on this device vs. in the cloud and
refreshes when other devices' changes arrive.
Tests: Sync now feedback/counts; a stuck upload doesn't block later syncs
(fails on the previous code). 52 passing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fills in js/firebase-config.js for project baseball-scorecard-1b370 (public
web config). Checked from outside: Firestore exists and refuses reads
without sign-in; email/password sign-in is enabled; the bundled SDK loads
and reaches the project from the app (a made-up login gets "don't match").
The setup-state test now covers both configured and unconfigured.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- js/sync.js: email/password sign-in (☁ Sync in the menu), a status pill in
the header, and a sync engine that fingerprints each saved game and uploads
the changed ones a few seconds after scoring pauses (right away when a game
ends or the app is hidden), uploads deletions as { deleted: true }, and
applies other devices' changes from a live Firestore listener (including
the game open on screen). Newer version wins; the losing older version is
kept in My Games as a copy and left out of season stats.
- firestore.rules: owner-only access; updates must be newer than stored.
- Firebase compat SDK 12.19.0 bundled in js/vendor/firebase (Apache 2.0,
license included); loaded only on signed-in devices and cached on first use.
- js/firebase-config.js is null until the Firebase project exists, so sync
stays hidden and nothing extra loads.
- Tests: two simulated devices on an in-memory Firebase (7 cases incl.
offline queue and conflict copy); 50 passing. README updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Earned runs (rule 9.16): a batter who reaches on an error counts as the
out that should have been made; once real outs plus those reach three,
later runs in the half-inning are unearned. A reliever gets no benefit
from errors made before he entered. (Catch-up keeps MLB's own ER.)
- Plate appearances get ids (older games get them on load). The result
line in the play log points at its play: editing it offers "Edit play"
(opens the scorecard cell editor so stats follow), and deleting it asks
whether to remove the play from the scorecard and stats too (undoable).
Catch-up and "Add it" lines are linked as well; a hand "+ Out" now logs
its own result line.
- Tests: three earned-run cases (2 outs + error + HR = 0 ER; 1 out case;
reliever case) and three play-log cases. 43 passing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 2026 ALDS primary logo (from SportsLogos.net, trimmed and resized to
450 px; the dark variant was skipped because it carries a watermark and a
solid background) is bundled at assets/postseason/alds-2026.png and
precached (cache scorecard-v4). For ALDS games in 2026 the scorecard
badge, PDF header and Share final image show it with the game number;
other years and rounds keep the league-logo badge. POSTSEASON rounds can
carry an `official` logo per year for future additions.
Tests: 2026 ALDS badge uses the bundled logo and game number; other years
and rounds don't; every bundled logo exists and is in the offline cache.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- index.html (8.4k lines) becomes markup only; styles move to css/app.css
and the script to nine feature files in js/ (data, game, scoring,
render, scorecard, mlb, storage, reports, ui), loaded in order as plain
scripts sharing one global scope. Code is unchanged apart from moving
(checked character-for-character); a load-order check confirmed no code
that runs at load uses a later file.
- sw.js precaches the new files (cache scorecard-v3) and revalidates with
the server so a new page never runs with older cached scripts.
- Tests (npm test; node:test + jsdom, MLB fixtures, no network):
* all four ALDS Game 1s caught up from an empty scorecard: 0 Check vs MLB
differences, team RISP/LOB, score, every batter and pitcher line equal
to MLB's box score; a hand-scored start + mid-at-bat catch-up
* hand-scoring rules: strike three, ABS overturns, reaching on error,
double plays, outs on the bases, counts kept on runner outs, RISP,
innings pitched, inherited runners, Undo with log edits, cell editor,
loading older saved games
34 passing; GitHub Actions runs them on every push.
- README: what it does, running locally, code layout, tests, credits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ☰ Menu → 📊 Season stats: totals across every saved game plus the one in
progress. Filters: team, games I attended (new "I was at this game"
checkbox in Game info), game type. Batting (G AB R H 2B 3B HR RBI BB K SB
AVG OBP SLG, RISP H-AB), pitching (G IP H R ER BB K HR ERA WHIP pitches)
and a game list with W/L for the selected team and an Open button; team
record with runs scored/allowed; sortable columns; filters remembered.
Verified: across the four ALDS Game 1s every batter (81) and pitcher (37)
matches MLB's box scores.
- Check vs MLB: "Fill in RISP (N)" sets RISP from MLB on matching plays
that have none (never overriding yours); Use MLB's also sets it.
- Reaching on an error now counts as an at-bat (new roe counter), as in
official scoring, in the scorecard, PDF, share image and season stats.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every plate appearance records whether a runner was on 2nd or 3rd when it
ended (as MLB counts it, so a steal during the at-bat counts). Catch-up and
"Add it" derive it from MLB's play-by-play (previous play's runners plus
mid-at-bat moves; MLB's own menOnBase split describes the bases after the
play). Older plate appearances are "Not recorded" and can be set in the
cell editor's new "Runner on 2nd or 3rd" row.
Shown as a "With RISP" row on the scorecard (H-AB by inning, game total)
and as "With RISP: H-for-AB · Left on base: N" under each team's batting
totals in the PDF and the shared final image.
Verified against MLB's official Team RISP / Team LOB for all four ALDS
Game 1s (exact match, and 0 Check-vs-MLB differences after catch-up).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When MLB has plays the scorecard hasn't recorded, "Catch up (N)" in the
check panel adds them and moves the game forward from the last recorded
plate appearance: offensive/defensive substitutions into the right lineup
spot (pinch runners replace the runner on base), pitching changes, each
result with bases reached and out number, batter/pitcher/team stats and
RBI, runs credited to the runner and charged to MLB's responsible pitcher
(earned per MLB), steals and caught stealing, pitch counts and ball/strike
split, outs and runners on base, half-inning changes, then MLB's current
batter, pitcher and count; FINAL when the game is over. One undo step.
Tested on ALDS Game 1: catching up the whole game from an empty scorecard
leaves 0 differences (all 61 PAs, every pitching line incl. pitch counts,
runs by inning); a hand-scored start plus a mid-at-bat catch-up ends on the
right batter, pitcher, count and bases.
Pitcher rows are hidden while a catch-up is pending (they can't match yet).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Bases card held the infield, the stadium photo and the baserunning
buttons while the Inning and Count cards sat half empty. The stadium photo
moves under Outs in the Inning card, and the baserunning buttons (SB, CS,
OUT, WP, PB, BLK, E) with their pickers move under the ABS tally in the
Count card, labelled "Baserunning". Bases keeps the infield, + Run and Clear.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The plain CSS diamond becomes a to-scale infield (90 ft base paths, mound
at 60'6", 95 ft dirt arc) with runners on the bases and their name tags;
each base is a button (tap / Enter / Space) that adds or removes a runner.
Theme tokens for grass/dirt in light and dark.
- The OpenStreetMap street-map snippet becomes a photo of the home team's
ballpark: each park's lead photo from Wikipedia/Wikimedia Commons (all
freely licensed), credited with author and license, linking to the file.
The map tile helpers are removed; STADIUMS stays for venue auto-fill.
- The separate runner-name line is hidden (names are on the field).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
☰ Menu → 🖼 Share final draws the game as a PNG (2160px wide, always
light): postseason badge, date and venue; both teams' logos, names and
score with a FINAL / inning pill (loser greyed when final); the line
score; batting lines (AB R H RBI BB K, subs included, totals); and
pitching lines (IP H R ER BB K). Preview with Share… (iPad share sheet),
Save image, and Copy image where the clipboard supports it. MLB logos are
CORS-enabled so the canvas stays exportable; offline it draws without them.
Also: shortName keeps suffixes with the surname ("L. García Jr." instead
of "L. Jr."), which also fixes the at-bat bar and runner labels.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New OUT button next to SB/CS: pick the runner (skipped if only one), then
where he was put out — at a base ahead of him (thrown out advancing, e.g.
stretching a double) or at his own base (picked off / doubled off), with
optional fielders (9-6-5) for the log. The runner's scorecard cell gets
the out number and keeps its result, the pitcher gets the out, and the
batter at the plate keeps his turn and count.
Also: caught stealing no longer resets the batter's count (both use the
new addRunnerOut).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows like "You: K · MLB: K, out 1" looked identical because the
difference (a missing out number) was just absent from one side. Play rows
now highlight the differing parts, spell out missing ones ("no out
number", "didn't reach") and say "Differs: out number"; pitcher rows
highlight only the stats that differ.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
☰ Menu → ⚾ Check vs MLB fetches MLB's live feed and lists differences:
- Plays: each MLB plate appearance is translated to the app's notation
(F8, G6-3, ꓘ, E6, FC, SF…) and matched to scorecard cells per half-inning
by lineup spot (tolerates one missing/extra PA). Result, bases reached
and out number are compared (bases/outs only for half-innings both have
finished). Missing PAs can be added, extra ones removed.
- Pitchers: full lines (IP, H, R, ER, BB, K, HR, pitches-strikes) matched by
name; MLB pitchers not in the list can be added.
- Runs by inning for finished half-innings.
Each row: "Use MLB's" (one undo step; "Use MLB's for all" also one step) or
"Keep mine" (hidden until MLB's version changes). Fixes don't replay
runners/outs. Today's Games stores MLB's game id; other games are found by
teams + game date. Cell editor save/remove now share correctPa/removePa.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Games already in progress when per-pitcher outs/hits tracking shipped
were missing those early outs (e.g. 4.1 IP shown vs 5.1 official).
- Tap a pitcher's stat line to correct IP, H, R, ER, BB, K, HR (IP in
baseball notation, validated; ER can't exceed R). Logged and undoable.
- The pitcher panel warns when the staff's innings pitched differ from
the outs the team has actually recorded (skipped once the game is final).
- Fix: init() re-runs after Reset game and re-bound the lineup, pitcher
and fielder click handlers, so taps fired twice (one "Add pitcher" tap
added two). Each binds once now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>