Discourse version upgrade cause data loss (aria-label) on DOM elements properties

AI-generated summary

After upgrading to Discourse version 2.8.0.beta6, the aria-label property was missing from the reply button DOM element in topic page footer buttons. This change caused issues due to custom CSS relying on this property. joffreyjaffeux explained that the removal was intentional, as the reply button is a standalone {{d-button}} and styling based on aria-label is not a good practice. merefield asked why, and joffreyjaffeux clarified that the aria-label value depends on locale and is prone to change.

Hi,

We have customized the default discourse site at discourse version between (2.3 - 2.6). In the mentioned versions, we have applied custom CSS to hide the reply button in topic page footer buttons based on the value of element property aria-label.

After upgrading the discourse version to 2.8.0.beta6, the property aria-label was missing for reply button DOM element. But other buttons like share, bookmark, flags, etc.., still having the aria-label property in topic page footer buttons. Because of this behavior, we are facing an issue.

Before upgrading to version 2.8.0:

After upgrading to version 2.8.0

Is discourse version 2.8.0.beta6 upgrades was modified or ignored the any properties in page DOM elements ?

You are correct, it appears to be missing.

Looks like the value of aria-label is calculated here: discourse/register-topic-footer-button.js at 362c47ce6a87783808cb4417912a75250f003bf8 · discourse/discourse (github.com)

Looks like there was work on this only 6 days ago?:

DEV: adds a new topic footer dropdown api by jjaffeux · Pull Request #14747 · discourse/discourse (github.com)

Although the reply button is not coming from this, it’s a standalone {{d-button}}

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/templates/components/topic-footer-buttons.hbs#L59

The change is coming from this commit:

https://github.com/discourse/discourse/commit/d51d94f771cc5912374a24c030f6965fdacbcb7a

I’m sorry but we have no reason to add back this aria-label here, styling based on aria label is not a good practice.

Is that because the value depends on locale?

Yes exactly, that’s very prone to change too :+1: