Commit graph

17 commits

Author SHA1 Message Date
c74e6166bf Fix status text contrast on green rows
Green status rows used white text, which was difficult to read against the green background. This change selects a contrasting text color based on the status color so green rows use black text and other statuses keep white text for better legibility in the status table.
2026-08-23 21:46:15 -04:00
915d0ec2dc Train status is now coloured coded for your convenience
- Introduced TrainLateness enum to represent on-time, early, late (with minutes), and unknown states, including description text, color, and formatting logic.
- Replaced TrainStatusRow.status String with TrainLateness and update ContentView to render a colored status pill and to return TrainLateness from isOnTime.
2026-08-23 21:23:45 -04:00
3533e5d4b8 Train status now properly gives minutes (or hours) a train is early or late
- Convert AmtrakDateFormatting API from static to instance properties/methods and added parsedDate(from:) to return Date.
- Update time(from:) and date(from:) to instance methods. Improve isOnTime logic to compute actual vs scheduled differences (minutes/hours) and report early/late/on-time.
- Updated ContentView to create an AmtrakDateFormatting instance and use the new API. Remove the Train.serviceDate extension.
2026-08-23 20:32:33 -04:00
69fc10c6f2 Renamed Refresh button to Submit 2026-08-23 20:02:10 -04:00
bf67475107 Cleaned up and removed columns so it is what an actual Solari board would show
- This update adds ISO date/time helpers for Amtrak timestamps, refactors the train table to show arrival time, status, and track details, and tracks the current station context in the UI.
- It also hardens station status decoding with a safe fallback to Unknown and simplifies the row model to match the new display.
2026-08-23 19:52:27 -04:00
ebff2c9c32 Expand station and status models
Added richer station metadata and status handling to match the Amtrak API payload. This commit introduces new station fields for name, timezone, schedule/actual timings, platform, and status, along with extra train row properties for origin and arrival/departure details used by the UI.
2026-08-23 18:19:55 -04:00
6f8cca9dc9 Removed on time column for now
- Added origin and destination columns
2026-08-23 07:12:40 -04:00
0475e39760 Ideal width 2026-08-22 18:37:20 -04:00
789e697828 Added a few pre-selected stations
- Went with the popular Virtual Railfan ones first.
- Moved the error message to its own dedicated space so it doesn't pop up out of nowhere
- Fixed a few typos
2026-08-22 18:19:14 -04:00
adeada6496 Forgot to rename route column to "Route" 2026-08-22 17:55:32 -04:00
f20d49f075 Finished wiring up loadTrainStatus()
Did a little code formatting after that cause Xcode is weird
2026-08-22 17:49:41 -04:00
3eb2018a8e Use ContentView and add station input UI
- Replace the placeholder window content with ContentView and implement a basic station lookup UI.
- Added a station code TextField, Refresh button that triggers an async load, loading indicator, and error message display. Introduces a Table for TrainStatusRow with columns for number, route, on-time and platform.
- Started plumbing for row population (work in progress).
- Also tweaked window title and fixes station comment (Ashland).
2026-08-22 17:36:14 -04:00
f81ae23bb0 Setup fail safes for loadTrainStatus() 2026-08-22 16:58:28 -04:00
df5b326e30 WIP content view 2026-08-22 16:53:27 -04:00
b920f7aa8c Wrote most of the client functions 2026-08-22 16:49:54 -04:00
af3f658d99 WIP http client
Roughly based on the Amtraker node library so this and the models will eventually be spun off as one too
2026-08-22 16:39:39 -04:00
474bca2cc2 Restarted as SwiftCrossUI app with refreshed icons 2026-08-22 16:13:30 -04:00