fix(board): match the tile board's outer gutters to the gaps between tiles - #749
Open
wyne wants to merge 1 commit into
Open
fix(board): match the tile board's outer gutters to the gaps between tiles#749wyne wants to merge 1 commit into
wyne wants to merge 1 commit into
Conversation
…tiles Tiles have no margins — each draws a 3pt border in the board's background colour, so the gap between two of them is 6. At the board's edge only one tile contributes, leaving 3 against the header and the screen sides, and 5 against the sheet where an extra 2 had been added by hand. Padding the board by one border width makes every gutter the same, whether it falls between two tiles or between a tile and the header, sheet or screen edge. The constant moves to a layout module rather than being exported from PlayerTile: TileBoard's test mocks that component wholesale, so importing from it resolved to undefined and produced padding: NaN. A metric both components share is not a PlayerTile implementation detail. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
The gaps between tiles aren't margins. Each tile draws
borderWidth: 3in the board's background colour, so what you see between two adjacent tiles is two borders — 6pt. At the board's edge only one tile contributes, so the outer gutters were half that.The bottom was 5 rather than 3 because of a hand-added
+ 2onpaddingBottom, which is why the top gap looked visibly tighter than the bottom one.The fix
The board pads its own edges by one border width, supplying the border a tile can't. Every gutter then reads as
TILE_BORDER_WIDTH * 2, and if that 3 ever changes, all four edges and the inter-tile gaps move together.Why the constant moved
It started as an export from
PlayerTile, andTileBoard.test.tsximmediately failed withpadding: undefinedandpaddingBottom: NaN— that suite mocks./PlayerTilewholesale, so the named export vanished.That was worth listening to rather than working around: a gutter metric shared by the board and the tile isn't a
PlayerTileimplementation detail. It lives inBoards/layout.tsnow and both import it.Not addressed here
calculateTileDimensionsdivides the measured height byrows, andonLayoutreports the border box — which already includes the ~82pt of bottom padding reserved for the sheet. So themaxWidth/maxHeighthints passed toAdditionTilefor font sizing have always overstated the real tile height, and this adds 6pt to that. Correcting it would visibly shrink the score fonts, so it wants its own change.ListBoard(the dial layout) is untouched — it uses explicit 10pt padding and doesn't share the border trick, so its gutters won't match the tile board's.Testing
npm run lintclean, 444 tests pass. TheTileBoardpadding assertion now expresses itself in terms of the constant rather than a literal. JS-only — no rebuild needed.🤖 Generated with Claude Code