Facebook-style Topic Modal - Is it better?

I’d love to test your version @Don :heart_eyes:

Hello :waving_hand:

Sure, absolutely! Originally, I built this feature directly into my own custom theme, so I had to extract and split it into a standalone theme component.

On my own site, I trigger the modal via a dedicated button, whereas this theme component triggers it directly when clicking on a topic.

You can try it out on Theme Creator here:

Wow, looks very fast. I really like it. Would be very interested if you open-source it. Nice work

I haven’t used the book of faces in a period of time counted in decades so no reference there but anyhow… Don this looks really slick. I didn’t expect to like it but on a phone I bet it could be really cool. Again no reference to facebook but to me this is like half way between a normal forum and a chat

It looks and feels very slick. Very cool :chefs_kiss:

It seems to make a lot of network requests… I keep running into rate limits trying it out on theme creator. Looks like it must fetch all the topic content from the topic list even if you don’t enter the topic (which is how it feels so quick)?

Yeah, I originally built this component for my own site, which uses a custom card layout where only 1–2 topics fit on the screen at a time. In that setup, viewport prefetching works smoothly without hitting rate limits. On standard Discourse table-based topic lists, however, far more topics are visible simultaneously, causing the prefetch queue to fill up much faster during scrolling.

That is actually the main reason I haven’t officially shared the component yet - I knew this behavior needed to be adapted for standard layouts first.

You’re spot on: to make this a solid, general-purpose component, I need to optimize this.

I’ve added a few settings that were previously hardcoded, so the component can easily adapt to different layouts. I also added max_prefetches_per_minute setting as an extra safety net specifically to prevent rate limits during continuous scrolling.

Any chance of open sourcing this so i can have a play :slight_smile: I like it :wink:

I think this would be more suited to your theme tbh and not the standard list of topics

I’ve just added two new settings to make it much more flexible for custom layouts:

  • trigger_style: Choose between making the entire topic row clickable (row) or adding a small expand icon (button) that opens the preview while leaving the normal topic link untouched.

  • plugin_outlet: When using the button style, you can specify the exact plugin outlet where the expand icon is rendered (defaults to topic-list-after-title).

This allows custom themes to attach the trigger button to their own custom plugin outlets as needed.

I actually just activated this exact standalone component on my site. I completely removed my original code from my theme and replaced it with this component running via <PluginOutlet />.

Plus, I also fixed a bug with the read tracking functionality.

I’d like to test it in a live production environment for a short while to make sure everything is solid before open-sourcing it.


By the way, I’ve temporarily switched the Theme Creator preview to the button trigger type for a short while so you can test!