Commit graph

27 commits

Author SHA1 Message Date
f8eef909d2 Added handling for stale trains
- Renamed TrainLateness to LateTrain
2026-08-24 22:53:15 -04:00
e0077ec13b Centralize lateness logic
- I finally put the app in the Travel category. xD
- I also moved the train lateness and arrival calculations into AmtrakDateFormatting from ContentView. I also renamed the timezone formatting parameters for clarity.
2026-08-24 21:05:11 -04:00
79176585b4 Improve train status formatting
This change adds proper singular/plural labels for minutes and hours in the lateness display, fixes green status text contrast for dark mode, and updates the README to credit the Amtrak.js models used as a base.
2026-08-24 20:07:11 -04:00
bf420b7480 Time column accounts for destination's time zone 2026-08-24 05:51:47 -04:00
e1c39aa457 Added station presence column and bumped up version
- Added a StationStatus "presence" property to TrainStatusRow and display it as a new (unnamed) TableColumn in ContentView (using presence.rawValue).
- Populated presence from leg?.status.
- Bumped app version to 0.2.103 in Bundler.toml and add a 0.2.103 entry to changelog noting the new column.
2026-08-24 04:40:33 -04:00
a43eefadc1 Show local station time; reuse date formatter
- Added localTime(timeZone:) and updateTime(timeZone:) to AmtrakDateFormatting to format the current time for a given timezone.
- In ContentView, make AmtrakDateFormatting is now a shared property with localTimeZone being used at the bottom to show "It is <time> at <station> station".
- trainStatus now saves the station name and timezone (avoiding repeated formatter instantiation) and isOnTime uses the shared formatter.
2026-08-24 03:09:49 -04:00
791f261fc7 Brought back current station 2026-08-24 01:24:50 -04:00
dd50d7cd4a Add timezone-aware station lookup and formatting
These changes ensure displayed times respect the station's timezone. Something I mistakenly overlooked when creating this.

Luckily, my screenshot with Ashland isn't affected by this change.
2026-08-24 01:00:47 -04:00
4ae8be2e69 Fixed a slight oversight in TrainLateness's formatter 2026-08-23 21:59:03 -04:00
921e23424f Woops! Fixed to and from's values 2026-08-23 21:52:08 -04:00
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