Add TFL train disruption alerts #5

Merged
chezu merged 3 commits from feat-tflalerts into main 2026-01-10 21:57:26 +00:00
Collaborator

Summary

  • Add TFL API integration to query Tube and Elizabeth Line status
  • Display train disruptions as feed cards that sync to Google Glass
  • Major disruptions (suspended, severe delays) appear as RIGHT_NOW spotlight cards
  • Minor delays appear as FYI background cards
  • Filter out planned closures - only show active real-time disruptions

Changes

  • New: TFLDataSource.swift - API client with 2-min cache, severity classification
  • Modified: Winner.swift - Add .transitAlert FeedItemType
  • Modified: HeuristicRanker.swift - Add base weight 0.85 for transit alerts
  • Modified: ContextOrchestrator.swift - Wire up async fetch in pipeline

Severity Mapping

Severity Description Bucket
1 Service Closed RIGHT_NOW
2 Suspended RIGHT_NOW
3 Part Suspended RIGHT_NOW
6 Severe Delays RIGHT_NOW
7-9 Minor Delays FYI
4, 5, 10 Closures/Good Service Filtered out

Test plan

  • Build and run in Xcode
  • Verify TFL alerts appear when there are active disruptions
  • Confirm planned closures are not shown
  • Test card dismissal works correctly

🤖 Generated with https://claude.com/claude-code

Summary - Add TFL API integration to query Tube and Elizabeth Line status - Display train disruptions as feed cards that sync to Google Glass - Major disruptions (suspended, severe delays) appear as RIGHT_NOW spotlight cards - Minor delays appear as FYI background cards - Filter out planned closures - only show active real-time disruptions Changes - New: TFLDataSource.swift - API client with 2-min cache, severity classification - Modified: Winner.swift - Add .transitAlert FeedItemType - Modified: HeuristicRanker.swift - Add base weight 0.85 for transit alerts - Modified: ContextOrchestrator.swift - Wire up async fetch in pipeline Severity Mapping | Severity | Description | Bucket | |----------|-----------------------|--------------| | 1 | Service Closed | RIGHT_NOW | | 2 | Suspended | RIGHT_NOW | | 3 | Part Suspended | RIGHT_NOW | | 6 | Severe Delays | RIGHT_NOW | | 7-9 | Minor Delays | FYI | | 4, 5, 10 | Closures/Good Service | Filtered out | Test plan - Build and run in Xcode - Verify TFL alerts appear when there are active disruptions - Confirm planned closures are not shown - Test card dismissal works correctly 🤖 Generated with https://claude.com/claude-code
chezu added 3 commits 2026-01-10 21:57:15 +00:00
Query TFL API for Tube and Elizabeth Line status, displaying
disruptions as feed cards. Major disruptions (severity 1-6) appear
as RIGHT_NOW spotlight cards, minor delays (7-9) as FYI items.

- Add TFLDataSource with 2-min cache and severity classification
- Add .transitAlert FeedItemType with 0.85 base weight
- Wire up async fetch in ContextOrchestrator pipeline
- Handle timeout and failure cases gracefully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Only show active disruptions (delays, suspensions), not planned
closures which aren't relevant for real-time commute decisions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace magic numbers with documented static Sets for clarity.
ignoredSeverities and majorSeverities make the filtering logic
self-documenting.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
chezu merged commit 22fbfb9790 into main 2026-01-10 21:57:26 +00:00
chezu deleted branch feat-tflalerts 2026-01-10 21:57:45 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kennethnym/aris-old#5
No description provided.