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

Add package update detection on Content tab #13807

Merged
merged 10 commits into from Oct 28, 2023

Conversation

rubenwardy
Copy link
Member

@rubenwardy rubenwardy commented Sep 14, 2023

Fixes #7327 and fixes #11799

Minetest now shows available updates for content without opening the ContentDB dialog. This uses the new updates API, which is quite fast to load (35ms + network latency, without cache)

image
image

To do

This PR is Ready for Review

How to test

  • Install some content from the ContentDB dialog
  • Edit the .conf file to reduce the release number
  • Change tab to Start Game and Restart Minetest
  • See a number on the content tab
  • Change tab to Content and see packages with update icons
  • Restart Minetest, see content tab. Number and icon should appear shortly

@SmallJoker SmallJoker added the Rebase needed The PR needs to be rebased by its author. label Sep 17, 2023
@rubenwardy rubenwardy added Roadmap The change matches an item on the current roadmap. and removed Rebase needed The PR needs to be rebased by its author. labels Sep 17, 2023
@rubenwardy rubenwardy force-pushed the contentdb_update_detection branch 2 times, most recently from 9dc416f to 9ac023d Compare September 18, 2023 11:54
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.

A high-level review:

  • I'm not sure what I think about the "update available" icons. When I see one of these icons in the package list, I think that you can update the package when you select it, or that clicking on the icon will update the package. But actually you have to click on "Browse online content" before you can download any updates.

  • There is too much text on the "Browse online content" button. With the default scaling settings, it looks like this on my Android device:
    button in english
    The text overflows, but it's still understandable. But if you translate it into German, the text overflows to an extent that it becomes unintelligible:
    button in german

    I suggest reducing the label to Browse online content ($1).

  • To make it more clear that $1 in Content ($1), Browse online content ($1) and Update All [$1] refers to the same number, I suggest using the same kind of brackets in all three places.

  • This is a very useful feature btw.

@rubenwardy
Copy link
Member Author

rubenwardy commented Sep 23, 2023

I'm not sure what I think about the "update available" icons. When I see one of these icons in the package list, I think that you can update the package when you select it, or that clicking on the icon will update the package. But actually you have to click on "Browse online content" before you can download any updates.

I wondered the same

Options:

  1. Change the icon

  2. Remove the icon (I think it's useful to know which packages before opening the dialog)

  3. Add an [Update] button when selecting a package that opens the ContentDB dialog and starts the update. This actually wouldn't be too hard, you'd pass in an additional argument that is checked after the package list loads. This argument could be used in future for Support minetest:// custom browser protocol #7400

    Although, the Content tab will probably be removed in the future - perhaps in 5.9.0 - and replaced by a unified content and ContentDB dialog, so maybe not the best idea to do extra work here

@grorp
Copy link
Member

grorp commented Sep 27, 2023

  1. Add an [Update] button when selecting a package that opens the ContentDB dialog and starts the update. This actually wouldn't be too hard, you'd pass in an additional argument that is checked after the package list loads. This argument could be used in future for Support minetest:// custom browser protocol #7400

Since #13850 implements the additional argument to create_store_dlg you mentioned, option 3 should be really easy to implement after that PR, so I'm in favor of option 3.

@ancientmarinerdev
Copy link

A comment from another PR that is probably more relevant here:

"do you have any plans in the future to give notifications if there are games that need updating? Perhaps when you're on the page to play that game "This game has an update available for it", and maybe a notification if you try to play without updating it or mods selected for that world would be good UX so you get that information as you need it. "The world you have chosen has the following updates: ..." and "Update" or "Play anyway" as options."

#13850 (comment)

@rubenwardy
Copy link
Member Author

That's something for the future, after this PR is merged

@ancientmarinerdev
Copy link

That's something for the future, after this PR is merged

Understandable. Thanks for considering it.

@sfan5 sfan5 removed their request for review October 2, 2023 12:58
@sfan5 sfan5 added the Rebase needed The PR needs to be rebased by its author. label Oct 2, 2023
@Zughy
Copy link
Member

Zughy commented Oct 2, 2023

@rubenwardy rebase needed

@rubenwardy
Copy link
Member Author

rubenwardy commented Oct 8, 2023

There's now an update button. Need a better place to put it, as there won't be enough space for the text / etc on smaller screens and different languages

image

Perhaps the description could be made shorter, and the button placed there above the existing buttons

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.

Perhaps the description could be made shorter, and the button placed there above the existing buttons

That's a good idea, but I'd prefer this layout: grorp@9cb47b8

screenshot

It gives more space to the "Use Texture Pack" button. On the master branch, the text on that button overflows on my Android device.

EDIT: BTW, it looks like you didn't take the modpack "Rename" button into account for the current button arrangement. I'd be open to removing that button altogether, but of course that's not for this PR.

builtin/mainmenu/content/update_detector.lua Outdated Show resolved Hide resolved
builtin/mainmenu/tab_content.lua Outdated Show resolved Hide resolved
builtin/mainmenu/content/pkgmgr.lua Outdated Show resolved Hide resolved
builtin/mainmenu/content/update_detector.lua Show resolved Hide resolved
builtin/mainmenu/content/update_detector.lua Outdated Show resolved Hide resolved
builtin/mainmenu/tab_content.lua Outdated Show resolved Hide resolved
builtin/mainmenu/content/pkgmgr.lua Outdated Show resolved Hide resolved
builtin/mainmenu/content/pkgmgr.lua Outdated Show resolved Hide resolved
@rubenwardy rubenwardy added this to the 5.8.0 milestone Oct 27, 2023
@Zughy Zughy removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Oct 27, 2023
Copy link
Member

@srifqi srifqi left a comment

Choose a reason for hiding this comment

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

This does not work for minetest_game (Minetest Game) or any game that ends with _game because the IDs do not match.

// Add it to result
const char *ends[] = {"_game", NULL};
std::string shorter = removeStringEnd(dln.name, ends);
if (!shorter.empty())
gameids.insert(shorter);
else
gameids.insert(dln.name);

@rubenwardy
Copy link
Member Author

Fixed

Copy link
Member

@srifqi srifqi left a comment

Choose a reason for hiding this comment

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

This PR looks good to me.

Minetest content update detection running on Android

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.

You can start multiple, simultaneous downloads for the same package by

  1. clicking "Update" (which opens the ContentDB dialog)
  2. leaving the ContentDB dialog
  3. and clicking "Update" again

A related issue is #11799, but I can't reproduce that one.

src/script/lua_api/l_util.cpp Outdated Show resolved Hide resolved
@grorp grorp added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Oct 28, 2023
@rubenwardy rubenwardy removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Oct 28, 2023
@rubenwardy rubenwardy requested a review from grorp October 28, 2023 14:52
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.

Very nice!

@rubenwardy rubenwardy merged commit 4ee32c5 into minetest:master Oct 28, 2023
15 checks passed
@rubenwardy rubenwardy deleted the contentdb_update_detection branch October 28, 2023 16:33
cx384 pushed a commit to cx384/minetest that referenced this pull request Dec 9, 2023
kawogi pushed a commit to kawogi/minetest that referenced this pull request Dec 19, 2023
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. >= Two approvals ✅ ✅ UI/UX
Projects
None yet
7 participants