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:
1 parent
238de3860d
commit
98b1b3261b
49 files changed
+4255
-86
No files matched your search
@@ -50,6 +50,7 @@ export function SeatHandoverSetup({
|
||||
const [message, setMessage] = useState('');
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [replaceAcknowledged, setReplaceAcknowledged] = useState(false);
|
||||
const closed = !!game.roomControl?.closed;
|
||||
const own = game.players.find((player) => player.id === game.me);
|
||||
useEffect(() => {
|
||||
try {
|
||||
@@ -96,7 +97,7 @@ export function SeatHandoverSetup({
|
||||
setRecord(next);
|
||||
}
|
||||
async function submit(operation: 'create' | 'revoke', kit: SeatHandoverKit) {
|
||||
if (disabled || pending.current) return;
|
||||
if (disabled || pending.current || (closed && !record?.operation)) return;
|
||||
pending.current = true;
|
||||
setReplaceAcknowledged(false);
|
||||
setBusy(true);
|
||||
@@ -170,10 +171,11 @@ export function SeatHandoverSetup({
|
||||
accepted. Recovering your seat invalidates its pending handover. Only
|
||||
share the kit with the intended recipient.
|
||||
</p>
|
||||
{closed && <p>The room is closed. New handovers and cancellations are stopped; exact saved requests can still confirm a completed change.</p>}
|
||||
{!record ? (
|
||||
<Button
|
||||
variant="outline"
|
||||
disabled={disabled || busy || !loaded}
|
||||
disabled={disabled || closed || busy || !loaded}
|
||||
onClick={() => {
|
||||
try {
|
||||
void submit('create', createHandoverKit(game.code, game.me));
|
||||
@@ -238,7 +240,7 @@ export function SeatHandoverSetup({
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
disabled={disabled || busy}
|
||||
disabled={disabled || closed || busy}
|
||||
onClick={() => void submit('revoke', record.kit)}
|
||||
>
|
||||
Cancel handover
|
||||
@@ -263,7 +265,7 @@ export function SeatHandoverSetup({
|
||||
<Button
|
||||
variant="outline"
|
||||
disabled={
|
||||
disabled || busy || (!!record.operation && !replaceAcknowledged)
|
||||
disabled || closed || busy || (!!record.operation && !replaceAcknowledged)
|
||||
}
|
||||
onClick={() => {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user