Add administrative room close and reopen controls

Preserve readable private tables, discussion and pending games while closure blocks new play, joins, messages, AI and seat mutations. Add live-authorized atomic closure audits, room-version/revision fences, dedicated controls and exact saved retries. Reopen with the saved pause/join settings and current credentials; restoring a removed but closed room keeps its AI stopped.

Verified types, lint, 5356 offline tests, 52 HTTP tests and build. Seventeen dedicated authenticated HTTP groups and independent privacy/persistence review passed. Desktop/mobile browser QA confirmed one close after a lost response and refresh, persistent readable notices, retained private draft, mobile reopening and saved-seat refresh. All 2,001 baseline rooms, 4,243 seats and related records preserved. Positive production admin acceptance awaits authorized QA access; full admin and rules gates remain open.
This commit is contained in:
Quintine committed 2026-09-22 12:31:02 +10:00
1 parent 238de3860d
commit 98b1b3261b
49 files changed
+4255 -86

No files matched your search

+5 -4
View File
@@ -73,7 +73,8 @@ export function SeatAiDelegation({
const received = grants.filter((grant) => grant.delegateId === game.me);
const started = ['setup', 'playing'].includes(game.status);
const locked = disabled || busy || !loaded;
const paused = !!game.roomControl?.paused;
const closed = !!game.roomControl?.closed;
const paused = !!game.roomControl?.paused || closed;
if (!own || own.bot) return null;
function store(next: SeatAiDelegateRequest | null) {
@@ -82,7 +83,7 @@ export function SeatAiDelegation({
setStorageProblem(false);
}
async function submit(request: SeatAiDelegateRequest) {
if (locked || pending.current) return;
if (locked || pending.current || (closed && !record)) return;
pending.current = true;
setBusy(true);
setExpanded(true);
@@ -241,7 +242,7 @@ export function SeatAiDelegation({
<Button
className="min-h-11 whitespace-normal"
variant="outline"
disabled={locked}
disabled={locked || closed}
onClick={() =>
void submit({
type: 'revokeSeatAiDelegate',
@@ -255,7 +256,7 @@ export function SeatAiDelegation({
)}
</section>
)}
{paused && <p>The room is paused. New AI permissions and activation will be available after it resumes. Revoking permission and confirming saved requests remain available.</p>}
{closed ? <p>The room is closed. New AI permission changes are stopped; exact saved requests can still confirm earlier completed actions.</p> : paused && <p>The room is paused. New AI permissions and activation will be available after it resumes. Revoking permission and confirming saved requests remain available.</p>}
{started && !paused && !own.autopilot && peers.length > 0 && (
<div className="flex min-w-0 flex-col gap-3">
<label htmlFor={`${id}-player`}>