Skip to content

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

Closed

Description

@wei18

Context

Static-code UI/UX audit round (2026-07-11, read-only, state-tier consistency check). Repo state: main @ 382eabd; re-verified against main @ ff4e010 on 2026-07-11 (same code).

Related but distinct: issue #686 (closed) fixed a functional bug in this same alert — the "Try another difficulty" button previously did nothing; it now correctly routes to the Practice hub (viewModel.tryPracticeInstead()). This issue is about the visual-language inconsistency of using a system .alert at all for this state, which #686 did not change.

Problem

SUD-DAILY-HUB's .exhausted state renders as Color.clear under a floating system .alert, while every other same-tier failure state in the app (.failed, SUD-BOARD-LOAD-FAILED) uses an inline block (icon + message + action) directly in the content area. Two different visual languages exist for what is structurally the same "this screen couldn't produce content" case.

Evidence

.exhausted (system alert over blank content), Packages/SudokuKit/Sources/SudokuUI/Daily/DailyHubView.swift:54-74:

.task { await viewModel.bootstrap() }
.alert(
    "Couldn't generate today's puzzle",
    isPresented: Binding(
        get: { viewModel.state == .exhausted },
        set: { _ in }
    ),
    actions: {
        // #686: the label promised a difficulty picker this hub
        // doesn't have — route to the Practice hub that actually has
        // one (reuses the existing "Practice" key, same string the
        // Home card/PracticeHubView title already surface).
        Button("Practice") { viewModel.tryPracticeInstead() }
        Button("Cancel", role: .cancel) { viewModel.dismissExhausted() }
    },
    message: {
        Text("Try a different difficulty, or come back tomorrow.")
    }
)

The screen's actual content behind this alert is Color.clear — a blank backdrop — while the alert floats over it.

.failed (inline block), same file, DailyHubView.swift:42-49:

failure: { reason in
    VStack(spacing: 12) {
        Image(systemName: "exclamationmark.triangle.fill")
            .foregroundStyle(theme.status.warning.resolved)
        Text(reason)
            .font(.caption)
            .foregroundStyle(theme.text.secondary.resolved)
    }
}

SUD-BOARD-LOAD-FAILED uses the same inline-block pattern (icon + message + Retry action) elsewhere in the codebase.

Impact

  • Same-tier failure states (both "this screen has nothing to show the user") read as two unrelated UI patterns depending on which specific failure it is — inconsistent with the rest of the app's state-tier discipline, which this audit otherwise found consistent everywhere else.
  • The blank Color.clear backdrop behind the alert briefly shows an empty screen before/around the system dialog, which reads as more jarring than the calm inline-block pattern used elsewhere.

Suggested fix

Convert .exhausted to the same inline empty-state block pattern used by .failed — icon + message + action — keeping its existing "Practice" / "Cancel" actions as inline buttons instead of .alert actions. The functional routing already fixed in #686 (tryPracticeInstead(), dismissExhausted()) should carry over unchanged; this is a presentation-layer change only.

Acceptance criteria

Source & dependencies

Activity

  1. added
    bug
    audit
    on Jul 11, 2026
  2. wei18 commented on Jul 13, 2026

    @wei18
    OwnerAuthor

    Owner adjudication 2026-07-13: the shared-shell policy codified in DailyHubShellView.swift:78-82 ("Shell shows an empty backdrop so the alert reads as the primary surface") is overturned for Sudoku's .exhausted. Replace the system alert over Color.clear with an inline block consistent with the .failed treatment (DailyHubShellView.swift:83-85). Note: Minesweeper has no .exhausted/.failed path (non-throwing generation) — scope the fix to Sudoku only.

  3. wei18 commented on Jul 13, 2026

    @wei18
    OwnerAuthor

    🔒 Claiming: this issue is being worked on now (session 2026-07-13, Leader + dispatched Developer). Scope: presentation-only conversion of Daily .exhausted from system .alert to the inline empty-state block per the acceptance criteria; #686 routing behavior carries over unchanged; existing L10n keys reused. Other agents: please don't pick this up concurrently.

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

    auditbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions