Skip to content

feat(linux/rust) - implement popup animation and integrate frame assets into UI components#597

Open
jdmarinv wants to merge 1 commit into
kavishdevar:linux/rustfrom
jdmarinv:feature/battery-ownership-fix
Open

feat(linux/rust) - implement popup animation and integrate frame assets into UI components#597
jdmarinv wants to merge 1 commit into
kavishdevar:linux/rustfrom
jdmarinv:feature/battery-ownership-fix

Conversation

@jdmarinv
Copy link
Copy Markdown

@jdmarinv jdmarinv commented May 14, 2026

PR: Implement Popup Animation, LE Hardening, and AACP Protocol Enhancements

Description

This pull request introduces a major visual and functional update to the linux-rust branch. The primary goal is to provide a native-like "Popup" experience—similar to MacOS/iOS—when AirPods are detected nearby. This is supported by significant hardening of the Bluetooth Low Energy (LE) monitoring and the AACP protocol handling to ensure reliability on Linux.

Asahi

Key Changes

1. UI & UX Enhancements

  • AirPods 3D Popup: Added a premium-looking popup window that triggers on device connection.
    • Animation System: Integrated 180 PNG frames (frame_001 through frame_180) for a smooth, high-fidelity opening animation.
    • Real-time Telemetry: Displays battery levels for Left, Right, and Case components with charging indicators (⚡).
  • New Popup Module: Created src/ui/popup.rs to handle the animated overlay using the iced toolkit.
  • Adaptive Audio Controls: Added a slider in the AirPods view to adjust Adaptive Audio Intensity and improved error logging for noise control commands.

2. Bluetooth & LE Logic

  • LE Monitor Hardening:
    • Implemented Identity Resolving Key (IRK) matching to identify devices using Resolvable Private Addresses (RPA) more reliably.
    • Added a 10-second throttling mechanism for popups to prevent UI spam during frequent state changes.
  • AACP Protocol Improvements:
    • Connection Ownership: The driver now explicitly claims ownership (OwnsConnection) upon initialization, forcing the hardware to push battery and ear-detection events immediately.
    • Flexible Header Parsing: Relaxed validation to accept both 04 00 04 00 and 01 00 04 00 prefixes, fixing issues where telemetry packets were silently discarded.
    • Safety Checks: Added packet length validation to prevent index-out-of-bounds panics.

3. Lifecycle & Persistence

  • Popup Lifecycle Management: Implemented an intelligent auto-close timer (10s) that resets when new data is received, ensuring the UI stays visible while data is updating.
  • Service Readiness: Added support for --start-minimized and prepared a .desktop entry for background execution and system-wide installation.
  • Enhanced Logging: Added detailed debug logging for raw AACP packets and EarDetection states.

Files Changed

File Action
src/ui/popup.rs New - Implementation of the animated popup view.
src/bluetooth/le.rs Refactored LE scanning and added UI message triggers.
src/bluetooth/aacp.rs Updated packet parsing and ownership logic.
src/devices/enums.rs Added helper methods for battery and case state.
src/ui/airpods.rs Integrated Adaptive Audio slider and improved command feedback.
assets/animations/popup/ Added 180 binary assets for the UI.

Test Plan

  • Connection: Verify that AirPods connect and the app successfully claims ownership in the logs.
  • Battery Reporting: Open the charging case or put the AirPods in-ear; verify that battery percentages for L/R/Case appear in the popup.
  • Animations: Verify the 180-frame animation plays smoothly when the popup appears.
  • Ear Detection: Verify that the app correctly detects InEar vs OutOfEar states (visible in debug logs).
  • Auto-close: Verify the popup closes after the timeout and that the timer resets if data updates arrive.
  • Minimized Start: Run with --start-minimized and verify the app stays in the tray/background until a connection triggers the popup.

@jdmarinv jdmarinv changed the title (linux/rust) - feat: implement popup animation and integrate frame assets into UI components feat(linux/rust) - implement popup animation and integrate frame assets into UI components May 14, 2026
@debarkak
Copy link
Copy Markdown

@jdmarinv would it have been better if it was an .gif or any video file? as quickly changing multiple image files may consume high cpu usage.

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.

2 participants