Repository navigation
feat: iOS-style popup: battery rings, still render and scene transitions - #239
Open
akhmadqasim wants to merge 3 commits into
Open
akhmadqasim wants to merge 3 commits into
akhmadqasim wants to merge 3 commits into
Conversation
The 10 s auto-hide no longer applies while both pods sit in the opened case; the popup leaves when the pods come out, the lid closes or the device disconnects, with a 60 s safety cap.
Only a lid actually seen closed (pods inside), a disconnect or the 90 s safety cap dismisses it; removing one or both pods does not.
The popup now follows the AirPods sheet on iPhone: - Battery rings instead of bars (`Widget::Battery` gains a `Ring` shape; the tray/taskbar keep the bar): thin track, progress arc from twelve o'clock, bolt inside while charging, percentage below with an L/R badge or the case glyph. Both pods resting in the case (or reporting the same level and charge state) collapse into one unlabelled ring; the case glyph is dropped while both pods are inside. - Per-pod `isInCase`, derived from the advertisement: "both in case", or a pod that charges while not in an ear. The presentation maps that to a `Scene`: PodsInCase (turntable video), OnePodOut (still render, the pods spread), BothPodsOut (keeps turning), PodsOnly (after 15 s the case leaves the picture and one centred ring remains). - `Widget::DeviceImage` slices the still render into pods and case by its transparent gaps and recomposes them per scene; `Widget::FadeOverlay` carries a snapshot of the battery row while the widgets underneath are rearranged. - One scene fade for picture and battery row: the outgoing view fades out (the video keeps playing meanwhile), then the incoming scene fades in. A change landing mid-fade resumes from what is on screen. - Slide-in stays 500 ms; slide-out is now 250 ms, and the window itself never fades. Tests: `MergesMatchingPodBatteries`, `PresentsScenesFromPodPlacement` (domain), `DeviceImageSlicesAndRearrangesPods`, `MainWindowDissolvesTheBatteryRow`, `MainWindowCentresTheLonePodsRing`, `MainWindowRendersBatteryRings` (UI).
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.
Builds on #238 (the first two commits are that PR; only the last commit is new here). Happy to split or drop parts — this is a visual redesign, so it depends on whether the project wants to follow the iPhone sheet this closely.
What changes
Battery rings.
Widget::Batterygains aRingshape (the tray icon and taskbar keep the bar): thin track, progress arc from twelve o'clock, bolt inside while charging, percentage below with an L/R badge or the case glyph. Both pods resting in the case — or reporting the same level and charge state — collapse into one unlabelled ring, and the case glyph is dropped while both pods are inside, like on iOS.Scenes from pod placement. A per-pod
isInCaseis derived from the advertisement: "both in case", or a pod that charges while not in an ear.MainWindowPresentationmaps that to aScene:PodsInCase— the turntable video keeps playing;OnePodOut— freezes into the still render with the pods spread, both rings labelled;BothPodsOut— keeps turning;PodsOnly— after 15 s with both pods out, the case leaves the picture and one centred ring remains.Transitions.
Widget::DeviceImageslices the still render into pods and case by its transparent gaps and recomposes them per scene.Widget::FadeOverlaycarries a snapshot of the battery row while the widgets underneath are rearranged. One scene fade drives picture and battery row together: the outgoing view fades out (the video keeps playing meanwhile), then the incoming scene fades in; a change landing mid-fade resumes from what is on screen. Slide-in stays 500 ms, slide-out is 250 ms, and the window itself never fades.Tests
Domain:
MergesMatchingPodBatteries,PresentsScenesFromPodPlacement, badge assertions in the existing presentation tests. UI:DeviceImageSlicesAndRearrangesPods,MainWindowDissolvesTheBatteryRow,MainWindowCentresTheLonePodsRing,MainWindowRendersBatteryRings(writesUiValidation/main-window-battery-rings-*.png).Verified on hardware (AirPods Pro 2 USB-C, Windows 11, 100 %/125 %/150 % scaling). The preview GIFs in
Assets/are not regenerated yet; I can do that if the direction is welcome.