# AI summary in topic header

**URL:** https://meta.discourse.org/t/ai-summary-in-topic-header/399069
**Category:** Theme component
**Tags:** ai, ai-summarize
**Created:** [March 23, 2026, 4:26pm UTC](https://meta.discourse.org/t/ai-summary-in-topic-header/399069 "2026-03-23T16:26:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ivan\_Rapekas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivan_rapekas/32/248924_2.png) [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)
#### Post date: [March 23, 2026, 4:26pm UTC](https://meta.discourse.org/t/ai-summary-in-topic-header/399069/1 "2026-03-23T16:26:34Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Summary** | Adds a [discourse-ai](https://github.com/discourse/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. |
| 👓 | **Preview** | [GIF](https://github.com/rapekas/discourse-ai-summary-in-header/raw/main/images/README/dasih.gif) |
| 🛠 | **Repository** | [GitHub - rapekas/discourse-ai-summary-in-header: AI summary in topic header theme component · GitHub](https://github.com/rapekas/discourse-ai-summary-in-header) |
| ❓ | **Install Guide** | [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

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](https://github.com/discourse/discourse/tree/main/plugins/discourse-ai) with topic summarization enabled.

![dasih](https://global.discourse-cdn.com/meta/original/4X/b/e/3/be3dd4ee091db3c14c5aa5b24fc935a8dbfc70e0.gif)

### 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](https://meta.discourse.org/t/discotoc-automatic-table-of-contents/111143) 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](https://meta.discourse.org/t/reader-mode/307916) is active. |

### Compatibility

- **[discourse-ai](https://github.com/discourse/discourse/tree/main/plugins/discourse-ai)** — required (topic summarization must be enabled for your users)

- **[DiscoTOC](https://meta.discourse.org/t/discotoc-automatic-table-of-contents/111143)** — supported (button auto-placed in ToC instead of timeline)

- **[Reader Mode](https://meta.discourse.org/t/reader-mode/307916)** — supported (optional `Keep in reader mode` setting)

---

<div class="post-metadata">

### Author: ![kaktak](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaktak/32/529093_2.png) [@kaktak](https://meta.discourse.org/u/kaktak)
#### Post date: [March 24, 2026, 6:47am UTC](https://meta.discourse.org/t/ai-summary-in-topic-header/399069/2 "2026-03-24T06:47:48Z")

</div>

Great plugin — exactly what I needed! Works perfectly and makes the topic summaries super useful. Thx 🤝
