24 Commits
Author SHA1 Message Date
Kevin BurchellandClaude Opus 5.5 ef113f2161 Scorebook: stop the photo caption squeezing the bases card
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>
2026-10-23 17:44:48 -07:00
Kevin BurchellandClaude Opus 4.8 f348d33192 Scoring: order-number badges on the fielder throw chain
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>
2026-10-19 19:32:23 -07:00
Kevin BurchellandClaude Opus 4.8 21d91c06db Scorebook: bold the scorecard player names
Set sc-pname to font-weight 700 so the names stand out in the grid.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-19 18:53:39 -07:00
Kevin BurchellandClaude Opus 4.8 1d5b78333a Scorebook: bump live scorecard names to 13px
Per the user, 12px still read a touch small; set sc-pname to 13px.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-19 18:52:24 -07:00
Kevin BurchellandClaude Opus 4.8 15b284ba09 Scorebook: larger player names in the scorecard grid
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>
2026-10-19 18:51:27 -07:00
Kevin BurchellandClaude Opus 4.8 5aef47c0d4 Scorebook: focus mode hides header + heading during a game
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>
2026-10-19 12:55:55 -07:00
Kevin BurchellandClaude Opus 4.8 8f650d18ef Scorebook: manual scoreboard collapse for scoring focus
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>
2026-10-19 12:17:25 -07:00
Kevin BurchellandClaude Opus 4.8 b4c4b86dc5 Scorebook: merge the scoreboard's top strip into the bottom line
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>
2026-10-19 12:04:48 -07:00
Kevin BurchellandClaude Opus 4.8 8d04d29339 Scorebook: trim the scoreboard a bit further
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>
2026-10-19 05:31:12 -07:00
Kevin BurchellandClaude Opus 4.8 21b24cd855 Scorebook: make the scoreboard more compact
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>
2026-10-19 05:26:03 -07:00
Kevin BurchellandClaude Opus 4.8 33a4f26527 Scorebook: dark theme and an Auto/Light/Dark toggle
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>
2026-10-18 16:45:13 -07:00
Kevin BurchellandClaude Opus 4.8 6762d5559c Fix outs not filling in light mode (circular --out-color)
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>
2026-10-18 16:25:19 -07:00
Kevin BurchellandClaude Opus 4.8 3517da0881 Add scorebook stylesheet: universal fonts, tinted batter + scoreboard
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>
2026-10-18 16:17:50 -07:00
Kevin BurchellandClaude Opus 5.5 c6459ed68d At-bat bar: the batter in your scorecards, and career vs this pitcher
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>
2026-10-08 14:20:59 -07:00
Kevin BurchellandClaude Opus 5.5 4e18ce3960 Full field view in the Bases card
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>
2026-10-06 12:36:19 -07:00
Kevin BurchellandClaude Opus 5.5 f448b7584b Scorecard tab: no white chip behind the logo in dark mode
The dark-background logos are light-colored, so the white chip on the selected
tab hid them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:15:47 -07:00
Kevin BurchellandClaude Opus 5.5 71c985690b Team pickers in the box score; dark-mode team logos
- 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>
2026-10-05 20:00:58 -07:00
Kevin BurchellandClaude Opus 5.5 02a8184627 Two-column layout on laptop and desktop screens
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>
2026-10-05 18:38:29 -07:00
Kevin BurchellandClaude Opus 5.5 56c44094e1 Postseason series view in My Games; synced games count as backed up
- 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>
2026-10-04 19:51:49 -07:00
Kevin BurchellandClaude Opus 5.5 2bf1bec49c Sync: a slow upload no longer blocks syncing; "Sync now" gives feedback
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>
2026-10-04 13:02:51 -07:00
Kevin BurchellandClaude Opus 5.5 91296a1e5c Sync across devices with Firebase (waiting on project config)
- 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>
2026-10-04 08:50:53 -07:00
Kevin BurchellandClaude Opus 5.5 54aaa10937 Earned runs by inning reconstruction; play-log lines linked to plays
- 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>
2026-10-04 08:19:50 -07:00
Kevin BurchellandClaude Opus 5.5 5925427369 Use the official 2026 ALDS logo in the postseason badge
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>
2026-10-04 08:13:39 -07:00
Kevin BurchellandClaude Opus 5.5 2d1a1b5dbb Split into feature files, add tests and a README
- 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>
2026-10-04 08:05:23 -07:00