Skip to content

The island shows the charger and headphones, and Shelf cards Quick Look and AirDrop - #15

Merged
ctimothe merged 4 commits into
dynamic-island-parityfrom
feat/ambient-peeks
Sep 23, 2026
Merged

ctimothe merged 4 commits into
dynamic-island-parityfrom
feat/ambient-peeks

Conversation

@ctimothe

Copy link
Copy Markdown
Owner

This is the second half of the 2026-09-23 batch (plan section 7). It builds on #14, which is merged.

What changes

  • Charging. Plugging in grows the pill for 2.2 s: the bolt (or the plug, if the battery is holding rather than charging) on the left and the level on the right. The source is IOKit power-source notifications, with no permission and no polling.
  • Headphones. When a Bluetooth output appears, its glyph and name show the same way. The source is the CoreAudio device list. Devices are tracked by UID, stay quiet for 30 s after being announced, and the owner's name is taken off the device name.
  • The moment keeps the track peek's restraint: never with the panel open, mid-drag, locked, asleep, or under or near a still pointer. Each moment has a switch in Settings → General; Show Charging appears only on Macs with a battery.
  • Shelf. The context menu gains Quick Look (the system panel, controlled by AppDelegate) and AirDrop (the system sheet). Both hand the keyboard back to the app that had it when they close.

Verification

  • ./scripts/check passed locally: 11 steps, 544 tests.
  • Both moments are rendered offscreen by AmbientMomentTests; pass SHOT_OUT to write the PNGs.
  • An adversarial review's findings are fixed in the last commit.
  • Not yet checked on hardware: a real plug-in, AirPods connecting, and opening Quick Look and AirDrop from a card.

The island existed only while music played. The two moments people look
for first on a notch Mac are the charger going in and AirPods connecting,
and both come from public APIs with no permission: IOKit power-source
notifications and the CoreAudio device list the lock card already reads.

AmbientWatch reports the moment external power arrives and the moment a
Bluetooth audio output appears, each once. It polls nothing. The pill
grows out of the notch for 2.2 s in one grammar: a glyph in the left wing
where the cover sits, the value in the right wing where the equalizer
sits. That is the level for the charger and the device name for
headphones, white on black like every other wing. The moment has the
track peek's restraint: never with the panel open, under the pointer,
mid-drag, over the lock screen or on a dark display. A track peek already
showing gives way, and a lock clears it. Show Charging and Show Headphones
Connecting are in Settings → General, both on.

Tests: AmbientMomentTests (new): the power edge, device arrivals, the
pill's width bounds, the defaults, and an offscreen render of both
moments (written out with SHOT_OUT).
The Shelf could copy, open and reveal a card, but not preview it or send it
anywhere. Its context menu now has Quick Look, the system panel, and
AirDrop, the system sheet, offered only when AirDrop can take the files.
Both act on the selection the way a drag does. Each activates the app,
because each opens a window the user must use, and an inactive app's
window opens behind theirs.

The design doc, README and checklist record the island's new moments and
these two actions. The hardware checks still owed are listed there.

Tests: ShelfSharingTests (new).
…moments stay polite

A review of the charger, headphones and Shelf-sharing commits found these,
all fixed here:

- Quick Look and AirDrop activated Isla and left it active, so the
  document the user had been typing in stopped answering until clicked.
  Activation is now handed back when the panel or the sheet closes.
- Quick Look set the panel's data source without being its controller,
  which the SDK forbids and the runtime warns will raise. AppDelegate now
  accepts control from the end of the responder chain.
- The AirDrop row asked NSSharingService on every card redraw. It is now
  checked on the click.
- A charger moment could outlive sleep and wake the Mac with a stale
  percentage. Sleep clears it.
- Headphones are tracked by device UID with a 30 s quiet period, a failed
  CoreAudio read no longer re-announces everything, and "Elshod's AirPods
  Max" shows as "AirPods Max".
- A battery that holds rather than charges shows the plug and says "Power
  adapter connected". A failed power read no longer loses the next plug-in.
  Show Charging appears only where there is a battery.
- The moment is refused where the grown pill would reach a still cursor,
  and every refusal is a pure, tested NotchController.ambientAllowed.

Tests: AmbientMomentTests and ShelfSharingTests cover each. ./scripts/check
passed with the xctest defaults domain set aside: 11 steps, 544 tests.
@ctimothe
ctimothe merged commit 300f245 into dynamic-island-parity Sep 23, 2026
1 check passed
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.

1 participant