Skip to content

feat(shell): Statistics screen v1 from PersonalRecord (adopted proposal) #773

Closed

Description

@wei18

Context

Progress currently has no dedicated presentation surface in either app. The 2026-07-05 audit round flagged a missing Statistics section with no follow-up since; the 2026-07-11 round confirmed the gap is total and surfaced a live doc/code contradiction (docs/screen-contracts.md claims a Settings "stats row" that does not exist — tracked separately in the companion docs: as-built drift issue). The only progress data that exists today lives silently in PersonalRecord with no UI reading it.

Adopted design

A new, independent Stats screen (per-app, copy-paste-adapt like everything else — no shared cross-app Stats abstraction).

Entry points:

  • Home: a secondary-weight entry (a row or small card below the four existing mode cards) — deliberately not competing with Daily/Practice/Leaderboard/Settings for first-glance visual weight.
  • Settings: a real disclosure-row (chevron, native Settings-Form styling matching the rest of SETTINGS's row conventions) that pushes to the Stats screen. This is the actual fix for the doc/code contradiction — the row becomes real rather than the phantom inline row the doc currently (wrongly) describes.

Layout:

  • Daily/Practice split as two sections, or a segmented control at the top — either acceptable (open question below) — since PersonalRecord doesn't distinguish daily vs. practice completions for Minesweeper today (see Prerequisites).
  • Hero number: current streak (once the companion daily-calendar-streak feature's streak-counting logic exists — see Dependencies), rendered .largeTitle/.semibold per the design system's "Screen title" role.
  • Stat tiles (secondary): one row of tiles per difficulty (Easy/Medium/Hard), each showing: games completed, best time, average time (computed client-side as totalTimeSeconds / completedCount, not stored). Minesweeper additionally shows win rate per difficulty if a loss count is available (see Prerequisites — currently unconfirmed). Tiles use .title3/.medium for the number, .caption for the label.
  • Tertiary: small caption-weight explanatory text under the tile grid (e.g. a factual note about stats persistence) — .caption2.

Color/brand discipline:

  • No trophy/medal iconography, no confetti, no celebratory flourish anywhere on this screen — it's a factual readout, matching the brand's no-celebration stance.
  • status.success is the only status-family token this screen touches, used only to mark a just-set personal-best tile (a subtle accent on the specific tile that changed) — never as a full-screen wash.
  • difficulty.* tokens identify per-difficulty tiles (matching their existing signaling-only role elsewhere) — not applied to the hero streak number or any CTA.
  • Numbers use .title3/.medium — no custom oversized display font, no new type role.

Platform behavior:

  • iOS/iPad: pushed screen (matches every other secondary screen's presentation style); tile grid reflows to more columns on iPad regular the same way other card grids already do.
  • macOS: pushed into the NavigationSplitView detail column, same 960pt-clamp-and-center treatment the boards already use.
  • Accessibility: at .accessibility3, tiles stack vertically (same policy LeaderboardView already applies at .accessibility3+). VoiceOver reads each tile as one combined element ("Easy, 14 completed, best time 3 minutes 12 seconds").

v1 data scope (hard limits — not a design choice, a real data-availability constraint)

PersonalRecord today has exactly: recordName, bestTimeSeconds (nilable), totalTimeSeconds, completedCount, lastUpdatedAt, completedPuzzleIds (deduped) — keyed by (mode, difficulty), not by day. Sufficient for v1's fields above (completed count, best time, average time per difficulty) with zero schema changes. Explicitly not sufficient for:

  • Mistake/error counts — no such field exists anywhere. Out of v1 scope, a v-next schema-extension candidate.
  • Per-day completion history / a real trend line — SavedGameSummary doesn't persist permanent per-completion history. v1 ships static current-value tiles only, no trend charting, no historical toggle. Hard v1 limitation.

Acceptance criteria

  • Home shows a Stats entry that is visually secondary to the four existing mode cards (not equal first-glance weight).
  • Settings' stats row is a real, working disclosure row that pushes to the Stats screen — and docs: as-built drift — screen-contracts.md claims Settings stats/locale rows that don't exist; 01-root.md claims Mac sidebar selected-tint that isn't implemented #769's screen-contracts.md correction reflects this real row.
  • Stats screen renders, per difficulty, using only fields that exist on PersonalRecord today: completed count, best time, average time (computed, not stored) — no schema migration required to ship v1.
  • No mistake/error count and no per-day history/trend chart appear anywhere on the v1 screen.
  • No trophy, medal, confetti, or celebratory motion appears on this screen under any state.
  • status.success appears only as a per-tile accent on a just-set personal best, never as a full-screen treatment.
  • At .accessibility3 Dynamic Type, the tile grid stacks vertically without truncating any label or number.
  • VoiceOver reads each stat tile as one combined, correctly-labeled element.
  • On macOS, the screen renders inside the clamped detail column, not full-window.

Prerequisites (verified against the codebase)

  • All v1 fields are already persisted and readable with zero schema change — Verified: PersonalRecord.swift:19-32 has bestTimeSeconds/totalTimeSeconds/completedCount per (mode, difficulty) today.
  • Minesweeper's PersonalRecord is populated today (contrary to an earlier stale assumption from a prior audit pass) — verified directly against main @ ff4e010: MinesweeperPersonalRecordStore is wired at submitDailyTimeIfWon() (Packages/MinesweeperKit/Sources/MinesweeperUI/MinesweeperGameViewModel+SubmitOnWin.swift), shipped in feat(minesweeper): add MS-specific personal-record store, wired at daily win #706/feat(minesweeper): wire PersonalRecordSink via makeCompletionSinks #699, deployed to CloudKit Production 2026-07-06. Scope limit: this write path is gated to mode == .daily only — Minesweeper practice wins do not populate PersonalRecord yet. Widening to practice is already tracked in the open, unrelated issue feat(minesweeper): record practice personal bests (needs per-game unique practice id) #705 ("record practice personal bests — needs per-game unique practice id") — this Stats screen's Minesweeper practice-section tiles depend on feat(minesweeper): record practice personal bests (needs per-game unique practice id) #705 landing; the daily-section tiles do not.
  • MS win-rate-per-difficulty derivability from existing fields — Unconfirmed: completedCount alone doesn't distinguish "played and won" from "played" for Minesweeper the way it implicitly does for Sudoku (an MS board ending in a mine hit is a loss, not a completion, and no loss counter is confirmed adjacent to PersonalRecord). Needs a direct check before the MS win-rate tile is built as described.
  • Streak number depends on the companion daily-calendar-streak feature's streak-counting logic — Unconfirmed by design: if that feature ships after this one, v1 of this screen should omit the hero streak number or ship it as a stub.

Open questions for product

  1. Daily/Practice split as two sections vs. a single segmented control — agnostic; pick per what reads cleaner once Minesweeper's daily/practice distinction is available.
  2. Sequencing: does this screen ship before, after, or alongside the daily-calendar-streak feature? The hero streak number depends on it.
  3. Should the MS win-rate tile be held for a v-next schema extension (a loss counter) rather than guessed at, given the unconfirmed prerequisite above?

Scope note

Per-app screen (Sudoku and Minesweeper each get their own instance, no shared cross-app component extraction), introduces no monetization surface, adds no celebratory visual treatment of any kind.

Source & dependencies

Activity

  1. added
    enhancement
    on Jul 11, 2026
  2. wei18 commented on Jul 11, 2026

    @wei18
    OwnerAuthor

    Full spec is now pushed on branch docs/design-db-audit-and-specs → docs/v2/stats-screen-proposal.md (includes adjudications, prerequisites with GitHub cross-refs, and acceptance checklist). Audit context: meetings/2026-07-11_design-db-uiux-audit.md on the same branch. MS Practice tab depends on #705; Daily-mode data already ships.

  3. wei18 commented on Jul 14, 2026

    @wei18
    OwnerAuthor

    🔒 Claiming + §What adjudications (owner, 2026-07-14). Implementation starts after #744 merges (both touch SettingsScreen.swift — serialized deliberately):

    1. Layout: Daily and Practice as two stacked sections (no segmented control).
    2. Streak number: OMITTED entirely from v1 — no stub, no hero slot; a small follow-up PR adds it once feat(daily): week-strip calendar + streak on Daily hub (adopted proposal) #774 ships.
    3. MS win-rate tile: NOT in v1 — no loss counter exists on PersonalRecord; a loss-count field is a v-next add-only schema-extension candidate (needs the user-owned CloudKit prod Console deploy gate; deliberately out of scope).

    Dependency updates since filing: #705 is CLOSED — MS practice personal bests write since #779 (SubmitOnWin doc comment confirms daily AND practice eligible), so the MS Practice section ships in v1 with real data (the issue text predates this). #769 is also closed; the screen-contracts.md stats-row correction will need a re-touch when the real row lands (folded into this PR).

    Other agents: please do not pick this up concurrently.

  4. wei18 commented on Jul 14, 2026

    @wei18
    OwnerAuthor

    §What amendment (owner, 2026-07-14, supersedes the entry-points portion of the previous adjudication comment):

    1. Entry points: Home entry ONLY (secondary-weight row/card below the four mode cards). The Settings disclosure row is DROPPED from scope — do not add any Settings row. (screen-contracts.md therefore needs no stats-row re-touch; docs: as-built drift — screen-contracts.md claims Settings stats/locale rows that don't exist; 01-root.md claims Mac sidebar selected-tint that isn't implemented #769 already removed the phantom claim and that state stays correct.)

    All other adjudications (stacked sections / no streak in v1 / no MS win-rate tile) stand. Implementation still starts after #744 merges — the remaining file overlap is the per-app LiveRouteFactory route tables, which #744 is also touching.

  5. wei18 commented on Jul 14, 2026

    @wei18
    OwnerAuthor

    §What final note (owner, 2026-07-14): design execution = direct implementation from the adopted proposal + design-system.md (no separate HTML mock round). Visual acceptance happens on the PR's snapshot baselines / sim screenshots. All adjudications now recorded; implementation dispatches immediately after #744 merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions