statusbar: show peripheral presence with a filled icon background - #105
Merged
Conversation
# Conflicts: # Magic Switch/AppDelegate/AppDelegate.swift
Owner
Author
|
Archival copy of hotsnow/magic-switch#1 (the interim PR against the fork's
|
MegaManSec
added a commit
to hotsnow/magic-switch
that referenced
this pull request
Aug 10, 2026
Review fixes for the connected-state indicator that merged in MegaManSec#105: - peripheralPresence now counts .releasing as still-here (the device stays physically connected through the up-to-5s send preflight, during which the icon previously un-filled and the tooltip claimed nothing was connected), and treats a registered peripheral with no connectionStates entry as unknown rather than away, so a cold launch can't misreport a connected keyboard before the first IOBluetooth snapshot lands. - Re-fetch connection states when CoreBluetooth reaches .poweredOn: the init-time snapshot bails while the radio reads off (login-item launch), and already-connected peripherals fire no new connect event, which left a false "away" standing for minutes. - The icon observer derives presence via combineLatest + removeDuplicates instead of a Void merge, so routine no-op publishes (reconnect probes, peer syncs) no longer force a status-item redraw. - The 3s ping bell flash survives idle refreshes; only a transfer arrow or needs-attention state cuts it short, restoring the original intent now that connection churn triggers refreshes. - Both status-bar icons composite from copies of the named image; the shared NSImage(named:) cache instance is never mutated. - refreshStatusBarIcon computes the tooltip once and reuses it for toolTip and the accessibility label.
MegaManSec
added a commit
that referenced
this pull request
Aug 10, 2026
) Review fixes for the connected-state indicator that merged in #105: - peripheralPresence now counts .releasing as still-here (the device stays physically connected through the up-to-5s send preflight, during which the icon previously un-filled and the tooltip claimed nothing was connected), and treats a registered peripheral with no connectionStates entry as unknown rather than away, so a cold launch can't misreport a connected keyboard before the first IOBluetooth snapshot lands. - Re-fetch connection states when CoreBluetooth reaches .poweredOn: the init-time snapshot bails while the radio reads off (login-item launch), and already-connected peripherals fire no new connect event, which left a false "away" standing for minutes. - The icon observer derives presence via combineLatest + removeDuplicates instead of a Void merge, so routine no-op publishes (reconnect probes, peer syncs) no longer force a status-item redraw. - The 3s ping bell flash survives idle refreshes; only a transfer arrow or needs-attention state cuts it short, restoring the original intent now that connection churn triggers refreshes. - Both status-bar icons composite from copies of the named image; the shared NSImage(named:) cache instance is never mutated. - refreshStatusBarIcon computes the tooltip once and reuses it for toolTip and the accessibility label. Co-authored-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
|
🎉 This PR is included in version 2.25.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Includes #104 (@hotsnow's connection indicator) plus a rework of the idle-state visuals:
appearsDisabled/contentTintColor, which read as "app disabled" and broke the menu-open highlight tint.$peripherals/$connectionStatessubscription.#Previewguards (previews would compile out under Xcode too) and the.gitignorechange.Same head as #104 after the update push — merging either closes both.