User customization (board chrome)

Abstract Play stores per-user renderer overrides in the front-end profile under customizations[metaGame].render. The renderer package implements merge, validation, and sanitization so the site does not duplicate board rules.

Contract

Client field Renderer API Effect
render.board applyBoardChrome(rep, boardChrome) Shallow merge of allowlisted boardBasic keys onto the game’s render rep
render.options Same call: { ...board, options } Replaces rep.options when present
render.glyphmap Renderer options.glyphmap (not rep merge) Legend glyph id + scale at draw time; remapped layers default to screen-upright when orientation is omitted (see Glyphs)

Entry points exported from @abstractplay/renderer:

Eligibility

API Meaning
isBoardStyleCustomizationEligible(rep) May swap board.style (row/column string grid in a registry swap group)
isBoardFieldChromeEligible(rep) May merge other render.board fields (labelScale, strokes, markers, …)
render.options / render.glyphmap Applied for any rep; unsupported options are ignored at draw time

Specialized styles (pegboard, vertex-fanorona, squares-diamonds, …) do not allow style swaps; labelScale, render options, and glyphmap still apply when saved.

Style compatibility

getCompatibleStyles(currentStyle) lists swappable board.style values within the same registry group. Cross-group changes (e.g. squares-stacked → vertex, or hex-of-hex → vertex) fail validateRenderCustomization.

Group Swappable styles
Row/column grid vertex, vertex-cross, squares, squares-checkered, squares-beveled
Stacked squares squares-stacked + flat rect styles above (not vertex)
Hex min/max grid hex-of-hex (hex cells) ↔ hex-of-tri (triangle vertices); same minWidth / maxWidth string grid

squares-diamonds, pegboard, and vertex-fanorona are not user-swappable. hex-of-tri-f and other hex topologies are outside the hex min/max pair for now.

Swapping hex-of-hex ↔ hex-of-tri changes drawing and click geometry while row/col indices stay the same (like vertex ↔ checkered on square grids).

Board fields (allowlist)

Includes style, strokeWeight, labelScale, labelColour, labelOpacity, strokes, backFill, markers, rotate, tile flags, blocked, etc.

Denied in user chrome: width, height, and other dimension keys that would break game logic.

labelScale

Optional number on boardBasic (default 1). Row/column coordinate labels under #labels use:

baseFontSize × labelScale (base is topology-specific; many rect grids use a fixed px default, hex rects use cellsize / 5).

Markers

Live play

Front passes sanitizeMode: 'live' so unsupported markers (e.g. flood after a style change) are stripped instead of throwing.

Related