Skip to content

persist explorer player-tab color across refresh#20270

Merged
ornicar merged 2 commits into
lichess-org:masterfrom
CZapin2015:fix/explorer-remember-color
Apr 21, 2026
Merged

persist explorer player-tab color across refresh#20270
ornicar merged 2 commits into
lichess-org:masterfrom
CZapin2015:fix/explorer-remember-color

Conversation

@CZapin2015

@CZapin2015 CZapin2015 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Closes #18107.

Problem

On the analysis Explorer, setting the Player tab side to Black and refreshing reverts it back to White. The tab and player name are preserved because they use storedProp, but color was a plain in-memory prop.

Fix

One field change in ui/analyse/src/explorer/explorerConfig.ts:

  • color: Prop<Color>color: StoredProp<Color>
  • prop(root.bottomColor())storedProp<Color>('analyse.explorer.color', root.bottomColor(), str => str as Color)

Matches the pattern used by the db field two lines above.

Testing

Verified end-to-end locally against lila-docker running my branch:

  1. Opened Explorer config → Player tab → toggled to "as black"
  2. Hard-refreshed the page
  3. Reopened Explorer config → Player tab
  4. Side was still "as black"

Also compared against production lichess.org in the same session, where the same flow reverts to "as white" on refresh.

Screen recording demonstrating both the production bug and the localhost fix attached below.

2026-04-17.16-07-46.mp4

AI disclosure

Parts of this change were drafted with help from Claude (Anthropic). Prompt intent: locate the one-line field in the explorer config that isn't persisted and make it match the pattern used by the other persisted fields in the same object. All code reviewed by me and verified locally.

@CZapin2015
CZapin2015 force-pushed the fix/explorer-remember-color branch from 9423f2a to d578ede Compare April 17, 2026 20:17
@CZapin2015
CZapin2015 marked this pull request as ready for review April 17, 2026 20:22
Closes lichess-org#18107. The color prop was in-memory only while sibling
prefs (db, player name, etc.) already use storedProp, so a refresh
snapped the side back to white. Switch color to storedProp to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ornicar
ornicar force-pushed the fix/explorer-remember-color branch from d578ede to 955c27f Compare April 21, 2026 08:37
@ornicar
ornicar merged commit f100317 into lichess-org:master Apr 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explorer player tab doesn't remember the side

2 participants