Report a Semi-Final slot that was emptied without being refilled
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 3m5s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m18s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped

The re-seed banner listed only the slots that were filled, so a re-seed that
just vacated one — un-recording an Elimination Final result takes its winner
back out of the semi — rendered as "Re-seeded the Semi-Finals: ." with nothing
after the colon.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSDeNWAXvK7nznJqjxn7Jo
This commit is contained in:
Claude 2026-09-11 18:25:15 +00:00
parent cdf86d1682
commit caff5093ae
No known key found for this signature in database
2 changed files with 27 additions and 2 deletions

View file

@ -87,6 +87,20 @@ describe("reseed-afl-semifinals", () => {
}); });
}); });
it("reports a slot that was emptied without being refilled", async () => {
// Un-recording an Elimination Final result takes its winner back out of the semi.
vi.mocked(reseedAflSemiFinals).mockResolvedValue({
vacated: [1, 2],
filled: [{ matchNumber: 2, participantId: "adelaide" }],
});
expect(await run()).toEqual({
success:
"Re-seeded the Semi-Finals: match 1 is back to TBD, " +
"match 2 now hosts Adelaide Crows.",
});
});
it("says so when the pairings are already right", async () => { it("says so when the pairings are already right", async () => {
vi.mocked(reseedAflSemiFinals).mockResolvedValue({ vacated: [], filled: [] }); vi.mocked(reseedAflSemiFinals).mockResolvedValue({ vacated: [], filled: [] });

View file

@ -935,9 +935,20 @@ export async function action({ request, params }: Route.ActionArgs) {
// Only the qualifier slots move, so there is nothing to re-score: no placement, // Only the qualifier slots move, so there is nothing to re-score: no placement,
// score or elimination changes, and so nothing to announce. // score or elimination changes, and so nothing to announce.
const moves = reseed.filled //
// A slot can be vacated without being refilled — un-recording an Elimination Final
// result takes its winner back out — so report those too rather than rendering an
// empty list.
const filled = reseed.filled.map((slot) => ({
matchNumber: slot.matchNumber,
text: `match ${slot.matchNumber} now hosts ${nameOf(slot.participantId)}`,
}));
const emptied = reseed.vacated
.filter((matchNumber) => !reseed.filled.some((slot) => slot.matchNumber === matchNumber))
.map((matchNumber) => ({ matchNumber, text: `match ${matchNumber} is back to TBD` }));
const moves = [...filled, ...emptied]
.toSorted((a, b) => a.matchNumber - b.matchNumber) .toSorted((a, b) => a.matchNumber - b.matchNumber)
.map((slot) => `match ${slot.matchNumber} now hosts ${nameOf(slot.participantId)}`) .map((move) => move.text)
.join(", "); .join(", ");
return { return {