Skip to content

Fix: Auto-exit press controls screen when AirPods disconnect#558

Merged
d4rken merged 1 commit into
mainfrom
fix/press-controls-disconnect
Apr 28, 2026
Merged

Fix: Auto-exit press controls screen when AirPods disconnect#558
d4rken merged 1 commit into
mainfrom
fix/press-controls-disconnect

Conversation

@d4rken

@d4rken d4rken commented Apr 28, 2026

Copy link
Copy Markdown
Member

What changed

When AirPods disconnect while you're on the press controls sub-screen (stem action mappings, press timing options), most controls used to silently hide without telling you why — leaving a half-rendered page where any setting tweak would silently fail. The screen now closes back to device settings as soon as the connection ends, where the existing "Not connected" / "Out of range" cards explain what happened.

Also tightens a couple of entry points so press controls can no longer be opened from device settings while AirPods aren't ready in the first place.

Technical Context

  • Sub-screen had no disconnect feedback because the existing state ?: return early-exit never fires after init — the VM emits a non-null State with device = null on disconnect. The cached profile fallback keeps model.features alive, so stem mappings kept rendering while AAP-gated press-timing rows vanished, producing the half-rendered look.
  • Disconnect signal is device?.isAapConnected (= aap != null), not isAapReady. AAP sessions normally pass through CONNECTING / HANDSHAKING states, so isAapReady would pop users out during routine re-handshakes — isAapConnected only flips when the L2CAP socket actually tears down.
  • Falling-edge flags (hasSeenAapConnected, didAutoNavigate) use rememberSaveable keyed on the profile id. Plain remember would lose the seen-connected bit across rotation, so a rotation that lands after disconnect would leave the user stuck on the stale screen. didAutoNavigate is a one-shot guard against a READY → drop → READY → drop bounce enqueueing two NavEvent.Up and popping past device settings.
  • Entry-gating fixes: the long-press-conflict info-box's "open press controls" button and navToPressControls() itself now both gate on isAapReady. Stricter than the in-session check on purpose — entry should require a fully ready session, but mid-session brief handshaking shouldn't kick the user out.

@d4rken d4rken added the bug Something isn't working label Apr 28, 2026
@d4rken d4rken merged commit d0aab58 into main Apr 28, 2026
10 checks passed
@d4rken d4rken deleted the fix/press-controls-disconnect branch April 28, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant