đŸ”„ Roast my Theme Component: Advanced Topic Cards

AI-generated summary

jrgong introduced the Advanced Topic Cards theme component, a heavily rewritten fork of the original Topic Cards theme. The project aims to provide more granular control over topic card display, featuring two layout options (list and grid), per-category/per-device configuration, and a featured topics carousel powered by Embla. Key features include subcategory layout inheritance, visual customization for thumbnails and fonts, and richer card components with bylines and action buttons. The author acknowledged known issues, such as redundant settings and lack of horizontal touch scrolling in desktop view.

Initial feedback was positive, with denvergeeks and RGJ praising the work. However, RGJ noted several issues: the component does not work on non-category discovery routes like /latest, images often misalign, and the carousel might be better as a separate component. They also suggested allowing topics without pictures to be exempt from the carousel.

jrgong acknowledged the image alignment and text cutoff issues, asking for input on adding padding. Regarding the carousel, jrgong explained the integration was intended to share CSS styles but agreed with the suggestion to potentially separate it. The idea to exempt picture-less topics was well received.

gilles pointed out code requiring updates. jrgong responded that the component was “vibe-coded” with AI and might be cheaper to recreate from scratch, especially given new native slider components in Discourse. manuel provided technical advice for this potential rewrite, recommending using Discourse’s core Horizon topic cards as a reference pattern rather than the existing Topic Cards component. Manuel noted that Horizon offers better context scoping (listContext) and control over layout compared to the additive approach of the original component. He also highlighted potential pitfalls with plugin outlets disappearing and new list columns from plugins needing to be handled within the card structure.

Hey guys

Disclaimer: No AI was hurt in building this theme component :smiley:

Yes guys, I am guilty of shamelessly vibe-coding a rip off of the Topic Cards theme component. Hence a huge shoutout to the original authors and contributors for the great work!

While at first this was a fork, over 80% of the code and structure was completely rewritten. We added a ton of new features and on first glance all the various settings can be quite overwhelming.

Advanced Topic Cards - Preliminary Release

With our rewrite you get:

  • more granular control where topic cards are displayed
  • Two different topic card layouts
  • Featured Cards Carousel at top of Latest page

For a full list detailed scroll down below :down_arrow:

Feel free to test it, run it, copy it and roast it here in the thread! I am really excited about getting feedback on the result:

https://github.com/jrgong420/advanced-topic-cards

Known Issues:

  • Redundant TC settings: Some of the features regarding thumbnail and card height are redundant/not of value anymore
  • Desktop view lacks horizontal scrolling via touchpad/mousewheel (Embla provides a plugin for that, we haven’t had
  • Action Buttons are not as “polished”, need better visual rework

Summary of the improvements and features:

  • Per‑category, per‑device layouts
    Configure cards separately for desktop and mobile as list (image left, content right) or grid (image above, content below). You can choose exactly which categories use which layout on each platform.

  • Subcategory layout inheritance
    Optionally inherit card layouts from a parent category so you don’t have to configure every subcategory by hand.

  • Home page featured topics carousel (Embla)
    A featured topics carousel you can place on discovery routes (home/latest/top/categories), powered by Embla Carousel, with settings for slides per view, looping, alignment, drag behavior, and more.

  • Subcategory carousel on category pages
    Turn the subcategory list on a category page into a horizontal carousel, with controls for which parent categories and how many children are required before it shows.

  • Visual customization options

    • Thumbnail placeholders (Font Awesome icon) when a topic has no image

    • Card border radius presets

    • Card title font size choices (using Discourse’s font tokens)

    • Optional fixed card/grid heights and thumbnail size controls

  • Richer card components
    New card structure with:

    • Byline (OP avatar + username + optional publish date)

    • Action buttons (Details + Featured Link CTA)

    • Inline tags (category badge + tags inside the card body)

  • Compatible with other Theme Components/Plugins:

    • Calendar + Event Plugin: Display Event Date after Title
    • User Portfolio Theme Component: Display
  • Features planned:

    • More fine grained control for Featured Carousel: Additional plugin outlets, page routes, etc
    • Expand/Collapse Featured Topic Card Carousel (+ auto-expand based on new/unread topics)

Thank you so much for sharing - this is terrific!

Very nice!! Great work :+1:

Remarks:

  • Does not work on non-category discovery routes like /latest or tag selections without category.

  • The images don’t always align well

even when there are no images

  • The carousel is VERY nice but shouldn’t it be a separate component?

  • Would be nice to be able to exempt topics without a picture from the carousel.

Thx for the feedback!

Images look indeed whacky, same goes for the topic excerpt text being cut off

Would it be better from UX UI perspective to add padding around images in list layout?

That’s a fair point. Albeit my intention was to basically share same CSS styles for the carousel and regular topic cards.

:+1:

Hi, your code needs a little update :wink:

image

Hey @gilles, better late than never.

AI coding has accelerated too fast; it might even be better and cheaper to re-create it from scratch, especially since Discourse now comes with its own slider components that you can take advantage of.

But I will tackle that one soon and see how to make it a bit more future proof and re"prompt" the whole thing from scratch and make it Horizon theme compatible as well


Yes, if you know how to run an agent to create a theme component it’s fast and straightforward to create your own topic list styles. Some recommendations and things to mind:

  • The better reference pattern is Horizon’s topic cards in core, not the Topic Cards component. Horizon replaces the topic cell with its own card component and scopes it per listContext; Topic Cards keeps the core cell and only adds to it, which limits control over layout and context.
  • You can also reference GitHub - discourse/discourse-list-styles · GitHub. It uses a similar approach to the Horizon cards and adds a style picker to discovery lists (List, Thumbnails, Cards)
  • Plugin outlets inside the topic cell disappear unless the card renders them again, e.g. the AI gist and tags
  • New list columns added by plugins still show up unless hidden or placed within the cards