Keep room confirmations visible until acknowledged
Show confirmed create/join guidance until local Continue without polling or ordinary game actions clearing unread text. Default shared toasts to no timeout with visible Dismiss controls. Validation: 23 focused entry/action/seat tests, types/lint/build, and original local room creation with 43-second retention through polls and a circle change, explicit dismissal and no replay. No console errors. QA room preserved. Deployed acceptance remains open. Runtime fingerprint d57fa6a34bb1738017c2690ca5ad9f04b0b99458078a60c7ddd51e2c29483301; documentation overlay a8baa23802ac1c79321d67913c27512a199699839c1932947dfa3af95434cc37.
This commit is contained in:
1 parent
97c2b67650
commit
999edb67e6
6 files changed
+73
-6
No files matched your search
@@ -0,0 +1,21 @@
|
||||
'use client';
|
||||
|
||||
import { Button } from './ui/button';
|
||||
|
||||
/** A local acknowledgement: polling and game actions do not dismiss this text. */
|
||||
export function RoomEntryConfirmation({ kind, code, onContinue }: {
|
||||
kind: 'create' | 'join';
|
||||
code: string;
|
||||
onContinue: () => void;
|
||||
}) {
|
||||
return <section className="notice min-w-0 space-y-3 break-words" style={{ fontSize: '1rem', lineHeight: 1.5 }} aria-label="Room confirmation">
|
||||
<h2>{kind === 'create' ? 'Room created' : 'Room joined'}</h2>
|
||||
<output className="block" aria-live="polite">
|
||||
{kind === 'create'
|
||||
? <>Room <strong>{code}</strong> is ready. Share the room code or invitation link from the lobby so others can join.</>
|
||||
: <>You have joined room <strong>{code}</strong>. Your faction and the rules are shown at the table.</>}
|
||||
</output>
|
||||
<p>Use Protect your saved seat to keep a recovery kit. This message stays until you select Continue.</p>
|
||||
<Button type="button" variant="outline" className="min-h-11" style={{ fontSize: '1rem' }} onClick={onContinue}>Continue</Button>
|
||||
</section>;
|
||||
}
|
||||
@@ -16,8 +16,9 @@ import {
|
||||
|
||||
const toast = ToastPrimitive.createToastManager();
|
||||
|
||||
function ToastProvider({ ...props }: ToastPrimitive.Provider.Props) {
|
||||
return <ToastPrimitive.Provider {...props} />;
|
||||
function ToastProvider({ timeout = 0, ...props }: ToastPrimitive.Provider.Props) {
|
||||
// Text stays readable until the player dismisses it; progress can update in place.
|
||||
return <ToastPrimitive.Provider timeout={timeout} {...props} />;
|
||||
}
|
||||
|
||||
function ToastPortal({ ...props }: ToastPrimitive.Portal.Props) {
|
||||
@@ -186,7 +187,7 @@ function ToastList() {
|
||||
<ToastDescription />
|
||||
</div>
|
||||
<ToastAction />
|
||||
<ToastClose />
|
||||
<ToastClose aria-label="Dismiss message" render={<Button type="button" variant="outline" className="min-h-11" />}>Dismiss</ToastClose>
|
||||
</ToastContent>
|
||||
</Toast>
|
||||
));
|
||||
|
||||
Reference in new issue
Block a user