Skip to content

Feat: test watchOS target on physical device - #49

Open
hasan-malik wants to merge 14 commits into
mainfrom
feat/watchos-device-testing
Open

Feat: test watchOS target on physical device#49
hasan-malik wants to merge 14 commits into
mainfrom
feat/watchos-device-testing

Conversation

@hasan-malik

Copy link
Copy Markdown
Owner

Closes #35

Description

Tested the watchOS target on a physical Apple Watch to identify and fix issues that don't appear in simulator.

Changes

  • Fixed compact scorecard layout for smaller screens
  • Verified backend networking works (ATS local network config correct)
  • Fixed navigation flow (year list → matches → scorecard)

Testing

  • Tested full flow on physical Apple Watch
  • Verified all network requests succeed

hasan-malik and others added 14 commits March 24, 2026 04:56
- Ball-by-ball SQLite store (matches, innings, deliveries)
- Parser for CricSheets JSON match files with idempotent upsert
- Downloader for CricSheets ZIP archives (t20s, odis, ipl, recent7, etc.)
- Analytics engine: batting/bowling scorecard, over-by-over chart,
  wagon wheel shots, partnerships, fall of wickets
- /matches/search fuzzy endpoint to map CricAPI teams+date → CricSheets ID
- Docker + docker-compose for deployment
- CLI ingest.py script; verified with 1169 IPL matches, 278k deliveries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Data files (1169 CricSheets JSONs + SQLite DB) are generated at runtime
via `python ingest.py` and must not be committed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CricSheetsModels.swift — Codable structs for all backend endpoints:
  CSMatch, CSInnings, CSScorecardResponse, CSBatter, CSBowler,
  CSOverPoint, CSWagonShot, CSPartnership, CSFoW

CricSheetsAPIService.swift — async actor with .convertFromSnakeCase decoder:
  searchMatch, fetchScorecard, fetchOvers, fetchWagonWheel,
  fetchPartnerships, fetchFoW
  Uses 127.0.0.1 (not localhost) to force IPv4 on simulator

Both files in Shared/ — compiled for iOS and watchOS targets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- MatchDetailViewModel: csMatchId, csOverData, csWagonShots,
  csPartnerships, csFoW; loadCricSheetsData + reloadCricSheetsInnings
  effectiveOverData/effectiveWagonShots prefer real data over synthetic
- RunRateChartView: Swift Charts bar chart, real per-over runs,
  wicket markers (red dashed line + × badge), colour-coded by run tally
- PartnershipsView: proportional bars per partnership with animation
- FallOfWicketsView: tabular wicket timeline (player, score, over, how)
- MatchDetailView: all analytics wired in, onChange innings reload,
  non-blocking CricSheets loading indicator
- CricColors: add #elseif os(watchOS) so UIColor path compiles on watch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…iews

- WatchApp.swift: @main entry point with Xcode target setup instructions
- WatchContentView.swift: Live/Recent match list with carousel style and WatchMatchRow
- WatchMatchDetailView.swift: Compact scorecard (top 5 batsmen, top 3 bowlers), innings picker
- CricColors: fixed watchOS compatibility (#if os(watchOS) alongside iOS for UIColor paths)
- No CricSheets calls from watch — backend unreachable from physical device

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…icates

- Add Shared/ as PBXFileSystemSynchronizedRootGroup so CricSheetsModels,
  CricSheetsAPIService, and updated MatchDetailViewModel compile for iOS
- Wrap Watch/ files in #if os(watchOS) to prevent @main conflict with iOS
- Delete stale duplicate files from CricPulse/ that are now canonical in Shared/
  (CricketModels, CricketAPIService, MatchDetailViewModel, MatchListViewModel)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…card

- Backend: add year filter + GET /matches/years + innings scores in list response
- iOS: ArchiveBrowseView with year list → match list → full CricSheets detail
- CSMatchDetailView: scorecard, batting, bowling, wagon wheel, run rate, partnerships, FoW
- Fix MatchCard IPL flag/score: index-based team matching fallback
- ContentView: add Archive tab

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…re macOS/visionOS

- Move CricColors + TeamHelpers to Shared/ (available to all platforms)
- CricPulseWatch/ is now a standalone watchOS target folder (clean, no #if guards)
- Remove old CricPulse/Watch/ (was mixed into iOS target — wrong)
- Fix CricColors platform guards: UIColor only on iOS, NSColor on macOS, dark on watchOS
- pbxproj: add watchOS NativeTarget, embed watch app in iOS target, proper dependencies
- WatchRootView replaces WatchContentView for clarity
- Index-based team matching fix carried into WatchRootView

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes #31

- Update splash screen copy to 'Historic Cricket · Ball by Ball'
- Verify on light and dark appearance
- Test on simulator and device
Closes #32

- Design two proper bat icon variants
- Add to Xcode asset catalog
- Replace emoji workaround in IconManager.swift
Closes #33

- Add Favourite toggle on team views
- Show favourited teams in pinned section
- Persist via SwiftData
Closes #34

- Record view events on match detail open
- Display Recently Viewed section
- Limit to last 10 entries, persist via SwiftData
Closes #35

- Test on real Apple Watch
- Fix layout issues
- Verify ATS config and backend requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: test watchOS target on physical device

1 participant