Why is the main page randomly duplicating "New" and "Unread"?

There’s something weird going on here. See pic below.

For some boards, the main page will sometimes duplicate the “New” and “Unread” links.
When a board has duplicated links, they will often show different numbers even though they are both supposedly linking to the same thing.

For other boards it won’t show duplicated links. Those other boards will just have the expected single links for “New” and “Unread”.

The duplicates seem to occur in some, but not all, of the last boards in each category. Anyone know WTF is going on here? It’s going to be a real PITA for theming, so figuring it out would be useful. Is it an admin setting?

Edit: Just checking a bit closer - when a board has the duplicated links it seems that the lower line of links is the one that is usually shown, while the upper line of links is the apparently random one. This random line also has no visible markup associated with it, just to make things easier. It must be injected by Discourse’s back end scripting somehow, without allowing people anything to target.

I effing hate it when devs do shit like this. They’ll make most things doable, then decide to screw you up on some details just because they can. Then tell you how wonderful their codebase is. :stuck_out_tongue:

This is a custom theme, I cannot provide support for that sorry.

I’m not asking you to support it. I’m just pointing out that DIscourse is apparently randomly duplicating content.

The custom theme is just CSS changes. Minor presentation stuff. There are no changes to markup or javascript, so what’s being generated on the page is coming straight from your installation of Discourse.

I cannot make Discourse generate extra markup. No can do. I can only play with presentation of the markup that is being fed to me. If it’s doing this on that custom theme, it is probably doing it on any other theme.

Yeah that could be. It would be best to report that issue on meta.discourse.org so the developers can look in to it - they’re usually very responsive.

I don’t want to be rude, but I’m really not into debugging other people’s stuff these days. I have little interest in making yet another online account to file a bug report on someone else’s software, and then follow that through any and all resulting rigmarole.

If someone already has an account over that and wants to file a bug report, I’m happy for them to nick any content out of this thread.

Sorry, but I have enough on my plate as it is. When this becomes an issue for the officially supported themes here on Blender Artists I’ll report it.

Fair enough. I’ll try running without the custom CSS and see if the same thing pops up. I’m happy to test it that far. Will let you know if anything happens.

1 Like

Ok, my bad. Turns out it was a CSS problem. Will note the cause and solution here just in case it’s useful to anyone else.

I was using float:right; to set the .subcategory>.ember-view spans (the elements that hold the new and unread counts) over to the right of each board’s row.

This was kicking them down one row, which is behaviour I don’t remember seeing since IE7 was a thing. Consequently, it had slipped my mind. Anyway, this resulted in the span for the second last board being shunted down to the last board, with the span for the last board then sitting underneath that.

I still have no idea why the browser’s element inspector couldn’t pick up the relevant markup, but it couldn’t. Usually, having a child elements shunted outside of the visible boundary of the parent element won’t screw up browser dev tools, but for some reason it did in this case. It may be something to do with the unusual way that Discourse generates content.

Once I twigged to WTF was going on the solution was simple: ditch the floats, use relative positioning on .subcategory and absolute positioning on .subcategory>.ember-view, which looks the same but doesn’t have any weird positioning glitches. And, as a bonus, the browser’s element inspector can now find the markup for all spans.