Problem
The admin UI permits multiple isFreeSpace tiles. effectivePoolSize subtracts every free space after the first, but getCardSize still returns the minimum size of 5. pickCardWithFreeSpace then drops all but one free-space tile and can return fewer than 25 cells. tooFewTiles uses the raw tile count, so it does not prevent rendering.
Reproduction
- Create a 25-tile pool with two tiles marked Free.
- Open
/bingo.
The effective pool is 24, the selected card has 23 regular tiles plus one centered free space (24 total), and the UI renders only 24 cells in a 5-column grid. The core calculation reproduces as { effectivePoolSize: 24, cardSize: 5, renderedTiles: 24 }.
Suggested fix
Validate or enforce exactly zero or one free-space tile, or base the availability check on the effective pool and require cardSize ** 2 selected tiles before showing the board. The tile admin should prevent the invalid configuration or clearly normalize extra free spaces.
Affected code
src/lib/bingo.ts
src/lib/server/cardShuffle.ts
src/routes/bingo/+page.server.ts
src/routes/admin/tiles/+page.server.ts
Problem
The admin UI permits multiple
isFreeSpacetiles.effectivePoolSizesubtracts every free space after the first, butgetCardSizestill returns the minimum size of 5.pickCardWithFreeSpacethen drops all but one free-space tile and can return fewer than 25 cells.tooFewTilesuses the raw tile count, so it does not prevent rendering.Reproduction
/bingo.The effective pool is 24, the selected card has 23 regular tiles plus one centered free space (24 total), and the UI renders only 24 cells in a 5-column grid. The core calculation reproduces as
{ effectivePoolSize: 24, cardSize: 5, renderedTiles: 24 }.Suggested fix
Validate or enforce exactly zero or one free-space tile, or base the availability check on the effective pool and require
cardSize ** 2selected tiles before showing the board. The tile admin should prevent the invalid configuration or clearly normalize extra free spaces.Affected code
src/lib/bingo.tssrc/lib/server/cardShuffle.tssrc/routes/bingo/+page.server.tssrc/routes/admin/tiles/+page.server.ts