Skip to content

fix(minesweeper): flag-mode toggle tints with status.warning — a mode selection is not a warning state #767

Closed

Description

@wei18

Context

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

Problem

The reveal/flag mode-switch button on the Minesweeper board tints itself with theme.status.warning.resolved when in flag mode. Flag mode is a normal, expected input mode — not a warning or degraded state. Reusing the warning token risks reading as "something is wrong with this mode," and design-system.md's color-token table reserves status.* tokens for success/warning/error signaling, not mode selection.

Evidence

Packages/MinesweeperKit/Sources/MinesweeperUI/MinesweeperBoardView.swift:612-628:

private var modeToggle: some View {
    Button {
        interactionMode = interactionMode == .reveal ? .flag : .reveal
        Self.tapModeStore.save(Self.rawValue(for: interactionMode))
    } label: {
        Image(systemName: interactionMode == .flag ? "flag.fill" : "hand.tap.fill")
            .font(.system(size: 20, weight: .semibold))
            .frame(width: 44, height: 44)
    }
    .buttonStyle(.borderedProminent)
    // swiftui-interaction-footguns: theme tint doesn't auto-propagate to
    // system controls — apply `.tint` explicitly. Reveal reads with the
    // app accent; flag switches to the warning tone so the two modes are
    // color-distinct, not just icon-distinct.
    .tint(interactionMode == .flag ? theme.status.warning.resolved : theme.accent.primary.resolved)

The comment confirms this is a deliberate choice ("flag switches to the warning tone so the two modes are color-distinct") rather than an accident — but the token choice itself conflicts with the design system's own reserved-usage rule for status.*.

Impact

  • A player switching to flag mode — a routine, frequent action in normal play — sees a color the rest of the app reserves for warnings/errors, which can read as "you did something wrong" rather than "you're in a different, equally valid mode."
  • status.warning loses its exclusivity as a signal for actual problem states once it's also used for ordinary mode selection, weakening the token's meaning everywhere else it appears.

Suggested fix

Switch the flag-mode tint to a second accent step (e.g. theme.accent.secondary if one exists) or accent.muted — something in the accent family that's still visually distinct from reveal mode's primary accent, without borrowing the warning token. Leaves status.warning free for its documented use (success/warning/error signaling only).

Acceptance criteria

  • Flag mode's toggle button no longer uses theme.status.warning (or any status.* token) for its tint.
  • Reveal and flag modes remain visually distinct via color (not just the icon swap already in place).
  • No other call site in the codebase needs updating (confirm this is the only use of status.warning for mode-selection rather than an actual warning state — a quick grep for status.warning usage is worth a sanity check during implementation).

Source & dependencies

  • From meetings/2026-07-11_design-db-uiux-audit.md (finding N2, MINOR), local-only branch docs/design-db-audit-and-specs, not yet pushed — this issue body is self-contained.

Activity

  1. added
    bug
    minesweeper
    audit
    on Jul 11, 2026
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

    auditbugminesweeper

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions