Night 1 fix: results card explains on-topic tie-breaks (#51)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #51.
This commit is contained in:
2026-11-17 06:14:52 +00:00
co-authored by Claude Opus 5.5
parent 4dba8b3653
commit 33b11a5491
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -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' : ''}.`}</p>
<ol className="result-lanes">
{result.lanes.map(l => <li key={l.name} className={l.winner === 0 ? 'won' : l.winner === 1 ? 'lost' : 'tied'}>
<span>{l.name}</span><b>{l.myPower} – {l.theirPower}</b><small>{l.winner === 0 ? 'Won' : l.winner === 1 ? 'Lost' : 'Tied'}</small>
<span>{l.name}</span><b>{l.myPower} – {l.theirPower}</b><small>{l.winner === 0 ? 'Won' : l.winner === 1 ? 'Lost' : 'Tied'}</small>{l.winner !== null && l.myPower === l.theirPower && <small className="tie-note">Tie, decided by on-topic cards</small>}
</li>)}
</ol>
<p className="muted small">Matches are off-chain. No card was moved or burned.</p>
+1
View File
@@ -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}
+11
View File
@@ -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);
});