Present public plans in physical attacker/defender order with exact force dials, played leader portraits and printed strength, readable used-card faces and direct inspectors. Keep Cheap Heroes, printed Worthless category, empty slots and late rescue defense distinct. Preserve Banker, native bonus, KH, Stone Burner, Poison Tooth and Diplomat details rather than treating printed values as scores. Mount one shared display after the main grid so every viewer retains access while another seat owns a post-reveal choice. Keyboard links focus the display and pending controls. Render nothing before public revelation, select exact used identities from the authorized projection, and consume no private insight or hands. No game rule, saved field, endpoint, AI strategy or release gate changes. Five new cases cover genuine sealed/revealed actions, stable order, used-card privacy, JSON immutability, fractional dials, hero/Worthless/late/empty slots and both seats during a real Diplomat decision. All28 related focused cases passed before final rule-link adapter changes; types, lint, all 5017 offline tests and production build pass on the final stable source. First broad run caught plain rules-page anchors; next/link and test aliases correct this. Independent privacy/layout review and final follow-up found no material issues. No API/auth/persistence changes; HTTP tests and full game samples not repeated. Browser QA creates a fresh human Emperor/Easy Harkonnen lobby with genuine setup, then explicitly stages a conserved battle. Normal engine actions choose battle and seal the opponent plan; human browser action seals dial2, Captain Aramsham, Slip Tip and Shield. Public display absent beforehand and shows correct both plans afterward. Leader/opponent-card inspection, Escape/focus return, internal help, keyboard section links and refresh preserve the pending decision. At390x844, client/scrollWidth375, stacked panels299px, rules16px and controls44px; normal viewport restores1265px and two560.5px plans without horizontal overflow. Screenshot capture timed out; full visual/screen-reader acceptance remains open. All 1579 opening games, 3347 saved seats and auxiliary rows remain identical. One isolated QA game adds one seat and one entry receipt. Its room remains unchanged after human seal through inspection/help/refresh, and its saved seat remains unchanged. SQLite integrity and foreign keys pass. No server restart, migration, reset, recurring automation or calibration. Record Basic Moritani plus the full Leader Skills deck as the next concrete integration target, requiring coordinated profile guards and real Terror/death/ revival continuations. Existing rulings and mode gates stay explicit; the later Tleilaxu revival-offer ordering issue remains a gated integration dependency. Private evidence: 20260921-revealed-plans. Verified source tree: 8d5496cdea0076aa1cdab4590e95fcaa677c9d2d8513190c2ce9ac6c90bb9196
48 lines
2.3 KiB
TypeScript
48 lines
2.3 KiB
TypeScript
import { cardPresentation, type VisibleCard } from '@/game/card-presentation';
|
|
import { CardInspector } from './card-inspector';
|
|
import { LeaderInspector, type LeaderDisplayIdentity } from './leader-inspector';
|
|
import { LeaderPortrait } from './leader-portrait';
|
|
|
|
function PlayedCard({ label, card }: { label: string; card?: VisibleCard }) {
|
|
if (!card) return <article className="revealed-piece revealed-piece-empty" aria-label={`${label}: None`}>
|
|
<p className="revealed-piece-label">{label}</p><h4>None</h4>
|
|
</article>;
|
|
const face = cardPresentation(card);
|
|
return <article className={`revealed-piece revealed-piece-${face.role}`} aria-label={`${label}: ${card.name}`}>
|
|
<p className="revealed-piece-label">{label} · {face.category}</p>
|
|
<h4>{card.name}</h4>
|
|
<p className="revealed-piece-rules">{face.guidance}</p>
|
|
<CardInspector card={card} />
|
|
</article>;
|
|
}
|
|
|
|
/** Read-only components. The caller must supply only a publicly revealed plan. */
|
|
export function RevealedPlanPieces({ dial, leader, leaderCard, weapon, defense, lateDefense }: {
|
|
dial: number;
|
|
leader?: LeaderDisplayIdentity;
|
|
leaderCard?: VisibleCard;
|
|
weapon?: VisibleCard;
|
|
defense?: VisibleCard;
|
|
lateDefense?: VisibleCard;
|
|
}) {
|
|
return <div className="revealed-plan-pieces">
|
|
<div className="revealed-plan-leader">
|
|
<dl className="revealed-dial" aria-label="Revealed force dial">
|
|
<dt>Forces dialed</dt><dd>{dial}</dd>
|
|
</dl>
|
|
{leader ? <article className="revealed-piece revealed-leader" aria-label={`Leader: ${leader.name}`}>
|
|
<LeaderPortrait identityId={leader.id} name={leader.name} className="size-20 shrink-0" sizes="80px" fallback={<span aria-hidden="true">◆</span>} />
|
|
<div><p className="revealed-piece-label">{leader.factionName} · Leader</p><h4>{leader.name}</h4>
|
|
<p className="revealed-piece-rules">Printed strength {leader.strength}</p>
|
|
</div>
|
|
<LeaderInspector identity={leader} />
|
|
</article> : <PlayedCard label="Leader" card={leaderCard} />}
|
|
</div>
|
|
<div className="revealed-plan-cards">
|
|
<PlayedCard label="Weapon" card={weapon} />
|
|
<PlayedCard label="Defense in original plan" card={defense} />
|
|
{lateDefense && <PlayedCard label="Added after reveal" card={lateDefense} />}
|
|
</div>
|
|
</div>;
|
|
}
|