diff --git a/docs/superpowers/plans/2026-07-17-topbar-unread-drawer.md b/docs/superpowers/plans/2026-07-17-topbar-unread-drawer.md new file mode 100644 index 0000000..40c3568 --- /dev/null +++ b/docs/superpowers/plans/2026-07-17-topbar-unread-drawer.md @@ -0,0 +1,346 @@ +# Topbar Unread Drawer Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Add an "Unread" dropdown to the topbar utilities (next to notifications) with a live unread-topic count badge and a fetched list of unread topics. + +**Architecture:** A new template partial imported by `topbar.tpl` gives the button + badge (core's `component="unread/count"` socket updates make the badge live for free). A small addition to `public/client.js` fetches `/api/unread` on dropdown open and renders topic links with plain DOM building. SCSS reuses the existing `.wg-topbar__dropdown` vocabulary. + +**Tech Stack:** NodeBB templates (benchpress `.tpl`), jQuery/Bootstrap 5 dropdown events, NodeBB client `api` module, SCSS. Tests are plain-Node assert scripts in `tests/` (run with `node tests/.test.js`). + +## Global Constraints + +- NixOS host: no global installs; run tests with plain `node`. +- One branch, one PR: all commits go on the existing `feat/topbar-unread-drawer` branch. +- Verification against the dev container in `../sow-nodebb` (`make dev`, `make dev-build`), forum at http://localhost:4567. Theme edits need `make dev-build` before they show up. +- Titles from the API must be inserted with `textContent` (never HTML strings) — trust boundary. + +--- + +### Task 1: Unread drawer template + mobile drawer link + +**Files:** +- Create: `templates/partials/header/unread-drawer.tpl` +- Modify: `templates/partials/header/topbar.tpl` (logged-in utility list, before the notifications `
  • `; and the drawer-actions block) +- Test: `tests/global-topbar-contract.test.js` (append assertions) + +**Interfaces:** +- Produces: `
  • ` containing a dropdown toggle and `