Skip to content
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

Show edit and export on small screens #4839

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tordans
Copy link
Contributor

@tordans tordans commented May 26, 2024

I looked into making the edit button visible on small screen #2233 and ran into a few issues that are making this less straight forward than I was hoping it to be.

  1. Bootstrap does not provide responsive classes to change the button group to vertical.
  2. Bootstrap has a bug with vertical button list when the first button is a dropdown.
  3. Bootstrap does not support vertical button groups with split buttons ATM.
    • See https://getbootstrap.com/docs/5.2/components/button-group/#vertical-variation "Split button dropdowns are not supported here.".
    • We can work around this by adding a few utility classes, which I did for this draft.
    • But since the way we do responsive design on the website is a bit special, there are slight changes to what we have right now in certain edge case screen sizes. We could use more JS to fix this if needed…
  4. Bootstrap does not handle hidden items in a group.
    • We are hiding the "Export" Page on the button group via CSS ATM and Bootstrap does not handle the case of hidden elements, so the button group borders are wrong.
    • For this solution I made all menu items visible. Following the logic that the reason why we have an export page so prominently on the page at all is to showcase the story of OSM, which is just as true on mobile. Hiding part of the story is worse than showing it so users can learn about it an realize they need a different device to use this part of the website. – We could continue hiding the page, of course, but need to add more custom css or JS to make bootstrap work.

This is what it looks like:

Logged out:

image image

Logged in:

Bildschirmfoto 2024-05-26 um 07 17 19 Bildschirmfoto 2024-05-26 um 07 17 27 Bildschirmfoto 2024-05-26 um 07 17 37

Where do go from here?

I consider hiding the Edit button in 2024 a bug which we should fix. And this PR is a way to do this.

In the near future we will need to reconsider this part of the menu, especially the screen usually visible on mobile to incorporate editors in the menu (openstreetmap/operations#877 (comment)).


Open issues:

  • When changing the screen width without reload, the class change from "button group" to "vertical button group" is not applied.
    image
    I can fix since depending on the feedback on this PR.

Closes #2233

@tordans tordans force-pushed the show-edit-button-on-mobile branch from 3bbf5b2 to 22fb479 Compare May 26, 2024 05:07
@AntonKhorev
Copy link
Collaborator

Why do you wan a vertical button group? Doesn't it take too much space?

@AntonKhorev
Copy link
Collaborator

"Export" probably shouldn't be in this button group at all. With Export removed buttons should fit on a screen as a horizontal group.

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.

add "edit" button to mobile version
2 participants