mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-03 11:22:25 +00:00
Profile button: gold admin ring + fire on session restore
Make the super-admin/admin signal unmistakable on your own profile button: a gold ring around the avatar (with a thin page-colored gap so it reads as a ring, not a border) in addition to the corner star. - applicationBootstrap.js: refreshAdminStar toggles an is-admin class on the profile button using applyAdminStar's return value. - CSS: #profileButton.is-admin > div draws the gold ring (box-shadow, not clipped by the avatar's overflow). - uiCoordinator.js: refresh the admin star/ring inside applyAuthenticatedUiState so it also lights on session restore, not only a fresh login — the likely reason it wasn't showing. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
60157eb743
commit
fdddbc2bb4
3 files changed
+23
-1
No files matched your search
@@ -280,6 +280,16 @@
|
||||
left: var(--space-2xs);
|
||||
}
|
||||
|
||||
/* Gold ring around the avatar when the logged-in user is an admin — the
|
||||
unmistakable "you're an admin" signal on your own profile button. A thin
|
||||
page-colored gap separates the avatar from the ring so it reads as a ring,
|
||||
not a border. Box-shadow isn't clipped by the avatar's own overflow. */
|
||||
#profileButton.is-admin > div {
|
||||
box-shadow:
|
||||
0 0 0 var(--border-width-hairline) var(--color-page),
|
||||
0 0 0 calc(var(--border-width-hairline) * 3) var(--status-warning);
|
||||
}
|
||||
|
||||
.header-icon-toggle[data-theme-state="light"]:hover,
|
||||
.header-icon-toggle[data-theme-state="light"]:focus-visible {
|
||||
color: var(--color-text);
|
||||
|
||||
@@ -128,6 +128,12 @@ export function createUiCoordinator(deps) {
|
||||
if (exploreLink) {
|
||||
exploreLink.classList.remove("hidden");
|
||||
}
|
||||
|
||||
// Light the admin star/ring whenever the authenticated UI is applied —
|
||||
// this covers session restore, not just a fresh login.
|
||||
if (typeof this.refreshAdminStar === "function") {
|
||||
this.refreshAdminStar();
|
||||
}
|
||||
},
|
||||
|
||||
applyLoggedOutUiState() {
|
||||
|
||||
@@ -987,7 +987,13 @@ export default class ApplicationBootstrap {
|
||||
typeof app.getCurrentUserNpub === "function"
|
||||
? app.getCurrentUserNpub()
|
||||
: "";
|
||||
applyAdminStar(app.profileButton, npub || "");
|
||||
// applyAdminStar returns whether the user is an admin; use it to also
|
||||
// toggle the gold ring around the profile avatar (the flagship signal
|
||||
// on your own button — the corner star stays the shared marker).
|
||||
const isAdmin = applyAdminStar(app.profileButton, npub || "");
|
||||
if (app.profileButton && app.profileButton.classList) {
|
||||
app.profileButton.classList.toggle("is-admin", Boolean(isAdmin));
|
||||
}
|
||||
} catch (error) {
|
||||
devLogger.warn("[Application] Failed to refresh admin star", error);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user