Skip to content

fix(sudoku): render Daily .exhausted as inline empty-state block, not a system alert - #794

Merged
wei18 merged 1 commit into
mainfrom
fix/768-exhausted-inline-block
Jul 13, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/768-exhausted-inline-block

Conversation

@wei18

@wei18 wei18 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

What

Closes #768 — Sudoku Daily hub's .exhausted state previously floated a system .alert over a blank Color.clear backdrop, while every same-tier failure state uses an inline icon+message+action block. Converts .exhausted to the same inline pattern.

How

  • GameShellUI.DailyHubShellView gains a caller-provided empty: @ViewBuilder (default { Color.clear }) — the extension point the shell's own doc comment had anticipated. Minesweeper's call site compiles unchanged (verified by build + the shell's genericity sentinel tests); GameShellKit stays zero-dependency.
  • SudokuUI.DailyHubView supplies the inline block (warning icon, title, message, Practice/Cancel) and drops .alert entirely. Practice → tryPracticeInstead(), Cancel → dismissExhausted() — fix(sudoku): Daily hub 'exhausted' alert offers 'Try another difficulty' but the button does nothing #686 routing byte-identical; pre-existing routing tests pass unmodified.
  • All 4 strings reuse existing xcstrings keys (7 locales) — scan:l10n green, zero new keys.
  • New .exhausted snapshot baseline seeds the state through the real bootstrap failure path (not injected state); eyeballed.
  • docs/v1/design.md §How.6.3/§How.6.6 stale "Alert" rows updated. Remaining doc references in design prototypes/flow docs tracked as follow-up docs: sweep remaining .exhausted-as-alert references after #768 (daily-hub design docs + prototype) #793.

Verification

  • SudokuKit DailyHub suites 32/32 · GameShellKit 16/16 · MinesweeperKit builds clean (zero MS changes) · swiftlint --strict clean · scan:l10n pass.
  • Dual code review: mechanical APPROVE (8/8 checklist) + adversarial APPROVE (shell API default-inference, Cancel semantics, state mapping, L10n keys all independently verified).

🤖 Generated with Claude Code

… a system alert

Daily hub's `.exhausted` state previously floated a system `.alert` over a
blank `Color.clear` backdrop, while `.failed` (and SUD-BOARD-LOAD-FAILED)
already use an inline icon+message+action block. Converts `.exhausted` to
the same inline pattern:

- GameShellUI.DailyHubShellView: adds a caller-provided `empty:` builder
  (defaults to `Color.clear`) for the `.empty` HubLoadState case, per the
  extension point the shell's own doc comment had already anticipated.
  Minesweeper never reaches `.empty` (pure, non-throwing generation) and
  relies on the default, so it needs no changes.
- SudokuUI.DailyHubView: supplies an inline VStack (warning icon, title,
  message, Practice/Cancel buttons) as the `empty:` builder and drops the
  `.alert(...)` modifier entirely. "Practice" -> tryPracticeInstead() and
  "Cancel" -> dismissExhausted() are wired unchanged from #686. All four
  strings ("Couldn't generate today's puzzle", "Try a different
  difficulty, or come back tomorrow.", "Practice", "Cancel") reuse the
  existing xcstrings keys the alert already used across all 7 locales —
  no new L10n keys, `mise run scan:l10n` passes.
- Adds a new `.exhausted` snapshot baseline (DailyHubViewTests) pinning
  the inline block so a regression back to a blank backdrop shows up as a
  snapshot diff.

Acceptance criteria (#768):
- [x] `.exhausted` renders inline (icon + message + action buttons),
  matching `.failed` / SUD-BOARD-LOAD-FAILED's visual language.
- [x] Practice/Cancel remain functionally identical (#686 routing
  unchanged, only wired to inline Button actions).
- [x] No `Color.clear` blank backdrop moment before the state renders.

Closes #768

Co-Authored-By: Claude Fable 5 <[email protected]>
@wei18
wei18 enabled auto-merge (squash) July 13, 2026 08:03
@wei18
wei18 merged commit 83af14c into main Jul 13, 2026
4 checks passed
@wei18
wei18 deleted the fix/768-exhausted-inline-block branch July 13, 2026 08:03
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.

fix(sudoku): Daily .exhausted shows a system alert over a blank page — inconsistent with inline board-load-failed treatment

1 participant