Skip to content

Improve haptic feedback coverage and event mapping - #95

Merged
austin-smith merged 3 commits into
mainfrom
improve-haptic-feedback
Aug 9, 2026
Merged

Improve haptic feedback coverage and event mapping#95
austin-smith merged 3 commits into
mainfrom
improve-haptic-feedback

Conversation

@austin-smith

Copy link
Copy Markdown
Owner

What Changed

  • Fixed same-tick haptic event coalescing in HapticManager: multiple events fired in one runloop tick previously collapsed to whichever fired last; they now collapse to the highest-ranking event (outcomes > errors/warnings > impacts > selection ticks). A Spider stock deal that completes a run now feels like the run's success instead of losing it.
  • Diversified the event → SensoryFeedback mapping: card pickups are soft impacts, stock draws light, waste recycles medium, and undo/hint/settings interactions are selection ticks instead of six events sharing one generic .impact.
  • Split overloaded events into hintFound, gameSwitched, and runCompleted (banked Spider/Scorpion runs now play .success).
  • Added haptics for: successful card placement in every variant, drag crossing into a valid drop target, Golf dead holes (.warning) and match completion (.success), and confirming a destructive statistics reset (.warning).
  • Moved the undo haptic from the view's animation path into SolitaireViewModel.undo() so every undo entry point fires it, including Golf's dead-hole overlay.
  • Hid the "Haptic feedback" settings toggle on devices without haptic hardware (iPads), using CHHapticEngine.capabilitiesForHardware().

Why

Haptics previously covered card pickups and a few outcomes but skipped the most frequent interaction in the game (a card landing), and the coalescing bug silently dropped events. Distinct feedback per interaction class follows the platform convention of reserving .success/.error/.warning for real outcomes and light impacts for physical card motion.

Validation

  • macOS build passes (xcodebuild -destination 'generic/platform=macOS' build)
  • iOS Simulator build passes
  • Full unit test suite passes (xcodebuild -destination 'platform=macOS' test)

UI Changes

On iPad, the Settings sheet no longer shows the "Haptic feedback" toggle and its section header reads "Sound" instead of "Sound & Haptics". No other visual changes.

Related: #94

same-tick haptic events previously collapsed to whichever fired last;
they now collapse to the highest-ranking one. adds distinct feedback for
card placement, drag-over targets, banked runs, golf endgame moments,
and destructive stat resets, and hides the haptics toggle on ipad.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ccad52a4c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ComputerSolitaire/Views/Shared/ContentView.swift
@austin-smith

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: bced23ca96

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@austin-smith
austin-smith merged commit 5711b3b into main Aug 9, 2026
3 checks passed
@austin-smith
austin-smith deleted the improve-haptic-feedback branch August 9, 2026 05:22
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.

1 participant