Add a support inbox icon to the topbar (sow-nodebb-plugin-support#10)
Mirrors the existing unread-drawer pattern: a new dropdown next to the notification bell, gated on templateData.support.visible (injected by the support plugin's filter:middleware.renderHeader hook, on every page render, for viewers with any support access at all). Opening it fetches GET /plugins/support/notifications via the api module, renders up to 10 entries by textContent (never innerHTML), and marks everything read via POST .../notifications/read, clearing the badge client-side. Also present in the mobile burger drawer, same gating. ponytail: no live socket push for this badge (core's own unread/notification counts get one); it only catches up on the next full page load after the box is opened. Noted in client.js as the upgrade path if that gap matters. Verified live against sow-nodebb-plugin-support's dev NodeBB stack (theme + plugin both mounted): icon hidden for a user with no support access, badge count and dropdown contents correct for a reviewer, badge clears on open. Full plain-node test suite passes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -173,7 +173,8 @@ $wg-topbar-panel-bg: rgba(21, 17, 26, 0.98);
|
||||
.wg-topbar .notifications-dropdown,
|
||||
.wg-topbar .chats-dropdown,
|
||||
.wg-topbar .drafts-dropdown,
|
||||
.wg-topbar .unread-dropdown {
|
||||
.wg-topbar .unread-dropdown,
|
||||
.wg-topbar .support-dropdown {
|
||||
width: min(24rem, calc(100vw - 1.5rem));
|
||||
}
|
||||
|
||||
@@ -189,6 +190,10 @@ $wg-topbar-panel-bg: rgba(21, 17, 26, 0.98);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.wg-topbar .wg-support-item--unread {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.wg-topbar .dropdown-item,
|
||||
.wg-topbar .btn.btn-ghost,
|
||||
.wg-topbar .btn.btn-light {
|
||||
|
||||
Reference in New Issue
Block a user