diff --git a/frontend/src/admin.css b/frontend/src/admin.css
new file mode 100644
index 0000000..a4b96bd
--- /dev/null
+++ b/frontend/src/admin.css
@@ -0,0 +1,32 @@
+/* Admin dashboard — operator-facing, English-only. Sits on top of the app's tokens; nothing
+ here is used outside views/Admin.jsx. The page is looked at maybe twice a year, so every
+ card says what it is for in a sentence and every state is a word, not a colour to decode. */
+
+.adm-intro{color:var(--label-2);font-size:14px;line-height:1.45;margin:-6px 0 16px}
+
+/* one sentence under a card heading that says what the card is for */
+.adm-lead{color:var(--label-2);font-size:13px;line-height:1.45;margin:2px 0 12px}
+
+/* status pill: a word and a colour, never a paragraph */
+.adm-pill{
+ display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;
+ font-size:12.5px;font-weight:600;letter-spacing:-.004em;line-height:1.5;white-space:nowrap;
+ background:var(--surface-2);color:var(--label-2)
+}
+.adm-pill::before{content:'';width:7px;height:7px;border-radius:50%;background:currentColor;flex:none}
+.adm-pill.bad{background:color-mix(in srgb,var(--red) 16%,transparent);color:var(--red)}
+.adm-pill.acc{background:var(--acc-soft);color:var(--acc)}
+
+/* a dim explainer that reads like a sentence, not a footnote */
+.adm-hint{font-size:13px;color:var(--label-2);line-height:1.45;margin:6px 0 10px}
+
+/* a small heading over a group of rows ("Unused · tap to copy") */
+.adm-group-t{font-size:11.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--label-3);margin:0 0 7px}
+
+/* an invite code, sized to be tapped and read out loud */
+.adm-code{
+ font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:600;letter-spacing:.08em;
+ background:var(--surface-2);padding:4px 9px;border-radius:8px;font-size:14px
+}
+.adm-iconbtn{width:44px;height:44px;border-radius:12px;font-size:17px}
+.adm-empty{color:var(--label-3);font-size:13.5px;padding:10px 2px}
diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx
index b7447fc..ae00dcf 100644
--- a/frontend/src/views/Admin.jsx
+++ b/frontend/src/views/Admin.jsx
@@ -9,20 +9,25 @@ import { workoutVolume, setsDone } from '../lib/history.js'
import { confirmSheet } from '../sheets.jsx'
import Icon from '../components/Icon.jsx'
import { Button } from '../components/ui.jsx'
+import '../admin.css'
// Admin-only operator dashboard (owner passkey + admin flag; guarded again server-side).
// Deliberately English-only — it isn't part of the translated end-user surface, so it stays
// out of the per-language string packs.
+//
+// One page of cards, each opening with a sentence that says what it is for. An operator who
+// looks at this twice a year should not have to remember what "synced 3d ago" or an invite
+// code means.
const rel = ts => {
if (!ts) return 'never'
const s = Math.max(0, (Date.now() - ts) / 1000)
if (s < 60) return 'just now'
- if (s < 3600) return Math.floor(s / 60) + 'm ago'
- if (s < 86400) return Math.floor(s / 3600) + 'h ago'
- return Math.floor(s / 86400) + 'd ago'
+ if (s < 3600) return Math.floor(s / 60) + ' min ago'
+ if (s < 86400) return Math.floor(s / 3600) + ' h ago'
+ return Math.floor(s / 86400) + ' d ago'
}
-const dur = ms => { const m = Math.max(0, Math.floor(ms / 60000)); return m < 60 ? m + 'm' : Math.floor(m / 60) + 'h' + (m % 60) + 'm' }
+const dur = ms => { const m = Math.max(0, Math.floor(ms / 60000)); return m < 60 ? m + ' min' : Math.floor(m / 60) + ' h ' + (m % 60) + ' min' }
function UserDetail({ id, onChanged, close }) {
const [d, setD] = useState(null)
@@ -38,10 +43,10 @@ function UserDetail({ id, onChanged, close }) {
return <>
+ {inviteOnly
+ ? 'Sign-up is invite-only: someone needs one of these codes to create a profile. Each code works once.'
+ : 'Sign-up is open, so codes are optional here — they only record who invited whom.'}
+
+ {open.length ? <>
+
Unused · tap to copy
+ {open.map(i =>
+
+
+
+
+
+
)}
+ > : null}
+ {used.length ? <>
+
Already used
+ {used.map(i =>
+ {i.code}→ {i.usedByName || 'used'}
+
)}
+ > : null}
+ {!open.length && !used.length &&
No codes yet. "New code" makes one and copies it to your clipboard.
{rows.map(e => {
const line = auditLine(e)
- return
+ return
{line.title}
{/* a red pill, not a red row: twenty fumbled Face IDs in a row shouldn't read as an incident */}
- {!e.ok && failed}
- {auditCat(e.ev) === 'admin' && admin}
}
@@ -175,33 +201,40 @@ export default function Admin() {
{users ? users.length + ' users · ' + activeCount + ' active this week' : 'Loading…'}
+
+ Everything about running this instance: who uses it, how they get in, and what has happened on it. Nothing here shows anyone's training data beyond counts.
+
Users
{users ? users.length : '—'}
Training now
{users ? liveUsers.length : '—'}
-
Active 7d
{users ? activeCount : '—'}
+
Active 7 days
{users ? activeCount : '—'}
Disabled
{users ? disabledCount : '—'}
{liveUsers.length > 0 &&
-
Training now
- {liveUsers.map(u =>
openUser(u.id)}>
+
Training now
+
Sessions running at this moment. Tap a name for details.
+ {liveUsers.map(u =>
openUser(u.id)}>
{u.name}
-
{u.live.name} · ex {u.live.exIdx}/{u.live.exTotal} · {u.live.setsDone}/{u.live.setsTotal} sets
- {dur(Date.now() - u.live.startedAt)}
+
{u.live.name} · exercise {u.live.exIdx} of {u.live.exTotal} · {u.live.setsDone}/{u.live.setsTotal} sets