[Merged] PR #5131: Addon Manager Redesign

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

[Merged] PR #5131: Addon Manager Redesign

Post by chennes »

I could use some testers for the newly-refactored Addon Manager. Details in the PR. It's mostly under-the-hood changes that implement support for the new package.xml metadata file, and for preference packs, but there are a few user-interface tweaks in there as well:

Edited to add: As the PR evolved I ended up changing the UI much more significantly after all: see post below.

Here's what it looked like at the beginning of this PR:
AddonManagerRefactor.PNG
AddonManagerRefactor.PNG (136.11 KiB) Viewed 7494 times
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: PR #5131: Addon Manager Refactor

Post by openBrain »

Indeed those are massive changes hard to review from a mobile. :)
Just a question : what is the currently minimal Python version required for FreeCAD? I saw you're using some "recent" features. ;)
And another one not directly linked : is there a thread already to discuss metadata system?
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #5131: Addon Manager Refactor

Post by chennes »

We require Python 3.6 for 0.20 -- I don't think I used anything that required anything newer than that, but please let me know if you see something.

The main (recent) metadata discussion is here.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: PR #5131: Addon Manager Refactor

Post by openBrain »

ATM I just saw function annotations and f-strings which were (IIRC) respectively introduced in 3.3 and 3.6, so everything looks fine. Just backporting could eventually be a problem. ;)
marcin86
Posts: 92
Joined: Fri Dec 20, 2019 1:20 pm
Location: Poznan/Poland

Re: PR #5131: Addon Manager Refactor

Post by marcin86 »

chennes wrote: Wed Oct 27, 2021 6:54 pm I could use some testers for the newly-refactored Addon Manager. Details in the PR. It's mostly under-the-hood changes that implement support for the new package.xml metadata file, and for preference packs, but there are a few user-interface tweaks in there as well:


AddonManagerRefactor.PNG
Hello Chennes!
I have question to new "Addon manager" - will be updated in weekly built in next sunday?
Have nice day!
Marcin
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #5131: Addon Manager Refactor

Post by chennes »

I'd prefer to get a few other people to test it in PR form before I merge it, so I don't know if I'll make it into this week's weekly, or wait until next.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
Chris_G
Veteran
Posts: 2580
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: PR #5131: Addon Manager Refactor

Post by Chris_G »

Would it be possible to cache the addon data that is fetched at Addon Manager startup ?
I, as an example, have a slow internet connection (180 kB/s) so every Addon Manager startup is around 1mn 20s long.
It would be great to have a Refresh button in the Addon Manager window (maybe with a text, next to it, saying "last refresh on 2021/10/21"), and maybe a parameter to configure the refresh policy :
- always = on every Addon Manager startup
- on first Addon Manager startup of a FC session
- manual (the refresh button)

Also, the workbenches that have a metadata file, don't get their README.md displayed.
Would it be possible to display either the README, below the metadata, or another specific AddonManager.md file so that the workbench author can have control on the presentation of the workbench into the Addon Manager ?
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #5131: Addon Manager Refactor

Post by chennes »

Chris_G wrote: Sat Oct 30, 2021 9:54 am Would it be possible to cache the addon data that is fetched at Addon Manager startup ?
Yes - in fact, the metadata is already being cached, but so few repos have it that it's unnoticeable. I'd like to institute caching of the READMEs as well, but that won't happen in this PR. It's on my radar: even on a fast internet connection, it seems stupid for a second launch of AM in the same FreeCAD session to take so long. I like your parameter suggestion, I'll file it away for when I'm working on that project. I'd really like cache reload to happen in the background, so you can continue to use the AM even while that's processing.

Also, the workbenches that have a metadata file, don't get their README.md displayed.
Would it be possible to display either the README, below the metadata, or another specific AddonManager.md file so that the workbench author can have control on the presentation of the workbench into the Addon Manager ?
I want to move us away from having to scrape the HTML of the README from an online renderer: so my ideal solution is to display the README (which would be cached, of course) only if the user has the Markdown library installed. The HTML scraping only works for Github right now, and is very fragile.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #5131: Addon Manager Refactor

Post by chennes »

OK, I redesigned the GUI, taking some more cues from @mnesarco's ExtMan. It looks and works much more like e.g. Ubuntu's software manager now, including displaying the README.md file wholesale whenever possible. I will talk to the packagers about getting the Markdown library included as part of the normal FreeCAD installation so we can eliminate the scraping code eventually.

I also implemented much more aggressive caching of the downloaded data, so the whole thing should feel faster now, especially after the first cache is done. Basically everything that is ever downloaded is cached, with a user-configurable cache lifetime. And the GUI should be responsive even while the macro list and metadata cache are being updated, and the update check is being conducted.

Here's how it looks now:

Expanded view
ExpandedView.png
ExpandedView.png (78.81 KiB) Viewed 5473 times
Compact view:
CompactView.png
CompactView.png (84.67 KiB) Viewed 5473 times
Details page:
Details.png
Details.png (101.44 KiB) Viewed 5473 times
mnesarco wrote: Ping
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
mnesarco
Posts: 447
Joined: Thu Mar 26, 2020 8:52 pm

Re: PR #5131: Addon Manager Redesign

Post by mnesarco »

Hi @chennes, it looks pretty good. Nice work.
Post Reply