openstreetmap / openstreetmap-website

The Rails application that powers OpenStreetMap
https://www.openstreetmap.org/
GNU General Public License v2.0
2.18k stars 914 forks source link

user_blocks pages lacks proper navigation #2387

Open jidanni opened 5 years ago

jidanni commented 5 years ago

At the bottom of https://www.openstreetmap.org/user_blocks there is

« Previous Page 1 Next »

There may be five more pages.

There may be five hundred.

The only way for the user to find out is to click from one to the next to the next.

jidanni commented 5 years ago

No way to search to see if certain user is in list.

No way to order by name to see if certain user is in list.

No record of date block started. (OK, can click "Show")

jidanni commented 5 years ago

Hacking the URL, https://www.openstreetmap.org/user_blocks?page=5555 works, but the result is the same as https://www.openstreetmap.org/user_blocks?page=1 .

jidanni commented 5 years ago

Actually one can put the username here: https://www.openstreetmap.org/user/Nurdsburg and then there is a link to all the blocks visible. So perhaps add a tip to the page.

mmd-osm commented 3 months ago

We have a few more navigation options in the meantime:

image

kcne commented 2 months ago

Regarding the navigation limitations on the user blocks page, expanding on @mmd-osm answer, I think the current view could use some enhancements. Displaying the total number of pages or blocks would be a nice touch. For example, showing something like "Displaying 20 of ${totalNumberOfBlocks}" or "Page ${currentPage} of ${totalNumberOfPages}" could provide more context and improve the user experience.

Additionally, adding a search input to query blocks by blocked user or creator could significantly boost usability. This would help users efficiently order and find specific entries.

What are you thoughts on this? Would you be willing to merge changes mentioned if I opened a PRs addressing mentioned issues? @tomhughes @gravitystorm @AntonKhorev

AntonKhorev commented 2 months ago

Displaying the total number of pages or blocks would be a nice touch. For example, showing something like "Displaying 20 of ${totalNumberOfBlocks}" or "Page ${currentPage} of ${totalNumberOfPages}" could provide more context and improve the user experience.

Some of these things are not done to avoid using OFFSET/COUNT in db queries.

Additionally, adding a search input to query blocks by blocked user or creator could significantly boost usability.

They are linked from profile pages. Profile pages also have active blocks and created blocks counters.

Also see #4734 for this from the original post:

No way to jump to the last page.

AntonKhorev commented 2 months ago

If you want to be compatible with https://github.com/openstreetmap/openstreetmap-website/pull/4734 or similar and have some idea about ${totalNumberOfBlocks} while browsing blocks by pages, maybe adding a counter inside the blocks by tab would help.

kcne commented 2 months ago

Regarding the navigation limitations on the user blocks page, one possible solution would be displaying the count of blocks inside the open tab in braces. This would give users a clear context of how many blocks are available, which can be particularly helpful for moderators and others managing the list.

I've already implemented this locally. Please let me know if this approach aligns with what you're looking for, and if so, I can open a PR with these changes.

Screenshots:

Screenshot 2024-07-24 at 20 23 52 blocks-by-me blocks-on

Thank you!

AntonKhorev commented 2 months ago

Why in braces? I'm trying to convert such counters to badges, see https://github.com/openstreetmap/openstreetmap-website/pull/4872

kcne commented 2 months ago

I agree that in terms of UI it would look a lot cleaner so I will be happy to refactor according to that and leave screenshots when I do

Thanks for a quick response!

kcne commented 2 months ago

@AntonKhorev Quick update, refactored this using badges -> 97e7991 It would be nice to ping on #4872 for review so I can open a new PR for this.

Screenshot:

Screenshot 2024-07-25 at 13 57 36