Skip to content

Work / Chess / Wiki / Entities

preferences

Entitydraftverified 2026-10-12

STORAGE.PREFERENCES

Summary

What Settings stores, and what New game remembers. Draft: the app is built to this; the owner's schema review (T004) is still open.

Canonical values

Key Value Last changed
STORE react-native-mmkv. localStorage on web 2026-10-12
KEY chess.settings.v1 — one JSON string 2026-10-12
THEME system · light · dark. Default system 2026-10-12
BOARD classic · wood · slate. Default classic 2026-10-12
SHOW-LEGAL-MOVES boolean. Default true 2026-10-12
SOUND boolean. Default true 2026-10-12
HAPTICS boolean. Default true 2026-10-12
LAST-SETUP the choices New game opens with. Default: computer, medium, white, face-to-face, no clock 2026-10-12
UNREADABLE wrong version or bad JSON: the defaults are used and written back. A missing field takes its default 2026-10-12
OLD-KEY chess-game-store in AsyncStorage (the last mode and level) is not read. The rebuilt app starts from the defaults 2026-10-12

Shape

interface Preferences {
  version: 1;
  theme: "system" | "light" | "dark";
  board: "classic" | "wood" | "slate";
  showLegalMoves: boolean;
  sound: boolean;
  haptics: boolean;
  lastSetup: {
    opponent: "computer" | "friend";
    level: "easy" | "medium" | "hard";
    side: "white" | "black" | "random";       // Random IS stored here: it is a choice, not a roll
    seating: "face-to-face" | "pass";
    clock: "none" | "5" | "10" | "15+10";
  };
}

Rules

  • Two keys, not one. A setting changed mid-game must not rewrite the game, and a corrupt game must not reset the theme.
  • lastSetup keeps both halves. Switching Opponent from Computer to Friend and back does not lose the level.
  • Ad consent is not here. Google's consent SDK keeps its own record; the app asks it and stores nothing.
  • The board colour is a preference, not part of a game. Changing it changes the saved game's thumbnail too.

Related

Sources

  • .context/features/0009-settings.md
  • .context/designs/mobile/settings/settings.html