"Install this theme component" doesn't display any information after a 502 error

AI-generated summary

Canapin reports that when attempting to install a theme component via a remote Discourse URL, entering an invalid or non-working domain (e.g., discourse.canapin.com instead of discourse.canapin.dev) results in no visible feedback — the “Install” button remains greyed out, and users are unaware of the underlying 502 error, which only appears in browser dev tools. Canapin suggests displaying an error message regardless of the HTTP status code and adding a loading indicator next to the “Install” button if the operation takes longer than expected, citing the fast-edit button’s loading icon as a good example. In a follow-up post Canapin notes that entering uppercase characters in the URL also triggers an error, and proposes that the input should be automatically lowercased before processing to avoid such issues. The issue is acknowledged as rare but recurring for the user, and the request centers on improving UX through clearer feedback and input normalization.

I think it’s a fairly rare case, but still… :slight_smile:

Theme components often have this button to install the theme component on a remote Discourse:
image

Here, I entered discourse.canapin.com instead of discourse.canapin.dev. The first domain leads to a non-working IP, a remnant of past experiments. :slight_smile:

Then, there’s no error message. The “Install” button stays greyed out, and nothing happens:

After a while, https://meta.discourse.org/theme-install-checker.json obviously returns a 502 error, but it’s only visible in the network tab of the browser’s dev tools.

I’m not sure something should be done about this, but since I keep mixing up my domains, it led me to this situation a couple of times and I didn’t get what was wrong (because there was no error displayed).

Maybe a message should be displayed, whatever the error number is.

Maybe a loading icon should be added next to “Install” in the button if the operation takes more time than usual.

:slight_smile:

edit: I saw that there’s a cool loading icon on the fast edit button. Something like this would fit:

3 Likes

It also throws an error when we put an uppercase character in a URL:

I’m not 100% sure of URLs specs, but maybe the code should lowercase the string before triggering the script?