The org lead's rule, settled 2026-09-22: who is online is always the
narrowest audience - staff - unless an operator deliberately widens it,
and a count is fine where a list of names is not.
The public site broke that in three places since phase 4. The Online
tab named every player, the feed carried joins, respawns, deaths, chat
and tallies, and the leaderboard's lastSeen - refreshed every minute by
a gather tally - said who was on as plainly as either. All three now
sit behind one setting:
* PRESENCE_KINDS, a subset of the public allowlist, gated per request.
Below the audience the feed keeps the server's own story (wipe, start,
shutdown) and says presenceHidden rather than looking quiet.
* the Online route answers { players: [], hidden, count, audience } -
same shape, so an older client renders empty rather than breaking.
* rungs staff / signed_in / public, fleet-wide default in a new
rust_settings table with an optional per-server override on
rust_servers; an unknown stored word narrows to staff.
* the viewer's standing is RE-READ from the users row (ctx.users.getById),
not taken from the token, so a demotion or a ban applies on the next
request. Walked: a moderator demoted mid-session lost the roll call on
the same cookie.
* per-viewer answers are Cache-Control: private, no-store.
* GET/PUT /admin/rust/visibility (requireRole admin) and an admin page,
Rust visibility; every save is one activity-log row.
The browser walk also found every empty state in this module rendering
as a blank box. Core's EmptyState renders children only; this module
passed title/message (the shape the Integration Kit template teaches)
and React dropped both without a word. Fixed module-side with a small
Empty wrapper - nothing core or module-uo renders changes - and a client
test that refuses a titled EmptyState or a PageHeader subtitle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
87 lines
3.5 KiB
JavaScript
87 lines
3.5 KiB
JavaScript
// ── Every wipe this server has had ────────────────────────────────────────
|
|
//
|
|
// The list is what makes the rest of the page navigable — picking a wipe here
|
|
// filters the feed and the leaderboard — and it is also the proof R12 asks for:
|
|
// a wipe that ended is still here, with its record still attached. A Rust server
|
|
// wipes monthly, and a community site that forgot the previous map every time
|
|
// would throw away most of what it knows about its own players.
|
|
//
|
|
// `wipeId` is derived by the bridge PLUGIN from the save's creation time and
|
|
// stamped on every frame (PROTOCOL.md §8.2), so the id in this list is the same
|
|
// id the events and the leaderboard filter by. There is no second derivation
|
|
// anywhere that could disagree.
|
|
|
|
import { ErrorState, Loading, useAsync } from '../core.js'
|
|
import Empty from './Empty.jsx'
|
|
import { ago, day } from '../lib/format.js'
|
|
import api from '../api.js'
|
|
|
|
export default function Wipes({ serverId, currentWipeId, selected, onSelect }) {
|
|
const { data, loading, error } = useAsync(() => api.servers.wipes(serverId), [serverId])
|
|
const wipes = data ? data.wipes : []
|
|
|
|
if (loading) return <Loading />
|
|
if (error) return <ErrorState error={error} />
|
|
|
|
if (wipes.length === 0) {
|
|
return (
|
|
<Empty
|
|
title="No wipes recorded"
|
|
message="A wipe appears here once this server has reported something during it."
|
|
/>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<ul style={{ listStyle: 'none', margin: 0, padding: 0 }}>
|
|
{wipes.map((wipe) => {
|
|
const current = wipe.wipeId === currentWipeId
|
|
const active = wipe.wipeId === selected
|
|
return (
|
|
<li key={wipe.wipeId} style={{ borderBottom: '1px solid var(--line-soft, var(--line))' }}>
|
|
<button
|
|
type="button"
|
|
onClick={() => onSelect(wipe.wipeId)}
|
|
style={{
|
|
display: 'flex',
|
|
width: '100%',
|
|
gap: 12,
|
|
alignItems: 'baseline',
|
|
justifyContent: 'space-between',
|
|
padding: '10px 6px',
|
|
cursor: 'pointer',
|
|
background: active ? 'var(--blue)' : 'transparent',
|
|
border: 'none',
|
|
color: 'inherit',
|
|
font: 'inherit',
|
|
textAlign: 'left',
|
|
}}
|
|
>
|
|
<span>
|
|
<strong style={{ color: 'var(--ink)' }}>
|
|
{/* The save's creation time is the wipe's own date; `firstSeen`
|
|
is when THIS website first heard about it, and they differ
|
|
by however long the module was not installed. The first is
|
|
the wipe, so it leads. */}
|
|
{day(wipe.saveCreatedAt || wipe.firstSeen)}
|
|
</strong>
|
|
{current && (
|
|
<span className="sans" style={{ color: 'var(--mode-live, #5fb98a)', fontSize: '0.74rem' }}>
|
|
{' · current'}
|
|
</span>
|
|
)}
|
|
<span className="sans" style={{ display: 'block', color: 'var(--dim)', fontSize: '0.74rem' }}>
|
|
{wipe.wipeId}
|
|
</span>
|
|
</span>
|
|
<span className="sans" style={{ color: 'var(--dim)', fontSize: '0.78rem', whiteSpace: 'nowrap' }}>
|
|
last heard {ago(wipe.lastSeen)}
|
|
</span>
|
|
</button>
|
|
</li>
|
|
)
|
|
})}
|
|
</ul>
|
|
)
|
|
}
|