Skip to content

Set shuttle link and visibility from an external config file#2309

Merged
hamedhemmati merged 2 commits into
experimentalfrom
transit-link
May 11, 2026
Merged

Set shuttle link and visibility from an external config file#2309
hamedhemmati merged 2 commits into
experimentalfrom
transit-link

Conversation

@a6wu
Copy link
Copy Markdown
Contributor

@a6wu a6wu commented May 7, 2026

## Summary

Updates the Shuttle card’s external transit map action to come from a config file, allowing the button label, destination, and visibility to be configured external to the app.


## Changelog

[General] [Change] - Configure the Shuttle card external link button from the cards list response and hide it when no external URL is provided.


## Test Plan

- Verified `CardsModel` parses optional `externalLinkURL` and `externalLinkText` fields with empty-string defaults.
- Verified Shuttle card no longer uses the hardcoded Wayfinder URL.
- Verified the external link button is only rendered when `externalLinkURL.trim()` is non-empty.
- Ran targeted Flutter analysis on the updated model and Shuttle card files.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / externalLinkText to CardsModel (JSON parse + serialization) with empty-string defaults.
  • Update the Shuttle card to render an external-link ActionButton only 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.

Comment on lines +44 to +48
final externalLinkText = shuttleCardConfig?.externalLinkText ?? '';
final actionButtonChildren = <Widget>[
if (externalLinkURL.isNotEmpty) ...[
ActionButton(
buttonText: externalLinkText,
Comment on lines +36 to +37
externalLinkURL: json["externalLinkURL"] as String? ?? '',
externalLinkText: json["externalLinkText"] as String? ?? '',
Copy link
Copy Markdown
Contributor

@angelawu236 angelawu236 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

@hamedhemmati hamedhemmati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@hamedhemmati hamedhemmati merged commit 76a5cc7 into experimental May 11, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants