Add tactile consent feedback to the iOS app (haptics + press style) - #79
Merged
Conversation
Lumen's identity is consent-before-action and calm, Apple-tier polish, but the app had no haptic feedback anywhere and no press feedback on buttons. This adds a small, centralized tactile layer at the moments that matter. New (Lumen/Support/): - LumenHaptics: a @mainactor enum that is the single place that speaks to the Taptic Engine — success / warning / error / selection / impact. All feedback is suppressed under XCTest so headless unit runs stay silent. - PressableButtonStyle: a `.buttonStyle(.pressable)` that eases the label down and dims it while pressed, honoring Reduce Motion (drops the scale). Wired into the consent path (view models are the single source of truth for user-initiated actions, so automated geofence/schedule runs stay silent): - SceneViewModel.execute: success/error haptic on scene run. - SceneViewModel.toggleFavorite: selection tick. - HomeViewModel.executeScene: success/error haptic on the dashboard apply. - HomeDashboardView: soft bump only on an actual arrival/departure change. - SceneApprovalSheet + LumenActionView "Apply" CTAs: `.pressable` press feel. Tests (LumenTests/LumenHapticsTests.swift): assert the XCTest guard disables haptics and that every entry point is a safe no-op while disabled. Note: this environment is Linux, so the iOS target could not be compiled or run here — changes were made by reasoning about the source and follow the repo's existing patterns (synchronized-folder targets, pure/testable helpers, the XCTest env guard used in RootView). Build and run in Xcode to verify feel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PE4HFdLKjK4er6BBAgbgrb
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
A focused UX pass on the iOS app. Lumen's whole identity is consent-before-action and calm, Apple-tier polish — but the app had no haptic feedback anywhere and no press feedback on buttons. This adds a small, centralized tactile layer at the moments that matter, so approving something actually feels like a deliberate, confirmed action.
What changed
New (
Lumen/Support/)LumenHaptics— a@MainActorenum that is the single place that speaks to the Taptic Engine (success/warning/error/selection/impact). All feedback is suppressed under XCTest so headless unit runs stay silent, matching theXCTestConfigurationFilePathguard already used inRootView.PressableButtonStyle—.buttonStyle(.pressable): the label eases down slightly and dims while pressed, honoring Reduce Motion (drops the scale, keeps the gentle dim).Wired into the consent path (view models are the single source of truth for user-initiated actions, so automated geofence/schedule runs deliberately stay silent):
SceneViewModel.execute— success / error haptic on a scene run.SceneViewModel.toggleFavorite— a selection tick.HomeViewModel.executeScene— success / error haptic on the dashboard "Apply".HomeDashboardView— a soft bump only on an actual arrival/departure change (not on every screen appearance).SceneApprovalSheet+LumenActionView"Apply" CTAs —.pressablepress feel.Tests —
LumenTests/LumenHapticsTests.swiftasserts the XCTest guard disables haptics and that every entry point is a safe no-op while disabled.A note on verification
This session ran on Linux, where the iOS target cannot be compiled or run (
xcodebuild/ the Simulator need macOS + Xcode). These changes were made by reasoning about the source and deliberately follow the repo's existing patterns:Lumen/,LumenTests/), so they're picked up automatically without editingproject.pbxproj.@MainActor; every call site is already on the main actor.Please build and run in Xcode to confirm the feel before merging — I couldn't exercise it here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PE4HFdLKjK4er6BBAgbgrb
Generated by Claude Code