Repository navigation
fix(sudoku): sticky digit-first — armed digit survives taps on non-empty cells - #944
Merged
Merged
Conversation
Digit-first `tapCell` used to fall back to `select(...)`, which unconditionally disarms, whenever an armed tap landed on any non-empty cell — a fast sweep died the moment it mis-tapped a filled cell or a given. Per the owner-approved sticky-armed decision: an armed tap now only clears/no-ops without ever disarming. - tapCell(row:column:): empty cell places/toggles-note (unchanged); a user-filled cell holding the armed digit clears it (toggle) in normal mode, or toggles the note in pencil mode; any other non-empty cell (different digit, or a given) is a no-op that stays armed and fires a light haptic via the existing GameAudio haptic seam (`sudokuArmedMismatch`, iOS-only, no new infrastructure). - Re-tapping the armed digit on the keypad remains the only disarm — already worked via `armDigit`'s toggle, verified by existing tests. - Updated doc comments for the `armedDigit != nil ⟺ selection == nil` invariant, which now holds because tapCell never calls select() while armed. Co-Authored-By: Claude <[email protected]>
MAJOR 1 (stale VoiceOver semantics): a sticky-armed tap on a user-filled cell holding the armed digit now CLEARS it (destructive), but the a11y label never announced this, and the "no hint on filled cells" test comment still described the pre-#939 select()-fallback rationale. Thread `pencilMode` into BoardCellView (mirrors the #790 `armedDigit` threading) and append a new "will clear N" hint when armed, non-given, non-error, and non-pencil (pencil mode toggles a note on that same tap, not a clear, so the hint is scoped off there). New catalog key "will clear %lld" fanned out to all 7 locales, mirroring "will place %lld"'s registration; regenerated the SudokuAppCompositionTests l10n fixture via `mise run gen:l10n_fixture`. Rewrote the stale test + added cases for same-digit/different-digit/given/pencil-mode. MAJOR 2 (haptic-only event rescans + logs per tap): `sudokuArmedMismatch` (soundKey: "") hit LiveSoundPlayer's uncached bundle-resolve path (and its per-call missing-asset log) on every mismatch tap in exactly the fast-sweep path #939 optimizes. `play(_:)` now short-circuits on an empty soundKey right after the haptic block, before touching the resolve path; documented the "haptic-only" contract on `AudioEvent.soundKey`. Added a GameAudioKit test locking that the haptic still fires despite the early return (the resolve-skip itself has no unit-testable public signal — `sfxPlayers`/`resolveSFXPlayerLocked` are `private`, unreachable even via `@testable import`). Co-Authored-By: Claude <[email protected]>
`accessibilityLabel`'s `isError` branch returned before the new "will clear" logic, so an armed tap on a CONFLICTING user-filled cell holding the armed digit — which `tapCell` clears exactly like a non-conflicting one — only announced "conflict N" with no hint that the tap would clear it. Append the same "will clear \(digit)" suffix (reusing the existing catalog key, no new string / l10n change) when `armedDigit == digit && !isGiven && !pencilMode`, mirroring the non-error branch's gate. Added matching + pencil-mode-unchanged test cases for the error path. Co-Authored-By: Claude <[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
Sticky digit-first input (owner-approved spec in the issue): while a digit is armed, cell taps never disarm —
AudioEventcontract: emptysoundKeyshort-circuits before the resolve/log path)armedDigit != nil ⟺ selection == nilpreservedVoiceOver truthfulness: "will clear N" hint added for armed same-digit cells (incl. the conflict-cell branch), catalog key
will clear %lldin all 7 locales + regenerated fixture.Verification
mise run scan:l10ngreen; swiftlint --strict clean.Sudoku-only (no shared input code with Minesweeper — verified).
Closes #939
🤖 Generated with Claude Code