-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[maps] keydown+scroll to zoom #135330
[maps] keydown+scroll to zoom #135330
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
Per my comments during the meeting - in my personal experience, most sites have used |
I usually see the Command modifier if it requires a modifier key and don't remember seeing the Shift modifier. What's currently called dashboard in Kibana is not a dashboard, it's an interactive document. In the future, it could evolve toward
A real dashboard should have no need for modifier keys, just like going to Google Maps doesn't need it and it's good. The need for the modifier key only arises due to the conflicting scrolling functionality, and it's better to remove the conflict than to rely on feature discoverability. I think we should guide users to avoid scrolling "dashboards" even right now. There are numerous UX problems with scrolly dashboards even putting this aside, such as possibly integral charts or maps scrolling out of page, or missing important signals. Change my mind 😄 A modifier key has a price, more tedious use of something that's more integral to the data experience (zooming) than scrolling an entire dashboard. And there needs to be feature discoverability, which won't be perfect. Users can handle the capture. It's sometimes the case that there is a scrollable list on a document, that doesn't need a modifier key either. Users know how to deal with it. Foregoing a modifier key solves the discoverability issue as well. A modifier key needs to be advertised; some tools add a map overlay if they encounter a zoom attempt without the modifier key, which is I think a UX with heavy tradeoffs. |
Not always, for mobile screens they request users to use two fingers as described here There is a Leaflet plugin to get the same behavior using I'll share more examples on how this is handled to support one modifier or the other, if I found them. |
Google Maps uses ctrl+scroll on Windows and Linux and cmd+scroll on Mac to zoom. Mapbox also uses ctrl+scoll (cmd+scroll on Mac) for zooming. Maplibre should be soon adding support for cooperative gestures. The pending PR will also use ctrl+scroll (cmd+scoll on Mac) to zoom. OpenLayers supports scroll zoom with a modifier key. It appears ctrl (cmd on Mac) is the default modifier. As @jsanz noted, there is a plugin for Leaflet that supports cooperative gestures. It also defaults to ctrl+scroll (cmd+scroll on Mac) for zoom. ArcGIS is the oddity of this group. Scrolling on their webmaps pans the map North and South. 😖 However, shift+scroll will zoom the map. 🤷 I would prefer to follow the more popular convention of using ctrl+scroll on Windows/Linux and cmd+scroll on Mac to enable zoom on a dashboard. |
Thanks for looking at other implementations. Agree, let's be consistent. I will update the PR to use ctrl+scroll on Windows/Linux and cmd+scroll on Mac.
Scroll-less dashboards is a laudable goal. Until that goal is achieved, keydown+scroll is a big step forward in usability. |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! just one small nit.
code review and tested map embeddables in dashboard and SIEM with chrome.
.../plugins/maps/public/connected_components/mb_map/keydown_scroll_zoom/keydown_scroll_zoom.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the comment about the size of the text already noted in Nick's review , this looks great to me 👏.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nreese: Nice addition! I've left some style and markup suggestions below for your review. Let me know if you have any questions. Thanks!
x-pack/plugins/maps/public/connected_components/mb_map/keydown_scroll_zoom/_index.scss
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/connected_components/mb_map/keydown_scroll_zoom/_index.scss
Outdated
Show resolved
Hide resolved
.../plugins/maps/public/connected_components/mb_map/keydown_scroll_zoom/keydown_scroll_zoom.tsx
Outdated
Show resolved
Hide resolved
.../plugins/maps/public/connected_components/mb_map/keydown_scroll_zoom/keydown_scroll_zoom.tsx
Outdated
Show resolved
Hide resolved
…_scroll_zoom/_index.scss Co-authored-by: Michael Marcialis <michael@marcial.is>
…_scroll_zoom/_index.scss Co-authored-by: Michael Marcialis <michael@marcial.is>
…_scroll_zoom/keydown_scroll_zoom.tsx Co-authored-by: Michael Marcialis <michael@marcial.is>
…_scroll_zoom/keydown_scroll_zoom.tsx Co-authored-by: Michael Marcialis <michael@marcial.is>
@elasticmachine merge upstream |
Thanks for all the great changes. I have merged them and everything looks very polished now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for making those changes.
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
* [maps] shift+scroll to zoom * content * only enable keydown scroll zoom in embeddable * scss lint fix * one more scss lint fix * replace shift with control * lint * use smaller css transition so message hides faster when keydown+scrolling * h3 and small text * Update x-pack/plugins/maps/public/connected_components/mb_map/keydown_scroll_zoom/_index.scss Co-authored-by: Michael Marcialis <michael@marcial.is> * Update x-pack/plugins/maps/public/connected_components/mb_map/keydown_scroll_zoom/_index.scss Co-authored-by: Michael Marcialis <michael@marcial.is> * Update x-pack/plugins/maps/public/connected_components/mb_map/keydown_scroll_zoom/keydown_scroll_zoom.tsx Co-authored-by: Michael Marcialis <michael@marcial.is> * Update x-pack/plugins/maps/public/connected_components/mb_map/keydown_scroll_zoom/keydown_scroll_zoom.tsx Co-authored-by: Michael Marcialis <michael@marcial.is> * clean-up Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Michael Marcialis <michael@marcial.is>
Fixes #43640
PR adds control+scroll to zoom when map is embedded. Map displays instructions when scrolled
I used shift because scroll by bounding box also used shift so I wanted to be consistent with that actionUsing control to be consistent with other mapping implementations.