Skip to content

Conversation

@alec-georgoff
Copy link
Collaborator

Description:

This update moves the "Expand map"/"Show results" button from the map to the itinerary header component, preventing overlap issues with the map attribution on smaller screen sizes in mobile view.

PR Checklist:

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

@amy-corson-ibigroup
Copy link
Contributor

Looking really good! I haven't spent a ton of time looking at the code yet, thought it might make sense to iron out the below for this first round:

  1. Something we discussed was replacing the button text with a chevron, which most mobile users will recognize as a way to expand/collapse the panel. Here's some examples of how this could look
image image
  1. The container on the button has a scroll and so you can easily accidentally get the page into a weird state:
image
  1. Could be this is outside the scope of this PR, but I'm wondering if we may want to more gracefully animate the map expanding and collapsing? Right now the panel size is animated but the map is not, and there's a huge white gap mid-animation when the map resizes. Either we could animate the map height or if that doesn't work we could delay the map resizing.

Thank you so so much for the work on this!

@alec-georgoff
Copy link
Collaborator Author

@amy-corson-ibigroup I prevented scrolling in the collapsed header area and updated to use the chevron icon! Currently looking into the animation to see if I can clean it up a bit but wanted to get the other fixes over to you for review.

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.

  1. Can we move the zoom buttons to the left hand side? We're still getting some button overlap on smaller screen sizes: !image
  2. Something about the button isn't quite right to me, especially when it's collapsed... wondering how we feel about a) making the chevron icon a little wider, and/or b) when the itinerary results are collapsed, making the button the base branding color, so it matches the mobile header? idk, just a couple of ideas, I'm not married to either of them but curious what you and a second reviewer might think!

@@ -1,5 +1,7 @@
/* eslint-disable complexity */
import { ArrowLeft } from '@styled-icons/fa-solid/ArrowLeft'
import { ChevronDown } from '@styled-icons/fa-solid/ChevronDown'
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably easier to just import one icon and rotate

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, actually I guess we import both in app-menu-items so I'll leave that to the second reviewer

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I found these via their usage in another component and figured I'd keep the same pattern here. Happy to go with a rotate strategy if you or others feel strongly, though!

@amy-corson-ibigroup
Copy link
Contributor

amy-corson-ibigroup commented Dec 10, 2025

  1. Can we move the zoom buttons to the left hand side? We're still getting some button overlap on smaller screen sizes

Oh, I'm seeing now we have it changed for one environment in the configuration, but I think this needs to be the new default!

@alec-georgoff
Copy link
Collaborator Author

  1. Can we move the zoom buttons to the left hand side? We're still getting some button overlap on smaller screen sizes: !image
  2. Something about the button isn't quite right to me, especially when it's collapsed... wondering how we feel about a) making the chevron icon a little wider, and/or b) when the itinerary results are collapsed, making the button the base branding color, so it matches the mobile header? idk, just a couple of ideas, I'm not married to either of them but curious what you and a second reviewer might think!

How about this? Made it wider and used the branding color as suggested:

image

@alec-georgoff
Copy link
Collaborator Author

Latest update uses the unicode chevron and tweaks the styling a bit to make it less intrusive:

Screenshot 2025-12-16 at 2 31 55 PM Screenshot 2025-12-16 at 2 32 21 PM

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.

I like the unicode chevron! thank you for the changes and for your patience! Sorry for taking a few days to review:

  1. if you look at this on taller devices, the duration button is peeking out. I think we'll need a solution where the duration button is conditionally rendered?
image
  1. The sort results button is blue now?
image If we can fix it while we're touching this code that would be awesome but feel free to ignore it and we can fix later, I don't want to keep changing the scope of this PR.

@alec-georgoff
Copy link
Collaborator Author

I like the unicode chevron! thank you for the changes and for your patience! Sorry for taking a few days to review:

  1. if you look at this on taller devices, the duration button is peeking out. I think we'll need a solution where the duration button is conditionally rendered?
image 2. The sort results button is blue now?

image If we can fix it while we're touching this code that would be awesome but feel free to ignore it and we can fix later, I don't want to keep changing the scope of this PR.

Good catch on the vertical spacing! I dug into it and realized that we need to be a bit more adaptive in our sizing of the button. I ended up using the viewport height (vh) as the height of the chevron's button. Since our styling was already using a percentage of vertical screen to move the results pane down, using vh allows us to use that same percentage value for the button height.

Regarding the blue sort button, I believe that problem is fixed with the updated configuration styling! Let me know if it persists even with the updated config though.

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.

Unfortunately I can still see the itinerary sort button. It's just a few pixels but it's there:
image

{typeof getCustomMapOverlays === 'function' &&
getCustomMapOverlays(!itinerary && !pending)}
<NavigationControl
position={navigationControlPosition || 'bottom-right'}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll leave this to second reviewer to decide but the positioning on desktop here is looking weird to me, it's just so different from every other desktop map application. Wondering if we should follow what others apps do, take these buttons out on mobile and leave them alone on desktop.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about we only move them on mobile? Check out this commit and let me know what you think

@alec-georgoff
Copy link
Collaborator Author

Unfortunately I can still see the itinerary sort button. It's just a few pixels but it's there: image

Wow very good find! Tweaked the sizing to take care of that

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.

Bad news I am still seeing this:
image

Comment on lines +549 to +553
position={
overrideNavigationControlPosition ||
navigationControlPosition ||
'bottom-right'
}
Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup Dec 24, 2025

Choose a reason for hiding this comment

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

Wait would this be easier? Rather than the additional prop:

position = { navigationControlPosition || (mobile ? 'top-left' : 'bottom-right') }

Let me know, maybe you already tried this

Comment on lines +105 to +114
const mapExpansionText = useMemo(() => {
return mapExpanded
? intl.formatMessage({
id: 'components.BatchResultsScreen.showResults'
})
: intl.formatMessage({
id: 'components.BatchResultsScreen.expandMap'
})
}, [intl, mapExpanded])

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting, I think generally we would just create two strings and conditionally render them based on mapExpanded below, but this might be more efficient? I'll let the second reviewer decide

Comment on lines +193 to +197
alignItems: 'center',
display: 'flex',
height: `${TOGGLE_MAP_BUTTON_HEIGHT}vh`,
justifyContent: 'center',
margin: '-10px 0',
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 lot of inline CSS, could be good at this point to create a styled component

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.

3 participants