How to enable bulk selection for theme?

AI-generated summary

rahim123 reports that bulk selection actions (specifically the moderator dropdown menu) are missing in Sam’s Simple Theme, though selection checkboxes appear. The feature works fine in the default Discourse theme. Attempts to add CSS for bulk selection had no effect. pmusaraj confirms the Dismiss button (for non-moderators) works, but rahim123 clarifies they’re missing the moderator-specific bulk actions menu. Lilly suggests ensuring both theme and Discourse are up-to-date, but rahim123 confirms they are. Lilly shares a screenshot showing the menu working on their test forum with the theme. rahim123 notes this has been an issue for years, even after briefly fixing it with custom code. Lilly suspects the issue may stem from using the stable branch, as the bulk actions menu was recently added to the theme. Testing in safe mode (rahim123) confirms the menu appears only when themes are disabled. Lilly explains that the theme no longer includes bulk selection code explicitly — it relies on core Discourse functionality after old code was removed during a template refactor (commit). rahim123 concludes that the theme now relies on core fallback, but they never saw it work until adding custom code — the source of which is now lost rahim123.

Hi there, I’m using Sam's Simple Theme but it doesn’t enable bulk selection. More precisely, the selection boxes appear but not the actions menu.

When I revert to the default Discourse theme it works as expected.

I tried adding a theme component with the CSS that I could find for the bulk selection, but it makes no difference.

.topic-list .topic-list-data.bulk-select {
  padding: 0;
  width: 30px;
}
.bulk-select-topics {
  display: inline-flex;
}

Is there any way I could add in this functionality? Thanks a lot.

Can you reproduce here on meta with Sam’s Simple Theme? I just tried, and I see the button:

Thanks for the reply. I don’t have moderator permissions here on Meta so no bulk selection.

As non-moderator, you should see the Dismiss button:

Ah OK, yes, that works for me both here and on my forum. But the bulk actions menu for moderators is a separate dropdown menu that appears with more options, that’s what I’m missing.

please make sure both the theme component and Discourse instance are up-to-date. that functionality was added.

Hi there, yes they are both up to date.

is this the menu you are referring to?

That is a mod on my test forum running Sam’s simple theme that I just updated.

Hmm weird. Since I started using it a few years ago bulk selection actions never appeared with Sam’s Simple Theme. While working on some other theme component a year or so ago I did run across a code snippet that made it start working, but I either removed it by accident or it stopped working with an update.

The only possible difference I can think of is that I’m on the stable branch, but like I said this has been a long-standing issue for years for me.

yea this is likely why. I think the new bulk actions menu was only recently added to that theme.

if you look at your forum as an admin with that theme, or in safe-mode as a mod, do you see the proper bulk actions menu?

With ?safe_mode=no_plugins no, the menu doesn’t appear. With ?safe_mode=no_themes%2Cno_plugins it does work but that’s obviously just because it disables 3rd party themes.

I downloaded the main branch from GitHub - discourse/discourse-simple-theme: Sam's simple discourse theme · GitHub and a quick search for bulk in all the files doesn’t find anything.

no it’s not there, but it needed to be compatible. you can see the old bulk select stuff removed here when templates were refactored:

https://github.com/discourse/discourse-simple-theme/commit/914f9695abd7938a5502355d3a17fa9c88eeb057#diff-8eab2ad083803db545ff53d060fdd09ef7881cb2708b9083dfca102438e9925d

So if I understand correctly, the old version of Sam’s Simple Theme had handling for bulk selection, and then Discourse changed the way it worked, and then Sam’s Simple Theme recently had that old handling removed and now it’s undefined in Sam’s Simple Theme so that it works by falling back to the core bulk selection code?

So I guess what I don’t understand is that bulk selection never worked for me with Sam’s Simple Theme until I added a few lines of code a year or so ago, I can’t remember if it was CSS or JS in the HEAD.