fix: subway status pills overlapping with status text#3063
Conversation
| if ( | ||
| fittingStep === FittingStep.PerAlertEffect && | ||
| (isStopsSkipped || isSuspension) | ||
| shouldShowAlertLink(alertStatus) |
There was a problem hiding this comment.
I'm a little confused as to why we do this for specific statuses rather than "not delays", which is the one status that has its own shortening logic for the PerAlertEffect step. This is the last step — if we've reached this point, the text is still overflowing and there's nothing else left to try, so we should try something regardless of status.
Basically right now the logic for this PerAlertEffect step is:
- If stops-skipped, shuttle, or suspension: replace location with URL
- If delay: shorten status string to just "Delays"
- If (something that's not one of the above): do nothing?
I would propose this makes more sense as:
- If delay: shorten status string to just "Delays"
- Otherwise: replace location with URL
These two are sort of equivalent right now since Shuttle/Suspension/Skipped/Delay covers all the alert types that currently go into Subway Status, but I think simpler logic that covers all possibilities would be an improvement. (it actually doesn't currently account for "Single Tracking", which is status text that can result from a Delay alert)
There was a problem hiding this comment.
Yep, those changes make sense. I'll add those changes and try to clean-up the code a little bit as well.
Is there a world where we want to also replace the location with the URL when we're displaying "Delays" as well? Does shortening the Delays guarantee there will be enough space for the location?
It seems like it might, but wanted to check in case there were some locations that were particularly long for the GL.
There was a problem hiding this comment.
Is there a world where we want to also replace the location with the URL when we're displaying "Delays" as well? Does shortening the
Delaysguarantee there will be enough space for the location?
I think Yes and No, respectively, but delays actually having a location (as opposed to being whole-line, which leaves the location field blank) is unusual enough that maybe we could punt on that. The alternative would be creating an extra resizing step, which would be unused by any alert status other than delays, so delays could do something like full location => abbrev location => abbrev to "Delays" => replace location with URL (if that's even the right sequence, I'm not sure).
- seems like having min-width was causing it so that the divs weren't respecting the full size of the pills - alongside that, we needed to add Shuttle as a specific alert type to show the alert link - removes min-width from the container for the RoutePill and adjusted logic so that if it's a Delay, we only change the status whereas the other statuses change the location
269491b to
dd01824
Compare
Asana task: Screens bug: overlapping elements in Subway Status
Description
