"Your topic is similar to..."-box has class=hidden

AI-generated summary

A CSS issue in Discourse causes the ‘Your topic is similar to…’ banner to remain hidden due to the class="hidden" being applied to an element that should be visible. This conflicts with a global CSS rule .hidden { display: none !important; }, which was added under the assumption that all elements with .hidden should be hidden. Bas reported the problem, noting it’s low priority. BennyInc confirmed the bug persists in Discourse 2.6.0.beta2 — the similar topics container is populated via API but stays invisible due to the CSS. They traced the regression to a specific commit 5a34c7c related to a guest gate plugin discussion here. michaeld verified the issue on meta.discourse.org. j.jaffeux submitted a fix in PR #10701, currently awaiting review. The bug results in users not seeing similar topics, potentially leading to topic duplication.

The your topic is similar to… banner:

Has class="composer-popup hidden similar-topics ember-view"

This kind of clashes with an assumption that a dev on our side made, namely that everything with .hidden should be … hidden :slight_smile:

So he put a

.hidden { 
   display: none !important;
}

in the CSS somewhere.

Could be nice not to put class=hidden on things that should not be hidden :slight_smile:

Hmm not sure, perhaps @Johani could have a look.. low priority.

Indeed, didn’t expect this to be a Prio 1 :wink:

Is this addressed in a bug somewhere?
I am running a new Discourse 2.6.0.beta2 at the moment, and the “similar topics” view never shows up.

Checking with dev tools, the request to load similar topics is made, and the similar-topics div is populated with content. It has the class hidden however, leading to display:none !important; through helpers.scss.

So my users won’t ever see similar topics, resulting in duplicated topics here and there.

Just found this commit, that apparently broke this: FIX: Adds important declaration to `.hidden` utility/helper class · discourse/discourse@5a34c7c · GitHub

The change is under discussion here: Guest Gate (Sign Up Popup Plugin) - #55 by michaeld

I can repro this issue here on meta as well, seems like it is indeed the same.

I think that should fix it:

Awaiting review on our side.