diff --git a/CHANGELOG.md b/CHANGELOG.md index 97ec86b..24db833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,16 @@ so you can always tell what a deployment is actually serving. ## [Unreleased] +## [0.5.1] - 2026-09-03 + +### Changed +- A team that withdraws during a bracket now shows as a **forfeit** in every match it was in + or would have reached, with its name struck through and a "Forfeit · Team" tag on the match, + instead of quietly becoming a bye. If the opponent isn't known yet, the withdrawn team stays + in its slot and forfeits the moment the opponent arrives; in double elimination it forfeits + its losers-bracket match too. Play continues and the tournament still goes Final on its own. +- Pool match lists mark forfeits as "FF". + ## [0.5.0] - 2026-09-03 ### Fixed diff --git a/docs/ORGANIZER-GUIDE.md b/docs/ORGANIZER-GUIDE.md index 8e54fe5..642dda7 100644 --- a/docs/ORGANIZER-GUIDE.md +++ b/docs/ORGANIZER-GUIDE.md @@ -46,7 +46,7 @@ A keeper link can only do two things: update the running score of the live match - *forfeit remaining* — their unplayed pool games become forfeit wins for the opponents; played games stand. This is the fair default when a team leaves mid-pool. - *void all games* — every game they played or would play is removed from standings, as if they never entered. Use this when a team leaves early and forfeits would distort the pool. -In a bracket the opponent advances automatically either way. +In a bracket the opponent advances by forfeit either way: the bracket shows the withdrawn team struck through with a "Forfeit" tag on each match it was in, including a later match whose opponent wasn't known yet at the time (it forfeits as soon as that opponent arrives). Play carries on and the tournament still finishes on its own. **Rain, injury, net repair.** Pause the court (with an optional reason shown on the board). The queue keeps flowing to the other court; Resume picks up where it left off. diff --git a/engine/tournament.js b/engine/tournament.js index c4ec030..1800530 100644 --- a/engine/tournament.js +++ b/engine/tournament.js @@ -179,6 +179,12 @@ export class Tournament { const next = this.match(matchId); if (!next) return; next[side === 'A' ? 'teamA' : 'teamB'] = teamId; + // a withdrawn team was waiting here: it forfeits to the team that just arrived + if (next.autoForfeit && next.teamA && next.teamB && ['pending', 'on_deck'].includes(next.status)) { + const f = next.autoForfeit; delete next.autoForfeit; + if (this.teams.get(teamId)?.status === 'withdrawn') { next.status = 'void'; return; } // both gone + this.recordResult(next.id, [], { actor: 'system', forfeit: f }); + } } _propagate(m) { @@ -264,10 +270,12 @@ export class Tournament { m.court = null; } } else if (['pending', 'on_deck', 'live'].includes(m.status)) { - // bracket: opponent walks over, if known; otherwise the slot becomes a bye + // bracket: opponent walks over by forfeit. If the opponent isn't known yet, the withdrawn + // team stays in its slot marked autoForfeit and forfeits the moment the opponent arrives, + // so the bracket shows the forfeit rather than a silent bye. const opp = m.teamA === teamId ? m.teamB : m.teamA; if (opp) this.recordResult(m.id, [], { actor, forfeit: teamId }); - else { const side = m.teamA === teamId ? 'A' : 'B'; m[side === 'A' ? 'teamA' : 'teamB'] = null; m.pendingBye = side; } + else m.autoForfeit = teamId; m.court = null; } } diff --git a/package.json b/package.json index ea577c7..39bcf72 100644 --- a/package.json +++ b/package.json @@ -1 +1 @@ -{"name":"courtside","type":"module","version":"0.5.0","scripts":{"test":"node --test test/*.test.js","sim":"node simulate.js","start":"node --disable-warning=ExperimentalWarning server/index.js","dev":"node --disable-warning=ExperimentalWarning --watch server/index.js","demo":"node --disable-warning=ExperimentalWarning scripts/seed-demo.js","smoke":"bash test/smoke.sh"},"description":"Self-hosted volleyball tournament desk: one QR code from check-in to live scores","main":"server/index.js","directories":{"test":"test"},"keywords":[],"author":"","license":"MIT","dependencies":{"qrcode":"^1.5.4","ws":"^8.21.3"},"engines":{"node":">=22.13"},"repository":{"type":"git","url":"https://gitea.cloudfreeiot.com/bkvargyas/courtside.git"}} \ No newline at end of file +{"name":"courtside","type":"module","version":"0.5.1","scripts":{"test":"node --test test/*.test.js","sim":"node simulate.js","start":"node --disable-warning=ExperimentalWarning server/index.js","dev":"node --disable-warning=ExperimentalWarning --watch server/index.js","demo":"node --disable-warning=ExperimentalWarning scripts/seed-demo.js","smoke":"bash test/smoke.sh"},"description":"Self-hosted volleyball tournament desk: one QR code from check-in to live scores","main":"server/index.js","directories":{"test":"test"},"keywords":[],"author":"","license":"MIT","dependencies":{"qrcode":"^1.5.4","ws":"^8.21.3"},"engines":{"node":">=22.13"},"repository":{"type":"git","url":"https://gitea.cloudfreeiot.com/bkvargyas/courtside.git"}} \ No newline at end of file diff --git a/server/public-state.js b/server/public-state.js index c03d5fc..acf2c9d 100644 --- a/server/public-state.js +++ b/server/public-state.js @@ -5,7 +5,7 @@ export function publicState({ t, engine }) { id: m.id, stage: m.stage, round: m.round, slot: m.slot, label: m.label ?? null, status: m.status, court: m.court, a: m.teamA ? { id: m.teamA, name: name(m.teamA) } : null, b: m.teamB ? { id: m.teamB, name: name(m.teamB) } : null, - winner: m.winner, sets: m.sets, live: m.live ?? null, liveSets: m.liveSets ?? null, startedAt: m.startedAt ?? null, feeds: m.feeds, feedsSide: m.feedsSide, loserFeeds: m.loserFeeds ?? null, loserFeedsSide: m.loserFeedsSide ?? null, conditional: !!m.conditional, + winner: m.winner, sets: m.sets, forfeitBy: m.status === 'forfeit' ? m.loser : (m.autoForfeit ?? null), live: m.live ?? null, liveSets: m.liveSets ?? null, startedAt: m.startedAt ?? null, feeds: m.feeds, feedsSide: m.feedsSide, loserFeeds: m.loserFeeds ?? null, loserFeedsSide: m.loserFeedsSide ?? null, conditional: !!m.conditional, }); const board = t.phase === 'live' ? engine.board() : null; const pools = t.pools.map(p => ({ diff --git a/server/public/app.css b/server/public/app.css index 16af683..ca65354 100644 --- a/server/public/app.css +++ b/server/public/app.css @@ -84,7 +84,8 @@ ul.plain,ol.plain{list-style:none;padding:0;margin:8px 0}ol.plain{counter-reset: .brow.won .bn{font-weight:600}.brow.won .bs{color:var(--ink);font-weight:600}.brow.mine{background:var(--sand-soft)} .bm.live{border-color:var(--good);box-shadow:0 0 0 1px var(--good)}.bm.on_deck{border-style:dashed}.bm.mine{border-color:var(--sand);border-width:2px} .btag{position:absolute;left:50%;transform:translateX(-50%);bottom:-9px;white-space:nowrap;font-family:"Barlow Condensed",sans-serif;text-transform:uppercase;letter-spacing:.08em;font-size:10px;padding:0 6px;border-radius:3px;background:var(--bg);border:1px solid var(--line);color:var(--muted);line-height:1.5} -.btag.live{background:var(--good);color:#fff;border-color:var(--good)} +.btag.live{background:var(--good);color:#fff;border-color:var(--good)}.btag.ff{background:var(--sand-soft);color:var(--sand);border-color:var(--sand)} +.brow.wd .bn,.wd{text-decoration:line-through;color:var(--muted)}.brow.wd .bn a{color:var(--muted)} .bm.list .btag{position:static;transform:none;display:inline-block;align-self:flex-start;margin:4px 9px 6px} .blist{margin-top:10px}.blist .rlbl{position:static;text-align:left} .bracketwrap.fit .btree-scroll{overflow:hidden} diff --git a/server/public/board.js b/server/public/board.js index b80e6fd..9e8cdb7 100644 --- a/server/public/board.js +++ b/server/public/board.js @@ -10,6 +10,9 @@ // every team name on the board links to that team's page (schedule, record, next match) const teamHref = t => `/t/${state.slug}/teams/${encodeURIComponent(t.id)}`; const name = t => t ? `${esc(t.name)}` : 'TBD'; + const withdrawnIds = () => new Set(state.withdrawn.map(t => t.id)); + const wdClass = t => t && withdrawnIds().has(t.id) ? 'wd' : ''; + const forfeitTag = m => m.forfeitBy ? `Forfeit · ${esc(state.withdrawn.concat(state.teams).find(t => t.id === m.forfeitBy)?.name ?? '')}` : ''; const fromName = (t, from) => t ? name(t) : from ? `${from.loser ? 'loser' : 'winner'} on Court ${from.court}` : 'TBD'; const clock = ms => new Date(ms).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' }); const isMine = m => myTeam && (m.a?.id === myTeam || m.b?.id === myTeam); @@ -102,7 +105,7 @@
| Team | W | L | Pts | +/− |
|---|---|---|---|---|
| ${i + 1}. ${name({ id: r.teamId, name: r.name })}${r.decidedBy ? `*` : ''} | ${r.w} | ${r.l} | ${r.pf}–${r.pa} | ${r.pointDiff > 0 ? '+' : ''}${r.pointDiff} |