Set shuttle link and visibility from an external config file#2309
Conversation
a6wu
commented
May 7, 2026
There was a problem hiding this comment.
Pull request overview
This PR makes the Shuttle card’s external “transit map” action configurable via the cards list response (URL, label, and visibility), removing the previously hardcoded Wayfinder link.
Changes:
- Add
externalLinkURL/externalLinkTexttoCardsModel(JSON parse + serialization) with empty-string defaults. - Update the Shuttle card to render an external-link
ActionButtononly when a non-empty external URL is provided by config. - Miscellaneous formatting and minor accessibility improvements (notably in Dining detail buttons’ semantics).
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/ui/shuttle/shuttle_card.dart | Uses card config (externalLinkURL / externalLinkText) to control Shuttle external-link button and visibility. |
| lib/core/models/cards.dart | Extends cards config model to include external link URL/text fields. |
| lib/ui/dining/dining_detail_view.dart | Adds Semantics wrappers for “Get Directions” / “Visit Website” / “View Menu” buttons. |
| lib/ui/news/news_list.dart | Formatting only. |
| lib/ui/navigator/bottom.dart | Formatting only. |
| lib/ui/home/home.dart | Formatting only. |
| lib/ui/dining/dining_list.dart | Formatting only. |
| lib/ui/availability/availability_display.dart | Formatting only. |
| lib/ui/availability/availability_card.dart | Formatting only (multiline if). |
| lib/ui/ai_assistant/citation_web_view.dart | Formatting only. |
| lib/ui/ai_assistant/chat_message_bubble.dart | Formatting only. |
| lib/core/services/tgpt_services/chat_stream.dart | Formatting only. |
| lib/core/providers/chat_provider.dart | Formatting only. |
| lib/core/providers/availability.dart | Formatting only. |
| lib/core/models/tgpt_models/chat_response.dart | Formatting only. |
| lib/core/models/tgpt_models/chat_message_persistent.g.dart | Formatting only. |
| lib/app_constants.dart | Formatting only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| final externalLinkText = shuttleCardConfig?.externalLinkText ?? ''; | ||
| final actionButtonChildren = <Widget>[ | ||
| if (externalLinkURL.isNotEmpty) ...[ | ||
| ActionButton( | ||
| buttonText: externalLinkText, |
| externalLinkURL: json["externalLinkURL"] as String? ?? '', | ||
| externalLinkText: json["externalLinkText"] as String? ?? '', |
angelawu236
left a comment
There was a problem hiding this comment.
It might be worth it to revert back to the old code for the files that aren't related to the shuttle, in case it's introducing any new bugs because of formatting. Also, maybe testing with an invalid/non existing link from the env could also be done, so in case in the future if the config doesn't have a valid link, the app still looks/works fine.