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

[NoSquash] Redesign ContentDB dialog #14510

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

rubenwardy
Copy link
Member

@rubenwardy rubenwardy commented Apr 1, 2024

A redesign of the ContentDB dialog to show more information and make better use of space.

Part of #6733

Depends on #14507

Screenshots

image

image

image

To do

This PR is Ready for Review

  • Add reviews (or hide tab for now)
  • Fix package grid on smaller screens (should probably reduce number of items per page?)
  • Add website, issue tracker, repo, and donate urls somewhere
  • Make featured status more clear
  • Wrap short desc tooltips (not an issue with this PR)
  • Add icon for installed, remove unused icons
  • Add Resize event to update formspec when the window changes size (leave for later)
  • Put title and author on separate lines, to reduce risk of clipping
  • Wider pagination buttons, hard to tap on android
  • ContentDB backend: one-line formatting for information
  • ContentDB backend: improve link contrast
  • Fix downloading icon not showing in package list
  • Better featured icon future PR
  • Fix link buttons overlapping "Back" on smaller screens
  • Better package tile icon contrast
  • Respect Android safe zone?

Known Issues

Known issues that I'm not planning on fixing in this PR (unless there's a simple fix):

How to test

  • View lots of packages and use every feature:
    • Installing
    • Updating
    • Removing
    • Autoinstall
    • Search, filter, pagination

@rubenwardy rubenwardy added WIP The PR is still being worked on by its author and not ready yet. Roadmap The change matches an item on the current roadmap. Feature ✨ PRs that add or enhance a feature @ Mainmenu @ Content / PkgMgr Waiting (on dependency) Waiting on another PR or external circumstances (not for rebases/changes requested) labels Apr 1, 2024
@rubenwardy
Copy link
Member Author

simplescreenrecorder-2024-04-01_19.32.41.mp4

@rubenwardy rubenwardy force-pushed the contentdb-redesign branch 3 times, most recently from 52551ac to e78e885 Compare April 1, 2024 20:30
@rubenwardy rubenwardy marked this pull request as ready for review April 1, 2024 20:31
@rubenwardy rubenwardy removed the WIP The PR is still being worked on by its author and not ready yet. label Apr 1, 2024
@rubenwardy rubenwardy force-pushed the contentdb-redesign branch 3 times, most recently from fb0a74a to 0602e50 Compare April 2, 2024 17:19
@grorp
Copy link
Member

grorp commented Apr 4, 2024

I'm giving some feedback on the UI since that's an easy thing to do :)

  • It's very cool.

  • As always, I still have things to complain about:

    • The "currently downloading" icon is only shown in the package dialog, not in the package list.

    • The package dialog has a different size while loading than after loading (not very grave).

    • Regarding the package information tab:

      current - you have to scroll to see all the information

      a proposal - you can see all the information at once

      local hypertext = info.info_hypertext.head .. info.info_hypertext.body:gsub("\n<b>", ": <b>"):gsub("\n\n", "<style size=8>\n\n</style>")
    • The icons are hard to see on some screenshots - a solution could be giving them a transparent black background or a drop shadow.
      screenshot

    • On Android, the package list uses the available space poorly and many package titles are cut off (screenshot taken from emulator).

    • On Android, the package dialog uses the available space poorly and it's virtually impossible to read the long description (screenshot taken from emulator).

@rubenwardy
Copy link
Member Author

rubenwardy commented Apr 4, 2024

The "currently downloading" icon is only shown in the package dialog, not in the package list.

Sounds like a bug, as there is code for this: https://github.com/minetest/minetest/pull/14510/files#diff-64584e870acd6076965d3fd26c9a538de7ecc5c1bc8fa7003a013006c7dc1fa8R363

On Android, the package list uses the available space poorly and many package titles are cut off (screenshot taken from emulator).

I'll have to reduce the num_per_page on Android to 5-10 because of this. Currently, it attempts to fit 15 tiles on the page as big as it can

@rubenwardy
Copy link
Member Author

With latest commit, Android screenshots. Need a better way to show links on the package dialog

image

image

@grorp
Copy link
Member

grorp commented Apr 4, 2024

This unfortunately isn't much better on my real device. There's still a lot of free space and titles are still cut off. Also, hardcoding a different number of items per page based on OS feels like a bad approach to me. This could use enable_touch instead.

Maybe it would make more sense to have a minimum tile size and then determine the number of tiles per page based on that? Something like CSS grid grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));

screenshot

(I couldn't test the package dialog changes because the long description isn't shown anymore.)

@rubenwardy rubenwardy marked this pull request as draft April 4, 2024 19:24
@rubenwardy rubenwardy added the WIP The PR is still being worked on by its author and not ready yet. label Apr 4, 2024
@rubenwardy
Copy link
Member Author

rubenwardy commented Apr 4, 2024

This could use enable_touch instead.

The number of items per page can't change at runtime, so it would need to use the value of enabled_touch when opening the dialog.

This unfortunately isn't much better on my real device.

I plan on moving the title and author names onto separate lines, this would avoid the clipping issues

Maybe it would make more sense to have a minimum tile size and then determine the number of tiles per page based on that? Something like CSS grid grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));

The problem with changing the number of items based on window size is that the player could resize their window and lose their position. So num_per_page needs to be fixed at runtime - at best you could use the window size when opening the dialog

(I couldn't test the package dialog changes because the long description isn't shown anymore.)

Fixed

rubenwardy marked this pull request as draft

Feedback is welcome, but there's a lot in the to do list and #14507 needs to be reviewed and merged first

@rubenwardy
Copy link
Member Author

I can't reproduce the <action><img> bug any more, so applied your patch

@rubenwardy
Copy link
Member Author

Such as great improvement ! Unfortunately, I got this error just after clicking on a mod. I tried with several, so it's not only the mod fault ; and the content of the error seems to be mainmenu-related

Rebase error, fixed

The "currently downloading" icon is only shown in the package dialog, not in the package list.

Fixed, the animated_image was missing an argument

Would it be possible to add a dropdown beside from the Install button to choose the version we're installing ?

It's possible but not something I want to do in this PR

The + XX / XX / - XX is ok for ContentDB, but maybe Minetest could display + and - icons and display it in a column ?

It's more complicated to do this without the text overlapping or scrolling, I'd rather leave it as is - can be improved in future PRs

Maybe the used by could be added at the end of the page, following the layout of ContentDB ? Or in a special tab

This is something for a future PR imo

Related, featuring By the same author ?

Something for a future PR

It is necessary to know the exact µs of the addition ? Not, but it is written.

I assume you mean the download size? It's shown with the nearest significant unit, I think it's relevant.

@rubenwardy
Copy link
Member Author

You've change the aspect ratio of the thumbnails here.

I haven't, they're still 3:2.

Please may you provide the max_formspec_size so I can reproduce your exact set up

Copy link
Member

@grorp grorp left a comment

Choose a reason for hiding this comment

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

Thanks for fixing and applying my patch!

Please may you provide the max_formspec_size so I can reproduce your exact set up

Here you go (fresh installation, all settings at their default values):

{
	touch_controls = false,
	real_gui_scaling = 3,
	real_hud_scaling = 2.5500001907349,
	size = {
		y = 1080,
		x = 2412
	},
	max_formspec_size = {
		y = 10,
		x = 22.333333969116
	}
}

builtin/mainmenu/content/dlg_package.lua Outdated Show resolved Hide resolved
@rubenwardy
Copy link
Member Author

Ok, so the reason why it chooses to do 5 columns is because 4 columns is too tall for the available space:

Fitting, row_cells=4, required_height=7.19, avail_height=7.15

What I can do is add 0.05 - 0.1 to the available height to allow it to go slightly into the margin

I added a red box[] to show the available space. The two green boxes are the same size and show the 0.375 padding above and below the available space. See how the tile goes into the 0.375 when there are 4 columns

image

@grorp
Copy link
Member

grorp commented Apr 15, 2024

Found another thing:

screenshot showing ugly queued install button background

@grorp
Copy link
Member

grorp commented Apr 15, 2024

Ok, yeah, that's very close. Your proposed solution sounds good to me. In the end, going a little bit into the margin is probably better than wasting a lot of space. Thanks for investigating.

@rubenwardy
Copy link
Member Author

Ok, added the 0.1 and also hid the queued icon background

@rubenwardy
Copy link
Member Author

The grid/flex code can always been improved in future PRs, especially if we get a new GUI API with a flex component!

@rubenwardy rubenwardy force-pushed the contentdb-redesign branch 2 times, most recently from ed45e35 to 3ce07c1 Compare April 17, 2024 17:56
@rubenwardy rubenwardy marked this pull request as ready for review April 17, 2024 17:57
@rubenwardy rubenwardy removed the WIP The PR is still being worked on by its author and not ready yet. label Apr 17, 2024
@grorp
Copy link
Member

grorp commented Apr 20, 2024

How did you determine the values for "Respect Android safe zone"? Why is there so much left margin in the package list, but no left margin in the package dialog?

@rubenwardy
Copy link
Member Author

rubenwardy commented Apr 29, 2024

How did you determine the values for "Respect Android safe zone"? Why is there so much left margin in the package list, but no left margin in the package dialog?

It's a magic value based on my phone screen. Perhaps you could call the Android APIs to determine how much space, but maybe just having a margin of two all around on Android would make sense. And yes, the package view should do a similar thing

image

@rubenwardy
Copy link
Member Author

rubenwardy commented Apr 30, 2024

Based on suggestions by Zughy. To do: make check green and add author name to tooltip

image

@grorp
Copy link
Member

grorp commented May 8, 2024

Since there was a complaint about the dialog being too dense/crowded, I experimented a bit. I think the version with a bit more space looks better, but this probably depends on screen size. And then there's also Android, where the current version is probably better.

this PR (92d89bc)
screenshot 1

some more space (grorp@658d77e)
screenshot 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Content / PkgMgr Feature ✨ PRs that add or enhance a feature @ Mainmenu Roadmap The change matches an item on the current roadmap.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants