Repository navigation
fix(sudoku): render Daily .exhausted as inline empty-state block, not a system alert - #794
Merged
Merged
Conversation
… 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #768 — Sudoku Daily hub's
.exhaustedstate previously floated a system.alertover a blankColor.clearbackdrop, while every same-tier failure state uses an inline icon+message+action block. Converts.exhaustedto the same inline pattern.How
GameShellUI.DailyHubShellViewgains a caller-providedempty:@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.DailyHubViewsupplies the inline block (warning icon, title, message, Practice/Cancel) and drops.alertentirely. 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.scan:l10ngreen, zero new keys..exhaustedsnapshot 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
🤖 Generated with Claude Code