From 33b11a5491c17e4550874fae70450a06cf61999a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 06:14:52 +0000 Subject: [PATCH] Night 1 fix: results card explains on-topic tie-breaks (#51) Co-Authored-By: Claude Opus 5.5 --- src/game/Results.tsx | 2 +- src/game/play.css | 1 + tests/ui-play.test.ts | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/game/Results.tsx b/src/game/Results.tsx index 43dd221..da20c40 100644 --- a/src/game/Results.tsx +++ b/src/game/Results.tsx @@ -14,7 +14,7 @@ export function Results({ result, modeName, onRematch, onLobby }: { result: Resu : `You won ${won} of ${result.lanes.length} Topics${tiebreak ? ', so total power decided it' : ''}.`}

    {result.lanes.map(l =>
  1. - {l.name}{l.myPower} – {l.theirPower}{l.winner === 0 ? 'Won' : l.winner === 1 ? 'Lost' : 'Tied'} + {l.name}{l.myPower} – {l.theirPower}{l.winner === 0 ? 'Won' : l.winner === 1 ? 'Lost' : 'Tied'}{l.winner !== null && l.myPower === l.theirPower && Tie, decided by on-topic cards}
  2. )}

Matches are off-chain. No card was moved or burned.

diff --git a/src/game/play.css b/src/game/play.css index 69a7c9c..9ac00e0 100644 --- a/src/game/play.css +++ b/src/game/play.css @@ -206,3 +206,4 @@ html.wd-in-match .auth-wrap,body:has(.match) .auth-wrap{display:none} .show-narrow{display:none} @media(max-width:480px){.show-narrow{display:inline}.play-actions .button{min-width:0}} .lane-bonus{color:var(--ctp-yellow)!important;margin-left:2px} +.result-lanes .tie-note{font-size:10px;color:var(--ctp-yellow);line-height:1.3} diff --git a/tests/ui-play.test.ts b/tests/ui-play.test.ts index 2348b53..2ccf3a2 100644 --- a/tests/ui-play.test.ts +++ b/tests/ui-play.test.ts @@ -141,3 +141,14 @@ test('the final board shows scoring power, and queued cards preview their lane p assert.equal(q.power, q.basePower + q.trend + bonus); } }); + +test('results explain a tied Topic decided by the on-topic tie-break', async () => { + const { renderToStaticMarkup } = await import('react-dom/server'); + const { createElement } = await import('react'); + const { Results } = await import('../src/game/Results.tsx'); + const html = renderToStaticMarkup(createElement(Results, { modeName: 'Standard', onRematch() {}, onLobby() {}, result: { + winner: 1, turns: 6, reason: 'topics', totalPower: [37, 42], + lanes: [{ name: 'Current Events', myPower: 13, theirPower: 13, winner: 1 }, { name: 'Archive', myPower: 10, theirPower: 10, winner: 0 }, + { name: 'Stub', myPower: 14, theirPower: 19, winner: 1 }] } })); + assert.equal(html.match(/Tie, decided by on-topic cards/g)?.length, 2); +});