Skip to content

feat: Vitals, fan control, Gadgets, tab arranging and a Settings sidebar - #12

Draft
dw2lam wants to merge 49 commits into
mainfrom
feat/system-tab
Draft

dw2lam wants to merge 49 commits into
mainfrom
feat/system-tab

Conversation

@dw2lam

@dw2lam dw2lam commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Work in progress. It isn't finished, so it's a draft: Vitals onboarding and the on-device AirPods checks are still to do.

What's in it

  • Vitals tab:
    • Live CPU, GPU and memory (RAM and swap), with CPU and GPU temperatures.
    • Network, storage, battery and uptime. The public IP is looked up only when you click Show.
    • Widgets you can hide, reorder and configure, from Settings or by pressing and holding in the notch.
  • Fan control on any Mac that Macs Fan Control supports:
    • Modes, presets, boost and a safety override.
    • Curves hand control back to macOS below their first point.
    • A privileged helper does the fan writes.
  • Notch tabs:
    • Can be turned off.
    • Press and hold to arrange them, iOS style.
    • The new default order is Agents, Music, Mirror, Vitals, Myspace, Gadgets.
    • With every tab present, the tabs tighten their spacing so their icons still fit.
  • Myspace now includes Reminders:
    • The composer's bell saves a reminder, with an optional time.
    • Up Next pins active reminders above the days.
    • A Reminders filter shows them, with the done ones below.
    • Saved tab orders and hidden tabs carry over.
  • Settings: a System Settings-style sidebar with a page for each notch tab. Music settings are on the Music page and fan control is on the Vitals page.
  • What's New: after an update, the notch walks through the release once. The release notes stay in General afterwards.
  • Gadgets tab:
    • A 3D AirPods model that shows whether the buds are in your ears or in the case.
    • Battery levels and noise control modes.
    • Spatial audio status, and Follow my head as an opt-in.
    • Battery levels for other Bluetooth devices.
    • Better Mic Audio, ported from Airband (MIT, credited in THIRD_PARTY_NOTICES.md).

Verification

  • swift test: 351 + 817 Swift Testing tests and the HighStereo XCTest suites pass. String lint passes.
  • The release package builds with stable signing. Installed and running locally.
  • Tab bar, Vitals, Settings, Gadgets and Myspace were checked in offscreen renders.

Still to do

  • Vitals and the new features in onboarding.
  • On-device Gadgets checks with real AirPods:
    • Noise modes, including Adaptive.
    • In-ear detection.
    • Spatial audio badge.
    • Head tracking.
    • Better Mic Audio.

dw2lam added 30 commits December 4, 2026 02:31
…rder

Settings chips toggle a tab on or off with a click (Agents always stays
on); hidden tabs persist under island.hiddenTabs. The notch starts on the
first visible tab, falls back to it when the tab on screen is hidden, and
automatic switches (music on open, reminder tap, file drops, leaving
Mirror) respect what is turned off.
… network

Samples only while the tab is open in the open notch (1 s vitals, 2 s
temperature and fans, 30 s storage and battery, network details re-checked
every 5 s). Readings come from host_processor_info, host_statistics64,
NET_RT_IFLIST2 64-bit counters, HID temperature sensors (Apple Silicon) or
the SMC (Intel), SMC fan keys, IOPowerSources, SystemConfiguration and
CoreWLAN signal/rate (no SSID, so no Location prompt). The public IP is
looked up only on an explicit Show click and forgotten on network change.

Lifts the header's usage threshold colour into IslandDesignPalette.Usage.
Six chips don't fit one line of the Personalization card at the Settings
window's narrower widths, so labels broke mid-word. Chips now flow onto a
second line, and a render test checks it.
NotchTuneFanKit holds the SMC transport (now shared with the System tab's
reader), value codec, per-Mac write sequences (mode key with Ftst unlock,
Intel FS! bitmask, minimum floor), the helper's narrow XPC protocol and its
command handler (owner tracking, reset on disconnect, watchdog).
NotchTuneFanHelper serves it as a root launch daemon pinned to the app's
bundle id and signing certificate, and has an unprivileged --self-test.
- Click CPU or Memory to flip the tile to the top 3 processes (libproc
  rusage deltas, own processes only), sampled every 2 s only while shown
  in the open notch; the face overlays the graph so the height never changes
- Click Battery for health (full-charge vs design capacity), cycles,
  condition and adapter watts from AppleSmartBattery, read at the 30 s
  battery cadence; adapter watts on the face, "Service recommended" footer
- Network values copy on click with an inline "Copied"; hover shows the
  full value; context menu copies all details
- Storage rows show the volume in Finder; external/ejectable volumes get
  an eject button with an inline "In use" notice when refused
- Header arrows and context menus open Activity Monitor, Storage/Network/
  Battery Settings and Disk Utility
- Memory pressure tints the memory footer when above normal
Launch discovery parsed every line of the last day's transcripts: 711 MB
in nine files here, ~11.6 s of CPU and an ~800 MB peak. Files over 4 MB
are now read as their first 256 KB (folder, first prompt) and last 2 MB
(latest state). Also drains autoreleased JSON per chunk, reuses one date
formatter, and trims the line buffer once per chunk instead of per line.
Launch is now ~1.1 s of CPU, settling near 110 MB.
FanController (owned by AppModel) applies Automatic, full speed, fixed and
curve presets, timed Boost and a 95/85 °C thermal safety override through
the helper, in a 2 s loop that runs only while not Automatic. Versioned
presets in UserDefaults; one-time admin install/uninstall of the helper with
a version check; the System tab's Thermal card moves to its own view with
mode chips and target markers; Settings gets a Fans pane with a curve editor.
The Thermal card keeps fan control to one fixed-height row (Auto, Max,
Boost, the preset in use, a status glyph) that swaps in place for the Boost
and preset pickers, so the System tab stays under the panel cap. Offscreen
renders cover each state and the Settings content. package-app.sh builds
NotchTuneFanHelper into Contents/Library/LaunchServices, signed with the
app's identity under the hardened runtime and identifier <bundle id>.FanHelper.
…lient gets in

The README gains a Fan control feature line and a section on what the
helper installs, what it can do, and how to remove it. The helper's
--self-test now also pins an anonymous listener to its own signature and
checks that a matching client is let in, alongside the stranger it turns
away. The DMG fallback's cleanup glob no longer fails under zsh when there
is nothing to clean.
The music player picker is now the last card of the Sound pane. Links to
the old Music tab ("music") resolve to Sound and scroll to the player
card through a small settings anchor ("<tab>#<anchor>"), which the
pane brings to the top as it opens.
Renames the System tab to Vitals (stored id stays "system"). CPU and GPU
tiles now pair load with temperature, the fans sit right under them, and
memory shows app / wired / compressed plus swap used. GPU load and memory
come from IOAccelerator's PerformanceStatistics; GPU and CPU-core
temperatures from the SMC (Tg / Tp+Te keys, found by enumerating the
SMC and checked under GPU and CPU load on an M5 Pro), falling back to the
HID sensors. Stopped fans read "Off", storage spans the panel two drives
a line, and the tab may grow to 600pt where the screen allows.
A curve held the fans at their minimum even when the Mac was cool, where
macOS would stop them. Below a first point at the lowest speed the fans
now go back to macOS. Quiet and Balanced are retuned for the CPU-core
sensors (~10 °C above the die average), and unedited copies of the old
defaults are updated on load.
IslandTabArrangement holds the pure rules (reorder among shown tabs,
hide/show, Agents never hides, never an empty bar, active-tab fallback,
drag drop-slot geometry). The coordinator owns isArrangingTabs: it
suspends the mouse-leave collapse and ends whenever the tab bar goes
(close, notification card, notice, file drop). The panel controller
holds the opened height while arranging and Esc leaves the mode.
IslandTabBar replaces the inline tab bar: a click switches tabs, a
0.5 s hold enters iOS-style arrange mode (jiggle, or an outline with
Reduce Motion), drag to reorder with live reflow, minus/plus badges
hide and show, turned-off tabs wait dimmed at the end, Done pill at the
end of the bar. The content below dims and a click there or on the
header leaves the mode. VoiceOver: Arrange Tabs, then Move Left/Right,
Hide/Show Tab and Done actions.
Pure tests for reorder, hide/show, Agents, non-empty bar and fallback;
model tests for saved state, collapse suspension and the held height;
renders of the bar normal and arranging; in-process mouse events sent
to an offscreen window for click, hold, slide-off, drag, badges, Done.
A data-driven registry (WhatsNew.swift) holds each release's cards: a
small mock or symbol, a title, a line or two, and an optional button
(Open Vitals, Choose Tabs, Open Fan Settings). Version 2.4.0 covers the
Vitals tab, tab order and visibility, fan control, reopen after a crash
and faster launch.

After an update the newest unseen release opens once in the notch as
its own surface (IslandSurface.whatsNew): passively, only into a free
notch (no notice, no agent waiting, no tour, not full screen), and an
agent card that takes over brings it back on the same card afterwards.
A fresh install only records the version; the same version or a
downgrade shows nothing. Page dots, Back/Next/Done, close, and arrow
keys once the notch is key.

Settings → General gets a What's New button beside Check for Updates
and a release notes card (WhatsNewSettingsCard) with Show in Notch.
Harness: NOTCHTUNE_HARNESS_WHATS_NEW=1 (+ _PAGE=<n>). Tests cover the
launch decision, the registry, delivery and renders of every card.
…inders

New default: Agents, Music, Mirror, Vitals, Myspace, Reminders (and what
Reset restores). A saved order that matches an earlier default follows
the new one; a rearranged order is kept.
… crash

Release builds crashed in SimplifyCFG on this function ("cannot get
borrow introducers for unknown guaranteed value").
The top tab bar becomes a sidebar: General, Setup, Appearance, Display
and Sound, then a Notch Tabs section with one page per notch tab in the
notch's own order (islandTabOrder). Drag a row to move the tab, its
context menu moves it or turns it off, a tab that's off is dimmed, and
Reset in the section header puts every tab back. Each tab page opens
with a Show in Notch switch over islandHiddenTabs (fixed on for Agents),
so the sidebar, the pages and the notch's press-and-hold arranging edit
one state.

What moved:
- Session list options (state indicator, usage, grouping, sorting, done
  timeout) leave Appearance for the Agents page, with the display
  switcher beside them; the Meetings card joins them (its banner shows
  above the Agents list).
- The Music Player card leaves Sound for the Music page.
- Fans becomes the Fan control section of the Vitals page, below a
  VITALS-WIDGETS-SLOT for the widget editor.
- The tab chips card is gone from Appearance: the sidebar does its job.
- Personalization is titled Appearance.

Old names still route: about/updates to General, personalization to
Appearance, fans (and system) to Vitals at Fan control, music and
sound#music to the Music page, appearance#tabs to the Show in Notch card.
The window grows to hold the sidebar (min 860x560, ideal 960x660).
dw2lam added 19 commits December 4, 2026 07:50
VitalsLayout holds the widget order, hidden widgets and display options
as one versioned, lenient Codable value (VitalsLayoutStore saves it under
vitals.layout). The sampler reads only what the shown widgets need: no
IOAccelerator walk without GPU, no SMC/HID without CPU/GPU/Fans, no
volumes, battery or network details when their widgets are hidden.
A run that stopped early could leave Myspace hidden in the test host's
defaults, which made the drop test fail on every later run.
…Stereo module

Ported from Airband (MIT, Kaeden Murphy): Bluetooth audio discovery, the
btfo transition engine, the zero-stream InputKeeper and the A2DP/Stereo HFP
volume and balance handoffs, with Airband's tests. The controller drops the
menu bar, updater and Launch at Login, ships off with Instant Mic off, asks
for the microphone only when Instant Mic is turned on, and installs its
CoreAudio listeners and sleep/lock observers only while it is on.
The Vitals tab now lays out the saved VitalsLayout: half tiles pair up,
a lone tile spans its row, Storage and Network stay full-width cards
that carry their own title. Graphs can be turned off for compact tiles,
temperatures follow the chosen unit, Storage can list fewer volumes and
Network can drop lines.

Press and hold a widget to arrange them, like the tab bar: jiggle
(outline only with Reduce Motion), drag to reorder, minus to hide,
hidden widgets wait as dimmed chips with a plus beside Done; Esc,
Return, Done or a click on empty space leave. A click still focuses
CPU / Memory / Battery and the fan chips keep their clicks. The overlay
suspends hover-collapse and only lets the panel grow while arranging;
the tab scrolls if an odd order outgrows the height cap.
VitalsWidgetsSettingsCard lists the widgets in order with drag handles
and switches, the Storage volumes and Network lines options inline,
graphs and temperature unit, and Reset. Self-contained, for the new
Settings page to place.
# Conflicts:
#	Sources/NotchTuneApp/Resources/en.lproj/Localizable.strings
IOBluetooth private selectors (read dynamically, responds(to:) first) for
AirPods batteries, in-ear state and listening mode, with the classicPeer
fallback; I/O Kit HID BatteryPercent for mice and keyboards; read-only
Spatial Audio state from BTAudioHALPlugin; charging from the AudioAccessory
battery cache. A monitor that polls only while an owner holds it, and
CMHeadphoneMotionManager head tracking.
A superellipsoid case and stemmed buds built from SceneKit geometry, PBR
gloss in a procedural studio light. Buds lift in an ear and settle and grey
out of one; the status light shows the case charging; a slow sway (off with
Reduce Motion) or the wearer's head turns it. Renders only while visible.
AirPods card (3D model, battery rings, Control Center noise control,
Spatial Audio state), Better mic audio (High Stereo, Instant Mic) and the
other connected devices with their batteries. Added last in the tab order
and can be turned off; with seven tabs the bar shows names without icons so
it stays on one line. Settings page with the Airband options and Follow my
head. High Stereo is released on quit.
And the audio-input entitlement for Instant Mic.
Rebuilds the 3D model: the case is meshed in rings so it splits at the lid
seam; the lid hinges open with a lip, a hinge barrel and seats for the
buds. Buds get a compact angled head, a grey silicone tip, a short
flat-sided stem canted ~17° and dark mesh insets. Both in the ears: closed
case, buds floating as a mirrored pair in front of and above it; a bud out:
the lid springs open and it drops into its seat. Warm clear-coated white,
top-left key, rim light, screen-space AO, three-quarter camera with a ±8°
sway. Meshes are built once per launch, and the view draws only while
something moves.
With every tab present the pills tighten their insets instead of
dropping their icons, so icons, names and arrange mode's Done fit on one
line. Sized over all tabs, on or off, so nothing shifts on a long press.
A reminder was already a Myspace thought with a time, so the two tabs
become one stream: the composer's bell makes the next save a reminder
(with an optional time), Up Next pins active reminders above the days,
and a Reminders filter shows them with what's done.

- Saved orders put Myspace where Reminders was if it came first; the
  last default follows the new one.
- Hidden tabs move to island.hiddenTabs.v2. From the old list, Myspace
  stays off only if Reminders was off too.
- A reminder's notification and the old Settings page open Myspace.
- Times read Today/Tomorrow; overdue ones tint.
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
notch-tune Ready Ready Preview Dec 4, 2026 2:57pm UTC

This branch was successfully deployed

1 active deployment
Preview — 264f5492 Deployed Dec 4, 2026 by vercel[bot]
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