Skip to content

Rework export template dialog to allow individual templates#117072

Merged
Repiteo merged 2 commits into
godotengine:masterfrom
KoBeWi:template_shattering_event
Apr 16, 2026
Merged

Rework export template dialog to allow individual templates#117072
Repiteo merged 2 commits into
godotengine:masterfrom
KoBeWi:template_shattering_event

Conversation

@KoBeWi
Copy link
Copy Markdown
Member

@KoBeWi KoBeWi commented Mar 4, 2026

Closes godotengine/godot-proposals#647 (on the editor side at least)

DCrsRTre6i.mp4

This PR completely rewrites the template manager dialog. Instead of managing template packages, it now manages individual template files. The list of files is hard-coded, since it concerns only official templates and these are the same for a version.

You can see a list of individual installed templates and a list of templates available for download. The available templates can be downloaded individually. They are organized as Platform Family -> Platform -> Template -> File. Each of them have checkboxes, so you have fine-grained control on what you want to install. Once you hit the install button, the manager will start downloading, and is able to download multiple files at once. Closing the dialog does not cancel download, it can run in background.

As mentioned above, the dialog is completely rewritten, so it's easier to review the files as a whole, instead of changes. Note that Android-related methods are not changed (not sure why they are even in the dialog, if they aren't part of the dialog. It just happens to be called "template manager"). I left some debug options for easier testing, see comments below.

@AdriaandeJongh
Copy link
Copy Markdown
Contributor

Just going off of the video, I would expect every download that is done to immediately disappear from the bottom list and appear in the top list. (or give the downloaded item a hardcoded second or two at 100% for that extra completionist feel.)

How (or if at all) does this UI work with custom templates?

@KoBeWi
Copy link
Copy Markdown
Member Author

KoBeWi commented Mar 5, 2026

I would expect every download that is done to immediately disappear from the bottom list and appear in the top list. (or give the downloaded item a hardcoded second or two at 100% for that extra completionist feel.)

Currently the tree only updates all at once, because it's simpler. Moving items would require some logic to determine where to drop the element, which involves Tree searching and re-creating branches as necessary. I decided it's not worth it.

How (or if at all) does this UI work with custom templates?

It doesn't. At most I can add a Unknown/Extra category in Installed tree that lists unrecognized files.

@AdriaandeJongh
Copy link
Copy Markdown
Contributor

I would expect every download that is done to immediately disappear from the bottom list and appear in the top list. (or give the downloaded item a hardcoded second or two at 100% for that extra completionist feel.)

Currently the tree only updates all at once, because it's simpler. Moving items would require some logic to determine where to drop the element, which involves Tree searching and re-creating branches as necessary. I decided it's not worth it.

Can't you just update / recreate the whole tree every time something finishes downloading? We're talking about milliseconds of freeing and instantiating new nodes, are we not?

@KoBeWi
Copy link
Copy Markdown
Member Author

KoBeWi commented Mar 5, 2026

Can't you just update / recreate the whole tree every time something finishes downloading?

No, because the files that are still downloading would lose their metadata. I'd have to transfer it somehow to the re-created tree, which also requires some extra logic.

@KoBeWi KoBeWi force-pushed the template_shattering_event branch 2 times, most recently from 47895e4 to 483739b Compare March 10, 2026 22:12
@KoBeWi
Copy link
Copy Markdown
Member Author

KoBeWi commented Mar 10, 2026

Almost finished.

I would expect every download that is done to immediately disappear from the bottom list and appear in the top list.

I did that in the end.

godot.windows.editor.dev.x86_64_S2WtvgGzbg.mp4

I had to transfer metadata anyway, to properly display download errors. The code is terribly inefficient, but for ~30 template files it does not matter.

@KoBeWi KoBeWi force-pushed the template_shattering_event branch 2 times, most recently from 275079f to 9a2cc3e Compare March 15, 2026 23:31
Comment thread editor/export/export_template_manager.cpp Outdated
Comment thread editor/export/export_template_manager.cpp Outdated
@KoBeWi KoBeWi force-pushed the template_shattering_event branch from 9a2cc3e to 82ddcc0 Compare March 15, 2026 23:36
@KoBeWi
Copy link
Copy Markdown
Member Author

KoBeWi commented Mar 15, 2026

I think this should be ready 🤔

I updated the description and video. Definitely needs some testing, I'm not 100% sure I didn't forget anything xd
Note that this depends on #117448, as canceling downloads will result in corrupted templates and there is no way to detect that a template is corrupted (or at least I didn't implement one). See comments above for testing helpers, as obviously the new templates are not officially available.

mirrors_requester->connect("request_completed", callable_mp(this, &ExportTemplateManager::_mirrors_request_completed));
add_child(mirrors_requester);

for (int i = 0; i < 5; i++) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I suppose this could be an editor setting 🤔

@KoBeWi KoBeWi marked this pull request as ready for review March 15, 2026 23:37
@KoBeWi KoBeWi requested review from a team as code owners March 15, 2026 23:37
Comment thread editor/export/export_template_manager.cpp Outdated
@KoBeWi KoBeWi force-pushed the template_shattering_event branch 2 times, most recently from 904b409 to 14d6891 Compare March 16, 2026 00:38
Comment thread editor/export/export_template_manager.cpp Outdated
Comment thread editor/export/export_template_manager.cpp Outdated
@AdriaandeJongh
Copy link
Copy Markdown
Contributor

AdriaandeJongh commented Mar 16, 2026

Tested this. Thoughts:

  • I was confused by the disappearing 'Available Templates' panel for older versions, and I would suggest to keep the 3 panel layout at all times. So if there are no individual templates available for download, perhaps show the 'Available Templates' panel but with one faded out item that says 'No templates available for 4.5.1-stable' (or something like that) just like the 'No templates installed.' in the Installed Templates panel. It's a bit itchy that users are able to delete older templates but are not able to redownload those templates using this version of the engine. I do think it makes sense, but it's a bit of an awkward asymmetry.

  • I have no idea what ICU Data is, which begs the question whether the install options should have descriptions. Probably through tooltips. While some downloads are straight forward, many of them might not be. As a matter of fact I discovered there are many more templates than I thought there were because of this PR lol. For example, I have no idea what I should pick the '_console' windows templates for, what the difference is between web and web with extensions, or why the 'Web Single-Threaded' option has 'nothreads' in its name.

  • The iOS template being 3 layers deep for a single option is a bit awkward. Perhaps we can trim down the option tree to its highest common denominator for all the options (should there be others like this in the future, or at least to Mobile > iOS for this particular case. For both the available and installed templates.

  • The Android template was missing from the list for me. Not sure why.

  • The 'Open in Web Browser' immediately started downloading the full template package for me, which was unexpected. I expected it to open a web page where I could see the individual downloads or something. Not sure where you want to go with that button?

  • Likewise, what would people need the URL for that you get from 'Get Mirror URL'?

  • Instead of making the Install Templates button disappear while downloading, perhaps disable the button and give it the text 'Downloading Templates...'?

  • I didn't try to see how installed custom templates look in the window, but I assume it'll show up in the Installed Templates overview? How can one differentiate between official and custom templates there?

  • Maybe change 'Engine Version' To 'Godot Version'?

  • I can't make the engine version panel wider and it cuts off custom engine version names. Not sure if it's worth addressing because the tooltip does still show it, but just thought I'd mention it.

  • The 'download missing files' and 'download missing template' functionality is great!

  • When you hover over a download in progress in both the Available templates and Installed Templates windows, the progress disappears.

  • When there's downloads in progress, you can still select items in the Available Templates panel... but you can't queue the downloads then. And when the downloads are complete, the selection also disappears. All in all a bit awkward.

@KoBeWi
Copy link
Copy Markdown
Member Author

KoBeWi commented Mar 16, 2026

which begs the question whether the install options should have descriptions. Probably through tooltips.
ICU Data
_console' windows templates

These two are on different level. ICU Data is "template" while "_console" files are files (part of a template). I was considering adding descriptions for templates, but not for each individual file, not sure if it's worth it. The file list is also folded by default, because normally you don't need to interact with them. It's there for extra info for advanced users.

The 'Open in Web Browser' immediately started downloading the full template package for me, which was unexpected. I expected it to open a web page where I could see the individual downloads or something. Not sure where you want to go with that button?

That's the plan, but there is no such webpage yet :P See #117072 (comment)

Likewise, what would people need the URL for that you get from 'Get Mirror URL'?

idk, this option was there before. Could be useful for troubleshooting purposes maybe.

I didn't try to see how installed custom templates look in the window, but I assume it'll show up in the Installed Templates overview?

You can't install custom templates. They are usually configured in export presets (unless people actually do copy them to the templates folder?).

I can't make the engine version panel wider and it cuts off custom engine version names. Not sure if it's worth addressing because the tooltip does still show it, but just thought I'd mention it.

Yeah, I was considering adding another SplitContainer, but thought that the list is wide enough by default 🤷‍♂️

When you hover over a download in progress in both the Available templates and Installed Templates windows, the progress disappears.

That's because of hover style taking over. Not sure how to resolve that, it can be changed only for the whole Tree.

@AdriaandeJongh
Copy link
Copy Markdown
Contributor

The Get Mirror URL option and the Open in Web Browser kind of lead to the same thing. I'd probably remove the Get Mirror URL option until there is actual demand.

I didn't try to see how installed custom templates look in the window, but I assume it'll show up in the Installed Templates overview?
You can't install custom templates. They are usually configured in export presets (unless people actually do copy them to the templates folder?).

Admittedly I did this for Rift Riff when we needed a cherrypick fix for a specific platform. But generally I agree that the custom template field in the export preset should be used. And yeah, I tend to agree that those shouldn't be part of this window. But when someone makes a custom build of Godot + templates, those will show up, right?

@KoBeWi
Copy link
Copy Markdown
Member Author

KoBeWi commented Mar 16, 2026

I'd probably remove the Get Mirror URL option until there is actual demand.

That would make a menu with single option 🤔 I guess it could be a simple button then.

But when someone makes a custom build of Godot + templates, those will show up, right?

Editor and templates are separate builds that don't know about each other. But if you have a custom build, you can easily add custom templates to the list, by modifying the _initialize_template_data() method. (this can also be easily extended to add templates via plugins, but that's something for a new proposal)

@KoBeWi KoBeWi force-pushed the template_shattering_event branch from d41a115 to 1e1fa84 Compare March 27, 2026 16:46
@AdriaandeJongh AdriaandeJongh moved this from For team assessment to In Progress in Usability Team Review Tracker Apr 2, 2026
@AdriaandeJongh AdriaandeJongh moved this from In Progress to Merge Ready in Usability Team Review Tracker Apr 10, 2026
@KoBeWi KoBeWi force-pushed the template_shattering_event branch from 1e1fa84 to dda7043 Compare April 15, 2026 12:57
Copy link
Copy Markdown
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

Seems to be working as expected. Code looks good.

I would not list *console.exe wrapers as separate items, since these are tiny and not useful on their own, but it is fine to keep it as is (might make more sense to change Windows template structure to use ZIPs in the future).

Comment thread editor/export/export_template_manager.cpp Outdated
@KoBeWi KoBeWi force-pushed the template_shattering_event branch from dda7043 to db1829b Compare April 15, 2026 13:27
Comment thread editor/export/export_template_manager.cpp
@KoBeWi KoBeWi force-pushed the template_shattering_event branch from db1829b to 32ed89c Compare April 15, 2026 13:57
Copy link
Copy Markdown
Member

@Alex2782 Alex2782 left a comment

Choose a reason for hiding this comment

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

Looks good!

Tested with https://godotengine.org/mirrorlist/4.7.dev4.json
and code for Zip and HTTP requests checked.


The configuration/settings icon for downloading all files might be confusing for some users. I would simply display the download icon again if there aren't any more suitable icons available.

Image

@KoBeWi
Copy link
Copy Markdown
Member Author

KoBeWi commented Apr 15, 2026

It's a different action than downloading the whole template, so IMO it needs a different icon than regular download. I'm open to suggestions, it has to convey "repairing".

@akien-mga akien-mga modified the milestones: 4.x, 4.7 Apr 15, 2026
Comment thread scene/gui/tree.cpp
Comment on lines +1464 to +1466
if (p_index < 0) {
p_index += cells[p_column].buttons.size();
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This new behavior should be documented in the TreeItem class reference.

Copy link
Copy Markdown
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally, it works as expected.

Some feedback:

  • With this PR, it's no longer possible to install a .tpz file in the editor. I don't think this was used often in the 4.x days (as third-party builds that were available for multiple platforms became rarer), but it's worth noting.

  • When in offline mode, "Error getting the list of mirrors" still shows up when using a development build after a small delay:

Image
  • Removing export templates should have a confirmation dialog, as there's no way to undo the operation. While official templates can be easily redownloaded, this is not the case if you are far away from an Internet connection, or if you installed third-party export templates.

    • The confirmation dialog could be skipped by holding Shift when clicking the delete icon.

For future PRs:

  • There should be a way to remove all export templates for an associated version, so you can quickly clean up old data after upgrading to a new version.

    • In the long term, it might be worth deprecating the concept of a .tpz file and switch to a flat structure with ZIP files directly being downloaded (likely after moving the Windows/Linux templates to ZIPs). This could simplify the editor code significantly, and allow for CI platforms to download specific platforms easily.

    • Alternatively, we could add a command line argument to download specific platforms for CI usage, but this requires a Godot process to be spun up, which takes more time to start than curl or wget.

@KoBeWi
Copy link
Copy Markdown
Member Author

KoBeWi commented Apr 16, 2026

Removing export templates should have a confirmation dialog, as there's no way to undo the operation. While official templates can be easily redownloaded, this is not the case if you are far away from an Internet connection, or if you installed third-party export templates.

They are moved to trash, so technically you can undo it.

@KoBeWi
Copy link
Copy Markdown
Member Author

KoBeWi commented Apr 16, 2026

With this PR, it's no longer possible to install a .tpz file in the editor. I don't think this was used often in the 4.x days (as third-party builds that were available for multiple platforms became rarer), but it's worth noting.

I originally didn't re-implement it, because the TPZ files were supposed to be gone, and now there is not much space for that. I was planning to add it in a follow-up

When in offline mode, "Error getting the list of mirrors" still shows up when using a development build after a small delay:

Should be fixed.

so technically you can undo it.

Added confirmation anyway.

image

There should be a way to remove all export templates for an associated version, so you can quickly clean up old data after upgrading to a new version.

For now you can open the directory and delete it manually.

@KoBeWi KoBeWi force-pushed the template_shattering_event branch from 32ed89c to 2f079a1 Compare April 16, 2026 11:18
@Repiteo Repiteo merged commit e5d0a8d into godotengine:master Apr 16, 2026
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Apr 16, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow downloading individual export template TPZ files for each platform

9 participants