Recent Improvements: Read Tracking, Image Rendering, and UI Polish
Hey everyone,
I’ve been working on some significant improvements to [discourse.el]( GitHub - glenneth1/discourse.el · GitHub ) over the past couple of days and wanted to share what’s new.
## New/Unread Topic Tracking (Persistent Across Sessions)
This was the big missing piece. discourse.el now tracks which topics you’ve read **client-side**, persisted to `~/.emacs.d/discourse-read-state.el`. This means:
- **`[NEW]`** tag and blue bold text for topics you’ve never opened
- **`(N new)`** count for topics with new posts since you last read them
- **`●`** blue dot indicator in the first column for unread topics
- Read topics are dimmed with shadow face for clear visual contrast
- State is **preserved across Emacs restarts** — no more guessing what’s new
The tracking merges with Discourse’s server-side tracking when available, falling back to the local state otherwise.
### Per-Category Counts in the Sidebar
Categories now show new/unread topic counts right next to their names, so you can immediately see where the activity is without clicking into each one.
## Image Rendering Fixes
Images from Discourse forums now render correctly in `shr`. Previously, many images appeared as gray placeholder boxes because Discourse wraps them with `srcset`, `data-*`, and `loading=“lazy”` attributes that confused Emacs’s HTML renderer. These are now stripped before rendering. Relative image URLs (e.g. `/uploads/…`) are also properly resolved against the site URL.
## Auto-Refresh on Navigation
When you read a topic and press `q` to go back, the topic list and sidebar **immediately update** — the `[NEW]` tag disappears and category counts decrease without needing to manually refresh with `g`.
## Other Fixes
- **Title extraction** in the compose buffer is more tolerant of whitespace variations
- **URL port handling** fixed for non-standard ports (e.g. `http://localhost:3000`)
- **`q` in topic list** no longer creates a duplicate sidebar window
- **README** updated with current sidebar UI docs, keybindings, and example `use-package` config
## What’s Next
- **Image/file attachments** in posts and replies (not yet supported)
- Continued testing of replies and comment threads
If you’re using discourse.el, pull the latest from `main` and give it a spin. Feedback greatly appreciated.
Thanks.