AI summary in topic header

:information_source: Summary Adds a discourse-ai topic summarize button to the topic right sidebar (timeline controls or Table of Contents) on desktop, and to the topic title area on mobile and narrow screens.
:eyeglasses: Preview GIF
:hammer_and_wrench: Repository GitHub - rapekas/discourse-ai-summary-in-header: AI summary in topic header theme component · GitHub
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Moves the discourse-ai Summarize button from the topic map into the topic right sidebar (timeline or Table of Contents) on desktop, or into the topic title area on mobile and narrow screens. Requires discourse-ai with topic summarization enabled.

dasih

How it works

The component creates its own button and opens the AI Summary modal directly via the Discourse modal service. It does not clone or move the original button — this avoids issues with Glimmer component event handlers.

The button placement adapts to the available layout:

  • Desktop (wide screen) — button appears in the Table of Contents (if DiscoTOC is active) or in the timeline controls sidebar.

  • Desktop (narrow screen) — when the sidebar is not rendered by Discourse, the button falls back to the topic title area, below the title and category/tags.

  • Mobile — button appears in the topic title area.

When the browser window is resized, the component automatically cleans up stale buttons and places a new one in the correct location — no duplicates.

Settings

Setting Default Description
Show in timeline On Show the summarize button in the sidebar (timeline or ToC). On narrow desktop screens the button falls back to the topic title area.
Show on mobile On Show the summarize button in the topic title area on mobile devices.
Keep in reader mode Off Keep the button visible when Reader Mode is active.

Compatibility

  • discourse-ai — required (topic summarization must be enabled for your users)

  • DiscoTOC — supported (button auto-placed in ToC instead of timeline)

  • Reader Mode — supported (optional Keep in reader mode setting)

4 Likes