aaffa3771c
Two-target restructure: shared sources (models, services, settings, extensions, team logos) move into Shared/, consumed by both the existing macOS menu bar app and a new iOS app. MainService no longer imports AppKit — platform code attaches via a MainServiceObserver protocol (MacObserverAdapter wires back to MenuManager / StatusItemManager / NotificationManager). iPhone app is a single SwiftUI page mirroring the macOS menu (playoff round + yesterday/today/tomorrow), with a gear-icon settings sheet (display option + IndieAbout for license/changelog). Persistent JSON snapshot in Application Support paints last-known data on cold launch; "Updated …" header escalates secondary → orange (>5min) → red (>30min) so staleness is visually unmistakable. Foreground polling, scenePhase refresh, and pull-to-refresh; no notifications on iOS in v1.
49 lines
2.4 KiB
Markdown
49 lines
2.4 KiB
Markdown
# IceGlass
|
|
|
|
NHL game situational awareness for macOS (menu bar) and iPhone (single-page app).
|
|
|
|
## Key Features
|
|
|
|
### macOS menu bar app
|
|
- NHL shield icon in the menu bar with game count
|
|
- Shows games from yesterday, today, and tomorrow grouped by date (configurable)
|
|
- Regular-season rows show league-wide game number (`#547 NYR @ WAS …`)
|
|
- During playoffs, a ROUND section lists every active series with its series score, next game-in-series number, and upcoming tip-off time
|
|
- Game format: `NYR @ WAS 0:2 (FINAL)` / `DAL @ TOR Today @ 7:30 PM`
|
|
- Click a game to open NHL GameCenter; option-click for NHL Videocast
|
|
- Goal scored notifications with scoring team logo
|
|
- Game start / game ended notifications
|
|
- Dynamic polling: 7s during live games, scales back when idle
|
|
- Display Options: choose which days to show (yesterday/today/tomorrow)
|
|
- Refresh Now (⌘R) for immediate updates
|
|
- Launch at Login support
|
|
- About window via IndieAbout
|
|
|
|
### iPhone app
|
|
- Single scrollable page mirroring the macOS menu's content
|
|
- "Updated …" header showing relative + absolute ET timestamps; turns orange after 5 min, red after 30 min
|
|
- Persistent JSON cache in Application Support so cold launches paint last-known data instantly
|
|
- Pull-to-refresh, plus auto-refresh on scene activation and foreground polling timer
|
|
- Settings sheet (gear, top-right): display option picker + IndieAbout (license + changelog)
|
|
- Tap a game to open NHL GameCenter; tap a series to open the NHL series page
|
|
|
|
## Building
|
|
|
|
Requires XcodeGen to generate the project:
|
|
|
|
```bash
|
|
xcodegen generate
|
|
xcodebuild -scheme IceGlass -configuration Debug build # macOS
|
|
xcodebuild -scheme IceGlass-iOS -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 17 Pro' build
|
|
```
|
|
|
|
## Architecture
|
|
|
|
Two targets sharing a common data layer (`Shared/`) and platform-specific UI:
|
|
|
|
- **Shared/** — `MainService`, `ApiService`, `AppSettings`, `NHLDataCache`, models, Date/Time/Logger helpers
|
|
- **IceGlass/** — macOS-only managers (MenuManager, StatusItemManager, NotificationManager, AboutWindow)
|
|
- **IceGlass-iOS/** — SwiftUI views, ScoreboardViewModel (`@Observable`)
|
|
|
|
`MainService` exposes a `MainServiceObserver` protocol; each platform installs its own adapter to bridge data updates into AppKit (macOS) or `@Observable` invalidation (iOS). Data is fetched from the NHL Web API (`api-web.nhle.com/v1/scoreboard/now`, `/standings/{date}`, `/playoff-bracket/{year}`).
|