Skip to content

Conversation

@binh-dam-ibigroup
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented Nov 14, 2025

Description

This PR fixes the display of pattern headsigns for routes with a single pattern and no headsign. The headsign is the name of the last stop in the pattern, and the dropdown selector is not used. The PR also improves display of patterns with leading "To " text.

PR Checklist:

  • Does the code follow accessibility standards (WCAG 2.1 AA Compliant)?
  • Are all languages supported (Internationalization/Localization)?
  • Are appropriate Typescript types implemented?
Before After
before screenshot after screenshot

Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

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

Really nice improvement, thank you for all the different considerations on this! Just a few nitpicks/questions but overall looks good.

// In case the headsign is blank, extract headsign from the pattern 'desc' attribute
// by attempting the logic below in order:
const attempts = [
// (format: '49 to <Destination> (<destid>)[ from <Origin> (<originid)]').
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nitpick, but can we remove the parenthesis around this comment? There's a lot of brackets and parenthesis happening in this line already and removing one set might make it easier to parse

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, clarified in 52b7a44

Comment on lines +84 to +85
// If that regex didn't work, try the old regex
(d) => d?.match(/ to ([^(from)]+) \(.+\)/)?.[1],
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be reading this regex wrong, but are there actual cases where this one would work and the above one would not? All the cases I'm trying, the regex on 83 does a better job

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I only copied over what was there before. I'm not sure which cases this one was supposed to cover.

Copy link
Collaborator

@alec-georgoff alec-georgoff left a comment

Choose a reason for hiding this comment

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

Would it be worthwhile to also check for "toward [destination]" or "towards [destination]"? Not sure if any of those actually exist but it popped into my head.

@binh-dam-ibigroup
Copy link
Collaborator Author

Would it be worthwhile to also check for "toward [destination]" or "towards [destination]"? Not sure if any of those actually exist but it popped into my head.

@alec-georgoff I added the m in 0deb98a, let me know how that feels!

@alec-georgoff
Copy link
Collaborator

Would it be worthwhile to also check for "toward [destination]" or "towards [destination]"? Not sure if any of those actually exist but it popped into my head.

@alec-georgoff I added the m in 0deb98a, let me know how that feels!

Awesome, thanks!

@binh-dam-ibigroup binh-dam-ibigroup merged commit 53a9eb7 into dev Nov 18, 2025
9 checks passed
@binh-dam-ibigroup binh-dam-ibigroup deleted the handle-no-headsign branch November 18, 2025 22:09
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