Keep admin and seat recovery notices readable
Show progress during initial admin and seat-control submissions; retain exact recovery instructions for uncertain requests and explicit retries. Keep seat recovery and handover confirmations above the table until Continue without blocking gameplay. Use readable 16px text and 44px controls. Verified isolated checkpoint: types, lint, 5381 offline tests, 52 HTTP tests and build. Local delayed/lost-response browser QA covered admin creation, durable retry, handover and seat recovery, mobile readability and saved-seat restoration. Existing 2098 rooms and 4455 seats preserved. Deployment acceptance follows separately.
This commit is contained in:
1 parent
e918e2e0c0
commit
137f9223f1
15 files changed
+134
-31
No files matched your search
+11
-4
@@ -3,6 +3,7 @@ import { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import { TableTalk } from '@/components/table-talk';
|
||||
import { RemovedRoomNotice } from '@/components/removed-room-notice';
|
||||
import { GameTable } from '@/components/game-table';
|
||||
import { SeatConfirmation, type SeatConfirmationKind } from '@/components/seat-confirmation';
|
||||
import { RulesetControls } from '@/components/ruleset-controls';
|
||||
import {
|
||||
SeatHandoverSetup,
|
||||
@@ -78,6 +79,7 @@ export default function Home() {
|
||||
const [name, setName] = useState('');
|
||||
const [code, setCode] = useState('');
|
||||
const [notice, setNotice] = useState('');
|
||||
const [seatConfirmation, setSeatConfirmation] = useState<SeatConfirmationKind | null>(null);
|
||||
const seatClaimUncertain = useRef(false);
|
||||
const [claimUncertain, setClaimUncertain] = useState(false);
|
||||
const pendingEntry = useRef<RoomEntryAttempt | null>(null);
|
||||
@@ -494,6 +496,7 @@ export default function Home() {
|
||||
setBotRecovery(false);
|
||||
setConnection('');
|
||||
setGame(null);
|
||||
setSeatConfirmation(null);
|
||||
setRemovedRoom(null);
|
||||
setRestoreFailed(false);
|
||||
setNotice('');
|
||||
@@ -627,7 +630,7 @@ export default function Home() {
|
||||
setBusy(pending);
|
||||
}
|
||||
|
||||
function restoredSeat(view: GameView, claim = false) {
|
||||
function restoredSeat(view: GameView, claim = false, confirmation?: SeatConfirmationKind) {
|
||||
if (removedRooms.current.has(view.code)) return false;
|
||||
if (
|
||||
!claim &&
|
||||
@@ -635,6 +638,7 @@ export default function Home() {
|
||||
)
|
||||
return;
|
||||
if (claim) {
|
||||
setSeatConfirmation(confirmation ?? null);
|
||||
setHandoverPending(true);
|
||||
setAiPermissionPending(true);
|
||||
activeRoom.current = view.code;
|
||||
@@ -701,7 +705,7 @@ export default function Home() {
|
||||
<SeatHandoverClaim
|
||||
onCancel={() => window.location.reload()}
|
||||
onRestored={(view) => {
|
||||
if (restoredSeat(view, true)) setShowHandover(false);
|
||||
if (restoredSeat(view, true, 'handover')) setShowHandover(false);
|
||||
}}
|
||||
/>
|
||||
</main>
|
||||
@@ -709,6 +713,9 @@ export default function Home() {
|
||||
if (game)
|
||||
return (
|
||||
<>
|
||||
{seatConfirmation && !roomUnavailable && <div className="table-shell">
|
||||
<SeatConfirmation kind={seatConfirmation} onContinue={() => setSeatConfirmation(null)} />
|
||||
</div>}
|
||||
{roomUnavailable ? <main className="table-shell"><RemovedRoomNotice code={game.code} busy={busy || checkingConnection} onRetry={() => void reconnect()} onExit={exitTable} exitDisabled={handoverPending || aiPermissionPending || claimUncertain} /></main> : <GameTable
|
||||
game={game}
|
||||
send={send}
|
||||
@@ -956,7 +963,7 @@ export default function Home() {
|
||||
disabled={busy || checkingConnection}
|
||||
onPending={controlPending}
|
||||
onUncertain={controlUncertain}
|
||||
onRestored={(view) => restoredSeat(view, true)}
|
||||
onRestored={(view) => restoredSeat(view, true, 'recovery')}
|
||||
/>
|
||||
)}
|
||||
</section>
|
||||
@@ -1148,7 +1155,7 @@ export default function Home() {
|
||||
disabled={busy || needsReconcile || checkingConnection}
|
||||
onPending={controlPending}
|
||||
onUncertain={controlUncertain}
|
||||
onRestored={(view) => restoredSeat(view, true)}
|
||||
onRestored={(view) => restoredSeat(view, true, 'recovery')}
|
||||
/>
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
Reference in new issue
Block a user