Commit Graph

244 Commits

Author SHA1 Message Date
Trey t
b89c0d58e2 feat(sync): update CanonicalSyncService to use delta sync
- syncStadiums now passes lastSync to CloudKit fetch
- syncTeams simplified to single CloudKit call (not per-sport loop)
- syncGames removes 6-month date range, uses modificationDate delta

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 10:49:53 -06:00
Trey t
3bb903ab09 feat(sync): update CloudKit sync methods to use modificationDate delta
- fetchStadiumsForSync now accepts since: Date? parameter
- fetchTeamsForSync changed from per-sport to all teams with delta sync
- fetchGamesForSync uses modificationDate instead of game dateTime

When lastSync is nil, fetches all records (first sync).
When lastSync has value, fetches only modified records (delta sync).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 10:48:34 -06:00
Trey t
b514d2119c docs: add delta sync implementation plan
16-task TDD implementation plan for:
- CloudKit delta sync using modificationDate
- Remove 90-day game browsing limit
- Rename fetch* to filter* for clarity
- Add allGames/allRichGames methods

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 10:44:42 -06:00
Trey t
ffe5c0b6f7 docs: add delta sync and game browsing design
Addresses issue where Houston Astros only shows 7 games in "By Games" mode.
Documents plan to remove arbitrary date restrictions and implement proper
delta sync using CloudKit modificationDate.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 10:41:17 -06:00
Trey t
1703ca5b0f refactor: change domain model IDs from UUID to String canonical IDs
This refactor fixes the achievement system by using stable canonical string
IDs (e.g., "stadium_mlb_fenway_park") instead of random UUIDs. This ensures
stadium mappings for achievements are consistent across app launches and
CloudKit sync operations.

Changes:
- Stadium, Team, Game: id property changed from UUID to String
- Trip, TripStop, TripPreferences: updated to use String IDs for games/stadiums
- CKModels: removed UUID parsing, use canonical IDs directly
- AchievementEngine: now matches against canonical stadium IDs
- All test files updated to use String IDs instead of UUID()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 09:24:33 -06:00
Trey t
4b2cacaeba docs: add canonical ID refactor design
Design to eliminate UUID layer and use canonical IDs as the single
stadium/team/game identifier throughout the client. Key changes:
- Domain models use String IDs (canonical IDs)
- Remove UUID mapping dictionaries from DataProvider
- Simplify AchievementEngine (delete resolution helper)
- StadiumVisit uses single stadiumId field

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 22:56:37 -06:00
Trey t
5c13650742 fix: resolve specificStadium achievement ID mismatch
The Green Monster (Fenway) and Ivy League (Wrigley) achievements
weren't working because:
1. Symbolic IDs use lowercase sport (stadium_mlb_bos)
2. Sport enum uses uppercase raw values (MLB)
3. Visits store stadium UUIDs, not symbolic IDs

Added resolveSymbolicStadiumId() helper that:
- Uppercases the sport string before Sport(rawValue:)
- Looks up team by abbreviation and sport
- Returns the team's stadiumId as UUID string

Also fixed:
- getStadiumIdsForLeague returns UUID strings (not symbolic IDs)
- AchievementProgress.isEarned computed from progress OR stored record
- getStadiumIdsForDivision queries CanonicalTeam properly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 22:22:29 -06:00
Trey t
dcd5edb229 feat: add sliding window trip generation for By Games mode
Adds a trip duration stepper (2-21 days) to the By Games planning mode.
When users select specific games, the planner now generates ALL possible
N-day windows containing those games (e.g., 7-day trips starting on
different days), finding additional games in each window to maximize
route options.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 19:19:46 -06:00
Trey t
3f80a16201 fix: preserve LocationSearchSheet coordinates in By Route mode
The resolveLocations() function was overwriting valid LocationInput
objects (with coordinates) from LocationSearchSheet. Now it only
resolves locations that don't already have coordinates.

Added debug logging to trace scenario selection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 18:59:44 -06:00
Trey t
1967eecd52 fix: use LocationSearchSheet for Start/End Location fields
Replaces inline text fields with buttons that open LocationSearchSheet,
matching the must-stop location picker UI for consistency.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 18:50:19 -06:00
Trey t
81095a8170 fix: resolve 4 UI/planning bugs from issue tracker
- Lock all maps to North America (no pan/zoom) in ProgressMapView and TripDetailView
- Sort saved trips by most cities (stops count)
- Filter cross-country trips to top 2 by stops on home screen
- Use LocationSearchSheet for Follow Team home location (consistent with must-stop)
- Initialize DateRangePicker to show selected dates on appear

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 18:46:40 -06:00
Trey t
c2f52aaccc docs: add bug fixes design for 12 planning and UI issues
Covers:
- Planning mode bugs (follow team location, must-stop filtering, date range)
- UI improvements (sort options, map locking, today highlight)
- Coast-to-coast filter to show top 2 by stops

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 17:55:08 -06:00
Trey t
b4ac1f7c24 refactor: redesign planning mode picker as 2x2 card grid
Replace crowded segmented control with clean card-based grid.
Each card shows icon and label with selected state highlight.
Fixes text truncation issue with "Follow Team" option.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 12:48:58 -06:00
Trey t
f7faec01b1 feat: add Follow Team Mode (Scenario D) for road trip planning
Adds a new planning mode that lets users follow a team's schedule
(home + away games) and builds multi-city routes accordingly.

Key changes:
- New ScenarioDPlanner with team filtering and route generation
- Team picker UI with sport grouping and search
- Fix TravelEstimator 5-day limit (was 2-day) for cross-country routes
- Fix DateInterval end boundary to include games on last day
- Comprehensive test suite covering edge cases:
  - Multi-city routes with adequate/insufficient time
  - Optimal game selection per city for feasibility
  - 5-day driving segment limits
  - Multiple driver scenarios

Enables trips like Houston → Chicago → Anaheim following the Astros.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 12:42:43 -06:00
Trey t
e7fb3cfbbe docs: add WCAG 2.1 AA accessibility design
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 11:14:40 -06:00
Trey t
5d1e9a3f48 feat: add privacy policy and terms of service
- Add HTML files for hosting at 88oakapps.com/privacy and /terms
- Update SettingsView links to use 88oakapps.com domain
- Plain English, minimal legal documents for freemium app

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 11:00:03 -06:00
Trey t
769342addc docs: add privacy policy and terms of service design
Plain English privacy policy and ToS for freemium iOS app.
Key decisions: 13+ age requirement, no accounts, CloudKit
analytics, Texas jurisdiction.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 10:55:34 -06:00
Trey t
475f444288 refactor: extract reusable SportSelectorGrid component
Create unified sport selector grid used across Home (Quick Start),
Trip Creation, and Progress views. Removes duplicate button implementations
and ensures consistent grid layout with centered bottom row.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 10:38:10 -06:00
Trey t
a292b5c20c fix: center Quick Start bottom row with consistent button sizing
Use GeometryReader to calculate button width as 1/4 of available space,
ensuring all buttons have the same size. Bottom row (MLS, WNBA, NWSL)
is now centered with WNBA in the middle.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 10:29:14 -06:00
Trey t
2d48f1411a feat: implement Dynamic Type with Apple text styles
Replace all custom Theme.FontSize values and hardcoded font sizes with
Apple's built-in text styles (.largeTitle, .title2, .headline, .body,
.subheadline, .caption, .caption2) to support accessibility scaling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 10:23:16 -06:00
Trey t
8affa3ce0d docs: add Dynamic Type implementation design
Replace all custom font sizes with Apple's built-in text styles
for accessibility compliance. Remove Theme.FontSize enum entirely.
Export files keep fixed sizes for consistent PDF output.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 10:04:13 -06:00
Trey t
3aef39adba docs: add Follow Team mode design
New 4th planning mode for fans to build trips around their team's
schedule (home + away games). Includes region/date filtering,
flexible start/end location, and repeat city handling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 09:56:13 -06:00
Trey t
5fba9e6052 docs: add localization design
String Catalogs + AI translation pipeline for 5 languages:
Spanish, French, German, Japanese, Chinese (Simplified)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 01:55:42 -06:00
Trey t
c9e5bd9909 chore: remove college basketball (CBB) from iOS app
Remove CBB (~5,000+ games per season) to reduce complexity.

Changes:
- Remove .cbb enum case from Sport
- Remove CBB theme color (cbbMint)
- Update documentation to reflect 7 supported leagues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 01:44:35 -06:00
Trey t
171221af0e docs: add project README
- Project overview and features
- Supported leagues (8 sports)
- Installation and setup instructions
- Project structure and architecture
- Development commands
- Test suite summary

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 01:22:03 -06:00
Trey t
5ad20f797e chore: update project docs and clean up obsolete files
- Add parser output directories to .gitignore
- Update PROJECT_STATE.md with completed tasks and new checkpoint
- Clean up TO-DOS.md (remove completed items)
- Delete obsolete sample screenshots

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 01:20:15 -06:00
Trey t
55c6d6e5e8 feat(planning): add trip filtering and fix departure date logic
- Add Trip.status property for status tracking
- Add RouteFilters trip list methods (filterBySport, filterByDateRange, filterByStatus, applyFilters)
- Add TravelEstimator max driving hours validation
- Fix ScenarioA/B departureDate to use last game day (not day after)
- Update GameDAGRouter comments for buffer logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 01:18:52 -06:00
Trey t
1bd248c255 test(planning): complete test suite with Phase 11 edge cases
Implement comprehensive test infrastructure and all 124 tests across 11 phases:

- Phase 0: Test infrastructure (fixtures, mocks, helpers)
- Phases 1-10: Core planning engine tests (previously implemented)
- Phase 11: Edge case omnibus (11 new tests)
  - Data edge cases: nil stadiums, malformed dates, invalid coordinates
  - Boundary conditions: driving limits, radius boundaries
  - Time zone cases: cross-timezone games, DST transitions

Reorganize test structure under Planning/ directory with proper organization.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 01:14:40 -06:00
Trey t
eeaf900e5a feat(scripts): rewrite parser as modular Python CLI
Replace monolithic scraping scripts with sportstime_parser package:

- Multi-source scrapers with automatic fallback for 7 sports
- Canonical ID generation for games, teams, and stadiums
- Fuzzy matching with configurable thresholds for name resolution
- CloudKit Web Services uploader with JWT auth, diff-based updates
- Resumable uploads with checkpoint state persistence
- Validation reports with manual review items and suggested matches
- Comprehensive test suite (249 tests)

CLI: sportstime-parser scrape|validate|upload|status|retry|clear

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 21:06:12 -06:00
Trey t
284a10d9e1 feat(ui): add interactive MapKit region picker
Replace abstract colored rectangles with actual North America map
using MapKit. Regions now follow state borders with tappable
overlays for West/Central/East selection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 18:18:10 -06:00
Trey t
1a835d369a remove gsd 2026-01-10 17:54:31 -06:00
Trey t
12a219d826 fix(trip): remove buffer days from trip planner
Buffer days added no value to trip planning. Itineraries now show
only game days and necessary travel days without extra padding.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:47:34 -06:00
Trey t
e8e47e0e2e fix(theme): remove blue hue from monochrome dark mode
Replace Tailwind CSS gray palette colors (which have blue tint) with
pure grayscale values (R=G=B) for the monochrome theme.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:44:33 -06:00
Trey t
5ed4e309bd feat(schedule): group games by sport instead of date
Games in schedule view now display in sport sections (MLB, NBA, etc.)
with games sorted by date within each section. Each game row shows its
date since the section header now shows sport instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:36:22 -06:00
Trey t
6db0bdefcd fix(trip): redesign By Games mode with hierarchical calendar picker
Replace navigation-based team→games flow with expandable Sport→Team→Date
hierarchy. Games now grouped by date under each team with inline selection.
Also fixed game loading to always fetch 90-day browsing window.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:31:16 -06:00
Trey t
44952140c8 everything is broke, gsd is ass 2026-01-10 16:20:13 -06:00
Trey t
a863a9987f docs(9.1): create phase plan
Phase 9.1: Fix Flaky Test When Ran In Parallel
- 1 plan created
- 2 tasks defined
- Ready for execution

Fixes 5 tests that fail in parallel but pass individually
2026-01-10 15:52:16 -06:00
Trey t
ad4cecf47a docs(09.1): create phase plan
Phase 09.1: Fix Flaky Test When Ran In Parallel
- 1 plan created
- 2 total tasks defined
- Ready for execution

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 15:46:30 -06:00
Trey t
1d7a7d9cbe docs(09-03): complete scenario C corridor efficiency TDD plan
Phase 9 complete: All three trip planner modes validated with TDD.

Summary of 09-03 accomplishments:
- Feature 1: Corridor game inclusion (5 tests, 1 fix)
  - Enhanced findDirectionalStadiums() to exclude beyond-endpoint games
- Feature 2: Anti-backtracking validation (7 tests, all passed)
  - Confirmed existing implementation validates monotonic progress

12 tests added, 3 commits (2 test, 1 feat).

State updates:
- Progress: 30% → 40%
- Phase 9: Complete (3/3 plans)
- Next: Phase 10 (Trip Builder Options TDD)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 15:43:23 -06:00
Trey t
b6f11a46dc test(09-03): add anti-backtracking validation tests
Added 7 TDD tests for Feature 2 (geographic efficiency / anti-backtracking):
- Route must start at specified start city
- Route must end at specified end city
- Intermediate games in wrong order rejected or reordered
- Multiple route options - least backtracking preferred
- Minor backtracking within tolerance is acceptable
- Excessive backtracking beyond destination rejected
- Correct directional classification for north-to-south route

All tests pass - existing ScenarioCPlanner implementation already
validates monotonic progress and prevents excessive backtracking.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 15:42:08 -06:00
Trey t
fd4c4b6e2a feat(09-03): exclude stadiums beyond end point in corridor filtering
Enhanced findDirectionalStadiums() to prevent including games at
stadiums that are beyond the destination city.

Previous behavior: Included stadiums like Seattle when planning
LA→Portland trips because Seattle was "making progress toward Portland"
(closer to Portland than LA is).

New behavior: Excludes stadiums where distance from start exceeds
the direct start→end distance (with 15% tolerance).

Example: LA→Portland trip now correctly excludes Seattle games
(Seattle is 1000mi from LA, Portland is 850mi from LA).

Fixes test: corridor_MultipleGamesMixed_FiltersCorrectly()

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 15:28:29 -06:00
Trey t
31d1163953 test(09-03): add travel corridor game inclusion tests
Added 5 TDD tests for Feature 1 (travel corridor game inclusion):
- Direct route with games along path includes all corridor games
- Game slightly off corridor within tolerance included
- Game far from corridor excluded
- Multiple games mixed filters correctly (excludes south/beyond-end games)
- No games along corridor returns empty route or failure

Tests validate that Scenario C planning correctly:
- Includes games within ~50-100 miles of direct travel corridor
- Excludes games in wrong direction (south when traveling north)
- Excludes games beyond the destination city

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 15:28:19 -06:00
Trey t
ceb001885e docs(09-02): complete scenario B filler conflict TDD plan 2026-01-10 15:05:05 -06:00
Trey t
57d42ef835 test(09-02): add filler conflict and impossible combination tests
- Feature 1: Filler game timing conflict prevention (4 tests)
  - Filler between anchors included when feasible
  - Same-day filler excluded
  - Backtracking filler excluded/reordered
  - Multiple fillers only feasible included

- Feature 2: Impossible geographic combinations (5 tests)
  - Must-see games too far apart fail
  - Reverse chronological order fail
  - Triangle routing validation
  - Driving limit validation
  - Feasible combination sanity check

All tests pass individually, validating correct behavior.
Note: 2 tests exhibit pre-existing flakiness in full suite.
2026-01-10 15:03:31 -06:00
Trey t
23694b558a docs(09-01): complete scenario A timezone & conflict TDD plan
Summary:
- Feature 1: Timezone boundary handling (4 tests, all passing)
- Feature 2: Same-day conflict detection (4 tests, all passing individually)
- Dynamic time buffers enable realistic doubleheaders

Commits:
- 9ec2a06: timezone boundary tests
- 1c20d54: same-day conflict tests
- 6e4a54e: dynamic time buffer implementation

Discovered: Pre-existing test flakiness (3 tests fail in full suite, pass individually)
2026-01-10 13:27:22 -06:00
Trey t
6e4a54e6dd feat(09-01): add dynamic time buffers for same-day game transitions
Implements conditional time buffer logic in canTransition():
- Same-day games (doubleheaders): 2hr post-game, 0.5hr pre-game
- Multi-day games: 3hr post-game, 1hr pre-game

Enables feasible same-day combinations (LA→SD) while preventing
infeasible distant pairings (LA→SF same day).

Makes tests pass:
- plan_SameDayGamesCloseCities_BothIncluded
- plan_ThreeSameDayGames_PicksFeasibleCombinations
2026-01-10 12:57:33 -06:00
Trey t
1c20d54b8b test(09-01): add same-day multi-city conflict detection tests
- Tests same-day games in close cities (both included - FAILING)
- Tests same-day games in distant cities (only one per route - PASSING)
- Tests same-day games on opposite coasts (only one per route - PASSING)
- Tests three same-day games (picks feasible combinations - FAILING)

2 of 4 tests failing - need to implement feasible same-day game logic.
2026-01-10 12:53:15 -06:00
Trey t
9ec2a06b7a test(09-01): add timezone boundary tests for date range filtering
- Tests game at range start in different timezone (included)
- Tests game before range start in different timezone (excluded)
- Tests game at range end in different timezone (included)
- Tests game after range end in different timezone (excluded)

All tests pass - DateInterval.contains() correctly handles timezone boundaries.
2026-01-10 12:48:26 -06:00
Trey t
72a846e75b docs(state): update to Phase 9 planned status
Phase 9 (Trip Planner Modes TDD) planned with 3 execution-ready plans
2026-01-10 12:43:45 -06:00
Trey t
0f2cf9e4af docs(09): create phase 9 plans - Trip Planner Modes TDD
Phase 09: Trip Planner Modes TDD
- 3 plans created (09-01, 09-02, 09-03)
- 29 total tests planned across all scenarios
- TDD approach: Write tests first, fix code if tests fail

Plan 09-01: Scenario A Timezone & Conflict TDD (8 tests)
- Feature 1: Timezone boundary handling for date range (4 tests)
- Feature 2: Same-day multi-city conflict detection (4 tests)

Plan 09-02: Scenario B Filler Conflict TDD (9 tests)
- Feature 1: Filler game timing conflict prevention (4 tests)
- Feature 2: Impossible geographic combination detection (5 tests)

Plan 09-03: Scenario C Corridor Efficiency TDD (12 tests)
- Feature 1: Travel corridor game inclusion (5 tests)
- Feature 2: Geographic efficiency validation / anti-backtracking (7 tests)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 12:43:22 -06:00