The text labels are missing in the MQTT configuration dialog

I’ve been digging into the code again, this time just comparing the HTML between the working and not working labels versions. So turns out this element is missing altogether when the labels don’t show up:

<span id="label" class="mdc-floating-label mdc-floating-label--required mdc-floating-label--float-above"><!--?lit$239119405$-->Name</span>

And also the class directive for the input is different

mdc-text-field mdc-text-field--filled mdc-text-field--label-floating
^ when the labels show up

mdc-text-field mdc-text-field--no-label mdc-text-field--filled
^ labels don’t show up.

If I paste the missing stuff into the inspector of the one where it doesn’t work, the label does show up properly, so that indicates it’s just being formed wrong at some point.

Also, when the config flow is launched, it gets the flow config as json from the hass backend - that’s identical between the versions, so it looks like the frontend is just broken there for some reason.

Update: I seem to have found the js-function that creates the text fields, but I haven’t managed to figure out why it does that no-label variant on this installation.

More info:

I grabbed the arch linux package and put all the files in a local git repo → then rsync’d everything from the pip-package into it so I could see what the difference was. At quick glance, the difference is mainly that around 10 000 translation files are missing from the arch linux package! That might explain the situation.

1 Like

I figured it out! :partying_face:

For whatever reason, the Arch Linux package is missing all the translation files! So once I rsynced in all the .json files from the pip-package, the labels appeared. Woohoo :slight_smile:

I’ll see if I can figure out what needs to be changed in the PKGBUILD so that it’ll include the files in the future…

1 Like

You are awesome! :3
Thanks for the great work! -and thanks for updating the issue ticket :slight_smile:
Now, we have to wait that the package maintainer react. Please let me know when you know how to modify the PKGBUILD :slight_smile:

I think I found it. setup.py runs this after the same that the PKGBUILD does:

python3 -m script.translations develop --all

I’ll test it when I get a chance to.

1 Like

Yup, looks like that previous thing worked :slight_smile:
I built a package of the 2023.5.1 version like before, just added

python -m script.translations develop --all

in the build() function of the PKGBUILD after cd home-assistant. So it updates the translation files before it does the python build. (I don’t know if that would make more sense to do in the prepare() function?) Then I installed the package on my other raspberry pi, and the labels do indeed show up :slight_smile: There’s a bunch of dependency errors running that though, but that same thing should work with an older version just the same.

I’ll do one more test - the same build but without that translation update command, just to see if that’s indeed what causes the difference and not some other random occurrence.

Update: Yes, that was it :slight_smile: The same package without that command doesn’t show the labels.

1 Like

The maintainer of the package just replied that the fix is now in the repo :slight_smile:

Thanks again! I just updated my it and I can confirm that the issue is solved! I owe you something :3

1 Like