Skip to content

Device: Add Press Controls screen to customise press behaviour#523

Merged
d4rken merged 2 commits into
mainfrom
feat/press-controls
Apr 17, 2026
Merged

Device: Add Press Controls screen to customise press behaviour#523
d4rken merged 2 commits into
mainfrom
feat/press-controls

Conversation

@d4rken

@d4rken d4rken commented Apr 17, 2026

Copy link
Copy Markdown
Member

What changed

A new Press Controls screen under Device Settings consolidates every press-related setting into one place: press speed, press & hold duration, call-button mapping, and (for stemmed AirPods) custom single / double / triple / long press actions. Previously these were scattered across the Controls card and a separate "Stem Actions" screen.

Stem action mappings are now per-device. If you own more than one pair of AirPods you can set different mappings on each one.

A Pro badge appears on the Press Mappings section header so you can see upfront that assigning custom actions requires an upgrade, rather than finding out only after tapping a dropdown.

The screen name was chosen to fit both stemmed AirPods and the AirPods Max (Digital Crown / noise control button).

Technical Context

  • Mappings moved from a global DataStore (StemActionSettings) onto a new stemActions: StemActionsConfig field on AppleDeviceProfile. No migration path — feature was beta / unreleased, so accepting the data loss was simpler than per-profile bootstrapping. Beta users with custom mappings will see them reset on update.
  • Pro gate moved from screen-entry (navToPressControls()) to per-mapping setter. Each setter checks, in order: (1) no-op short-circuit if action == current, (2) free-clear allowance if action == NONE, (3) Pro check — otherwise navigate to Upgrade. Rule (2) prevents lapsed-Pro users from being trapped with old mappings.
  • StemPressReaction now resolves the event address to a profile before looking up the mapped action. StemConfigSender computes a per-profile mask instead of broadcasting one shared mask, so a device with no custom mappings gets 0x00 and won't intercept presses at all.
  • StemAction enum and the AAP protocol classes (StemPressEvent, StemPressReaction, StemConfigSender) keep their names intentionally — they describe Apple's on-wire protocol, not the UI.
  • PressMappingsCard was extracted into its own file so it has self-contained Compose previews for Pro and non-Pro states; the screen itself also has Pro / non-Pro / press-only-device previews.
  • Nav key change from data object StemActionConfig to data class PressControls(profileId) — saved back-stack state from before the change won't deserialise cleanly, which is acceptable since the screen was beta.

Review checklist

  • Device Settings → Controls card shows only the Press Controls nav link plus Volume Swipe toggle and wait time
  • Tap Press Controls → timing / call sections render first, then the Press Mappings card with an Upgrade badge (free) or without it (Pro)
  • Free user picking a non-NONE mapping navigates to Upgrade without persisting; clearing to NONE always works
  • Two profiles with different mappings trigger different actions on their respective devices
  • Press-only device (press timing / call controls but no hasStemConfig) shows the nav link and opens the screen with timing / call sections only — no mapping rows, no reset button, no ANC info box

…ls screen

Move press timing, call controls, and stem mappings out of the Controls card into a new Press Controls screen. The screen name is device-agnostic so it applies to both stemmed AirPods and the AirPods Max's Digital Crown/noise button.

Stem mappings are now per-device (stored on the AppleDeviceProfile) rather than a single app-global DataStore. The Pro gate for mappings moves from screen entry to per-change with an Upgrade badge on the mappings card header, so free users can still access the non-Pro press timing and call-control settings that live on the same screen.
@d4rken d4rken added enhancement Add a new feature of improve an existing feature device support labels Apr 17, 2026
@d4rken d4rken merged commit c19b0b3 into main Apr 17, 2026
6 of 10 checks passed
@d4rken d4rken deleted the feat/press-controls branch April 17, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

device support enhancement Add a new feature of improve an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant