From cf4ce5c3b8efff98b31a8b5f842498155fc1bc28 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Wed, 1 Jul 2026 10:56:38 -0400 Subject: [PATCH] [admin] Add sub-tab toolbar + Blocked-videos tool to the admin pane (#25 follow-up) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The admin pane stacked every list (Moderators / Whitelist / Blacklist) in one scroll, and the per-event block list had no admin UI (block-only via the ⋯ menu, no view/unblock). This reorganizes the pane into a sub-tab toolbar and adds the missing Blocked-videos tool. - Sub-tabs: a role="tablist" toolbar in #profilePaneAdmin switches between Whitelist (default), Blacklist, Blocked videos, and Moderators. Moderators is super-admin-only — its tab button is hidden otherwise. selectAdminSubtab() shows one section at a time (ARIA + data-state), falling back to the default when a hidden tab is requested. - Blocked videos: view the per-event admin block list, unblock per row (confirm → removeFromEventBlacklist), and add by nevent/hex id. Rows show the video title+author when it's in the local cache, else the shortened id. Reuses the existing accessControl event-blacklist API + onEventBlacklistChange (live re-render) and refreshes the grids on change. No backend changes. - Row-building/render logic in js/ui/profileModal/blockedVideosSection.js (keeps ProfileAdminController under its size cap; unit-testable without a DOM). Spec correction: profile-modal-controller.test's admin assertion updated for the sub-tab layout (Moderators section now hidden until its tab is active; its tab button is shown to a super admin; selecting it reveals the section). Tests: tests/profile-blocked-videos.test.mjs (7 — rows dedupe/enrich/fallback, render, unblock wiring); profile-modal-controller admin test updated. Co-Authored-By: Claude Opus 4.8 --- components/profile-modal.html | 102 ++++++- js/ui/profileModal/ProfileAdminController.js | 278 ++++++++++++++++++- js/ui/profileModal/blockedVideosSection.js | 136 +++++++++ tests/profile-blocked-videos.test.mjs | 124 +++++++++ tests/profile-modal-controller.test.mjs | 21 +- 5 files changed, 652 insertions(+), 9 deletions(-) create mode 100644 js/ui/profileModal/blockedVideosSection.js create mode 100644 tests/profile-blocked-videos.test.mjs diff --git a/components/profile-modal.html b/components/profile-modal.html index f6a268a9..198f88d8 100644 --- a/components/profile-modal.html +++ b/components/profile-modal.html @@ -1693,6 +1693,59 @@

+
+ + + + +
+