hackforla / 311-data

Empowering Neighborhood Associations to improve the analysis of their initiatives using 311 data
https://hackforla.github.io/311-data/
GNU General Public License v3.0
62 stars 64 forks source link

Improve Zoom Behavior on Map #1700

Open ryanfchase opened 8 months ago

ryanfchase commented 8 months ago

Overview

We need to clarify the user's zoom controls, esp when selecting an NC so that they don't get confused when zooming in/out.

Suggested Change from PMs

Action Items

PM Action Item

Resources

V1.2 Moderated Usability Test from October '23


Design Iterations

Please move ticket between In Progress and In Review to assist PM team

Iteration 1

Link to notes: https://github.com/hackforla/311-data/issues/1700#issuecomment-2138382290 - Added zoom in & out controls - Suggested a "locked in" zoom level when a NC is selected - Added indication that zooming is disabled by making the controls disappear when NC is selected - Received feedback from design team for iteration 2 Screenshot 2024-05-29 at 3 44 07 PM

Iteration 2

Link to notes: https://github.com/hackforla/311-data/issues/1700#issuecomment-2168920133 - Changed colors of the zoom buttons for better accessibility - Explored a popover feature that explicitly describes disabled status and how to enable zooming - Exploring a change in the cursor to indicate a disabled status Screenshot 2024-06-14 at 4 43 34 PM

Iteration 3

Link to notes: https://github.com/hackforla/311-data/issues/1700#issuecomment-2192835113 - Finalized cursor states after feedback - Changed colors of popover for better consistency with design system Screenshot 2024-06-26 at 5 25 00 PM

Iteration 4

Link to notes: https://github.com/hackforla/311-data/issues/1700#issuecomment-2193702141 - Modified design to make it a tooltip instead of popover - Changed the position where tooltip would appear Screenshot 2024-06-28 at 3 48 34 PM

Final Iteration

Link to notes: https://github.com/hackforla/311-data/issues/1700#issuecomment-2415394663 - Removed popup for disabled state - Added in hover states - Changed zoom button colors after adding in hover states for better visual design - Zoom levels to be set according to Mapbox guidelines: https://github.com/hackforla/311-data/issues/1700#issuecomment-2392515315 ![image](https://github.com/user-attachments/assets/dfbe1d90-4e80-4662-96a6-2b357ff588b5)


Hand Off Materials

Figma Section Name: ⭐⭐⭐ Handoff

Before Screenshot

No NC Selected (no zoom controls present) ![image](https://github.com/hackforla/311-data/assets/6414668/c12279c6-c667-4153-876c-bfe2770a9916) With NC Selected (no zoom controls present) ![image](https://github.com/hackforla/311-data/assets/6414668/f9d47392-7394-4443-83bf-9a754cc68077)

After Screenshot (Finalized)

![image](https://github.com/user-attachments/assets/dfbe1d90-4e80-4662-96a6-2b357ff588b5)

Designer Resources

Iteration Dropdown Copy/Paste

```

Iteration X

Link to notes: `REPLACE WITH COMMENT URL` `REPLACE WITH SCREENSHOT UPLOAD`

```

Instructions for Engineering Hand Off

To Start Engineering Hand Off... 1. Ensure all Hand Off Materials are filled in 3. Add the "ready for dev lead" label 4. Leave a comment saying "This ticket is ready for engineering hand off."

Joy-Truex commented 7 months ago

added "Research potential solutions" as an action step

ryanfchase commented 7 months ago

This ticket is ready for picking up @Joy-Truex @allisonjeon

pogwon commented 5 months ago

Iteration 1:

Screenshot 2024-05-29 at 3 44 07 PM
ryanfchase commented 5 months ago

@pogwon please provide Iteration 2 if available -- otherwise an ETA of when you will have it ready, thanks!

pogwon commented 5 months ago

Iteration 2:

Screenshot 2024-06-14 at 4 43 34 PM
pogwon commented 5 months ago

@ryanfchase For one of the designs for Iteration 2, we are exploring a change in cursor state to indicate that the zoom feature is disabled. Is this a realistic solution that the dev team can implement?

Screenshot 2024-06-14 at 4 52 17 PM
ryanfchase commented 5 months ago

@ryanfchase For one of the designs for Iteration 2, we are exploring a change in cursor state to indicate that the zoom feature is disabled. Is this a realistic solution that the dev team can implement?

@pogwon I think so, so long as we are provided the entire cursor (the pointer and the crossed out circle) as a single SVG or similar asset.

ryanfchase commented 5 months ago

Adding labels and modifying board status while we wait for input @pogwon .I shall put everything back when this is addressed 😄

aqandrew commented 4 months ago

@pogwon I think the change in cursor state you're looking for is the CSS rule cursor: not-allowed (MDN):

https://github.com/hackforla/311-data/assets/9038965/f83360b2-04f1-400d-b6d1-6c05f4a015d8

This is a native/cross-platform solution that is a lot less work than replacing the cursor with an image asset.

I'm guessing that we would add these controls with Mapbox's NavigationControl. If that control doesn't give us the option to limit zoom + set the not-allowed cursor out of the box, then we can style the cursor with CSS based on mouseover events: https://github.com/mapbox/mapbox-gl-js/issues/1353#issuecomment-406748057

ryanfchase commented 4 months ago

@pogwon following up on @aqandrew's comment, I think we can move forward with cursor: not-allowed cursor state for this deliverable.

If this is sufficient, please move the ticket to "In Progress" or "In Review", thanks!

Edit: hit "comment" too fast...

pogwon commented 4 months ago

@ryanfchase Sounds good - thanks! Going to ask for feedback from the design team one more time at this week's meeting before deciding on the final design for handoff.

pogwon commented 4 months ago

ETA for Completion: Wednesday June 26, 2024.

ryanfchase commented 4 months ago

@pogwon I've moved this to In Progress since you've provided an ETA -- thanks!

pogwon commented 4 months ago

Third iteration with notes Link to Figma File

Screenshot 2024-06-26 at 5 25 00 PM
pogwon commented 4 months ago

Final designs with notes Link to Figma File

Screenshot 2024-06-28 at 3 48 34 PM
pogwon commented 4 months ago

This ticket is ready for engineering hand off. @ryanfchase

ryanfchase commented 4 months ago

Thank you @pogwon -- I'll get this converted to a dev ticket.

ryanfchase commented 4 months ago

@pogwon @annaseulgi Happy 1st day of July break! I mean to do this before break started, please review at your convenience. I'll add it to the 1st agenda of August so we don't forget.

In the PM Suggested Changes in the main issue, we noted the following...

[User] can't scroll out too far or scroll away too far while an NC is selected.

I also think that we should be establishing a minimum zoom level. Currently, regardless of NC selection, a user is allowed to scroll too far (e.g. a street corner will take up the entire screen) as well as zoom out too far (we can view the entire Earth as a globe in space).

Action Items

In order for me to fully consider this ticket closed, Designer will help confirm the following:

ryanfchase commented 2 months ago

TODO for dev lead

ryanfchase commented 2 months ago

@pogwon @Joy-Truex I'm still working on providing the Mapbox docs that will allow us to convey zoom levels and other map-styling info between design and dev team.

I did have a question about the location of the zoom controls. Typically the Privacy Policy modal takes up the bottom left corner of the screen on site-open. I notice that this is also the desired location of the zoom controls, as designed by @pogwon. While not perfect, I think this is fine -- but I just wanted to run it by you both in case you felt strongly about addressing this. I believe Bonnie says we should be encouraging users to deal with the Privacy Policy modal immediately, rather than let it remain open for the entirety of their session.

ryanfchase commented 2 months ago

@Joy-Truex @allisonjeon

I've been reviewing the Mapbox docs, and I just want to share a few highlights:

Resources

Some links I used to compile these notes:

Mapbox JS for setting max/min zoom level

```js mapboxgl.accessToken = 'pk.eyJ1IjoicnlhbmNoYXNlIiwiYSI6ImNsN2pvbG8wMTAwOHczeHFuYWNqbDJhaG4ifQ.BEyTQiMJSHPJX7uHLAGzCg'; const map = new mapboxgl.Map({ container: 'map', // container ID // Choose from Mapbox's core styles, or make your own style with Mapbox Studio style: 'mapbox://styles/mapbox/streets-v12', // style URL // center: [-74.5, 40], // starting position center: [-118, 34], zoom: 9, // starting zoom, maxZoom: 15, minZoom: 9 }); // Add zoom and rotation controls to the map. map.addControl(new mapboxgl.NavigationControl()); ```

pogwon commented 2 months ago

@pogwon @Joy-Truex I'm still working on providing the Mapbox docs that will allow us to convey zoom levels and other map-styling info between design and dev team.

I did have a question about the location of the zoom controls. Typically the Privacy Policy modal takes up the bottom left corner of the screen on site-open. I notice that this is also the desired location of the zoom controls, as designed by @pogwon. While not perfect, I think this is fine -- but I just wanted to run it by you both in case you felt strongly about addressing this. I believe Bonnie says we should be encouraging users to deal with the Privacy Policy modal immediately, rather than let it remain open for the entirety of their session.

@ryanfchase Thanks for letting me know - I'm personally leaning towards keeping it as is, since you mentioned Bonnie's thoughts about dealing with the privacy policy modal. But I'll ask the design team this week what they think about "locking" a control behind the modal and provide updates.

ryanfchase commented 2 months ago

Just wanted to share the conversation from Wednesday (8/28/2024). It sounds like we are moving forward with leaving the navigation controls in the bottom left corner as per the spec. We are fine with it being obscured by the Privacy Policy modal since it will be dismissed by the user.

I still think I want to review the mapbox documentation and styling capabilities with dev + design teams (I have outlined above). We can make time for that at an upcoming meeting.

ryanfchase commented 2 months ago

@Joy-Truex @pogwon I actually think we can nearly sign off on this ticket -- I do have one feedback request. In the final frame on @pogwon's hand off screenshot, the pop-up says:

Zoom features are disabled while locked into a neighborhood council.

To enable zoom features, please exit by clicking out of the selected area.

Requested Changes

Any thoughts on removing the pop-up text completely? Especially if we are planning on a "reset all" button in the search & filters modal? I'll add this to our upcoming Wednesday agenda to ensure there is time to discuss this.

pogwon commented 1 month ago

Sorry, I was out sick for last week's meeting. I don't have a problem with removing the pop-up text completely. But a potential issue that may arise is displaying only one available option within our current designs could be confusing for users (SS shows how it would look if Zoom in is available but Zoom out is disabled)

Screenshot 2024-09-18 at 6 21 57 PM

This probably won't be an issue if users mainly use the scroll wheel or pinching to zoom but it could be confusing if they rely on the zoom buttons. There are some new potential button designs I am considering that I can have ready by the end of this week (Friday, September 20) that may look clearer when only one option is enabled.

pogwon commented 1 month ago

@ryanfchase @Joy-Truex Here are two potential updated designs for the zoom buttons, along with disabled states (for zoom-in and out):

Screenshot 2024-09-20 at 4 13 19 PM

I am leaning towards the above design as it is more consistent with other maps' designs (Google, Yelp, Airbnb, etc.) but will also ask for feedback in our UI/UX Slack channel.

ryanfchase commented 1 month ago

@pogwon thank you! Yeah I think upper design is what I'm leaning towards as well. I think it's easier to distinguish the disabled state. But interested to hear what the others think.

pogwon commented 1 month ago

Looking at feedback, the general consensus was that the top (lighter) design would fit better. There was one suggestion that maybe it can switch back and forth depending on if the map changes from dark to light. I'm not sure if this can be implemented but I think we can discuss it at this week's meeting and make a final decision to move forward.

pogwon commented 1 month ago

After some research into other map behaviors, there are very few examples where zoom buttons change as the map color changes. I think it would be best to move forward with just the lighter designs. I can prepare those for handoff along with different states (disabled, active, hover) and link the Figma file here.

@ryanfchase Should the zoom levels we reviewed from the MapBox docs be included in there as well?

ryanfchase commented 1 month ago

After some research into other map behaviors, there are very few examples where zoom buttons change as the map color changes. I think it would be best to move forward with just the lighter designs. I can prepare those for handoff along with different states (disabled, active, hover) and link the Figma file here.

@ryanfchase Should the zoom levels we reviewed from the MapBox docs be included in there as well?

Let's just focus on the lighter design, the different states, and any on-hover info boxes that pop up. I have been able to communicate the zoom levels to the devs -- unless you're comfortable identifying and demonstrating zoom levels with the map.

Otherwise, we can stick to communicating it as the following:

If anything is still unclear, please reach out on Slack and we can come to an agreement.

cc @DrAcula27

pogwon commented 1 month ago

After designing the hover states, there are a few different options. I just want to get some feedback from the design team at tonight's meeting and will post/submit final designs for handoff afterwards.

pogwon commented 4 weeks ago

Finalized zoom icons are in the handoff section of the Figma file. As noted, hover states only apply when zoom function is enabled.

Screenshot 2024-10-15 at 5 24 37 PM
ryanfchase commented 2 weeks ago

Hi @Joy-Truex @allisonjeon, has this work been reviewed and approved? Please leave a comment if so, PMs will have a brief look before officially handing this off to dev.

Joy-Truex commented 2 weeks ago

Hi @Joy-Truex @allisonjeon, has this work been reviewed and approved? Please leave a comment if so, PMs will have a brief look before officially handing this off to dev.

Reviewed and approved. TY!!