Project · July to August 2026 · Shipped

Three small Mac apps

BetterBattery, DayDial and NetPulse, in the menu bar.

  • macOS
  • Design
  • Automation
  1. The problem

    I wanted my Mac's battery watts, the day left and the network speed, at a glance.

  2. How I used agentic coding

    Claude Code wrote all three in Swift. When a bug taught it something, the lesson went into the repo, so the next session starts knowing it.

  3. The outcome

    Three apps anyone can download, with 25 releases between them as of October 29, 2026. Each one updates itself in place.

  • The BetterBattery app icon

    BetterBattery

    Watts in and out of the battery.

  • The DayDial app icon

    DayDial

    The day left, as a ring.

  • The NetPulse app icon

    NetPulse

    Network speed, live.

The same samples, snapped and eased

Snap

26.0W

Bound straight to a once-a-second sample.

Ease

26.0W

The same samples, eased and keyed to one quantized value.

The apps are signed but not yet notarized, so macOS asks once: open System Settings, Privacy and Security, and choose Open Anyway. After that they update themselves in place.

Deep dive

Three charts, with sources

Finding the chart window

Bisection finds where the window starts in 15 steps, not 17,280 reads, once a second while the panel is open.

15 min

  • Old filter: samples read17,280
  • Bisection: steps15
  • Samples in the window, at most180
  • Points drawn90

1 h

  • Old filter: samples read17,280
  • Bisection: steps15
  • Samples in the window, at most720
  • Points drawn144

24 h

  • Old filter: samples read17,280
  • Bisection: steps15
  • Samples in the window, at most17,280
  • Points drawn159
As a table
15 min
Value
Old filter: samples read17,280
Bisection: steps15
Samples in the window, at most180
Points drawn90
1 h
Value
Old filter: samples read17,280
Bisection: steps15
Samples in the window, at most720
Points drawn144
24 h
Value
Old filter: samples read17,280
Bisection: steps15
Samples in the window, at most17,280
Points drawn159
  • Computed from the code: bisection over 17,280 samples takes at most 15 halvings, then each window is averaged down to at most 160 points.

  • The history keeps up to 17,280 samples, at least 5 seconds apart, in memory only; nothing is written to disk.

  • The 24 h view still averages every sample it shows, so bisection saves the most on the 15 min and 1 h views.

As of August 6, 2026. Chart: NetPulse Sources/NetPulse/PanelView.swift and NetModel.swift; counts computed from the code for a full history. Facts: NetPulse Sources/NetPulse/PanelView.swift, windowedSamples; NetPulse Sources/NetPulse/NetModel.swift, historyCap.

Sampling less when nobody looks

Closed, it wakes 240 times an hour by default, not 3,600. The gap rule had to grow with it.

Wake-ups an hour

  • Panel open3,600Always every second, so it feels live
  • Closed: live3,600
  • Closed: every 5 s720
  • Closed: every 15 s, the default240
  • Closed: every minute60
  • Displays asleep0The timer stops

Gap between samples

  • Live, every second1 s
  • Every 5 s5 s
  • Every 15 s, the default15 s
  • Every minute60 s
As a table
Wake-ups an hour
ValueNote
Panel open3,600Always every second, so it feels live
Closed: live3,600
Closed: every 5 s720
Closed: every 15 s, the default240
Closed: every minute60
Displays asleep0The timer stops
Gap between samples
Value
Live, every second1 s
Every 5 s5 s
Every 15 s, the default15 s
Every minute60 s
Old cutoff, 10 s10 s
  • Before this, sampling and redrawing every second while closed had an app that should idle near zero reported at about a quarter of a gigabyte.

  • The old rule dropped any sample more than 10 s after the last, so at 15 s or 60 s it would have dropped every one.

  • Now the cutoff is 2.5 times the interval, at least 10 s, still tight enough to catch a real stall. Wake-ups are computed from the intervals.

As of August 6, 2026. Chart: NetPulse Sources/NetPulse/NetModel.swift (IdleInterval, tick); wake-ups computed from the intervals. Facts: NetPulse 57bf0b3, Sample on a user-set interval while the panel is closed; NetPulse Sources/NetPulse/NetModel.swift, tick and IdleInterval.

Redrawing the menu bar icon

Keyed to what it shows, not the clock, the ring icon redraws about 300 times a day, not 86,400.

  • Before the cache: every tick86,400 a day
  • Time mode, the default1,206 a day
  • Percent mode310 a day
  • Ring mode304 a day
As a table
Value
Before the cache: every tick86,400 a day
Time mode, the default1,206 a day
Percent mode310 a day
Ring mode304 a day
  • Computed from the code for the default waking day, 7 AM to 11 PM. Each ring step is 1/300 of a turn, too small to see.

  • Time mode shows hours and minutes, so it redraws once a minute through the day; the ring adds the steps that fall between minutes.

  • The 1 Hz clock itself stops while the displays sleep and restarts on wake; the dial is worked out from the time, so nothing needs catching up.

As of August 5, 2026. Chart: DayDial Sources/DayDial/GlyphView.swift (cacheKey) and DayModel.swift (Ticker); redraws computed from the code over one day of 1 s ticks. Facts: DayDial Sources/DayDial/GlyphView.swift, cacheKey and readout; DayDial Sources/DayDial/DayModel.swift, Ticker.

Sources

Built with Swift, SwiftUI, SwiftPM, GitHub Releases. BetterBattery, DayDial and NetPulse READMEs; BetterBattery, DayDial, NetPulse CLAUDE.md, and the commit in each that records the 1 Hz rendering rules, August 5, 2026; github.com/michaelmax98/BetterBattery, DayDial and NetPulse releases: 17, 3 and 5 as of October 29, 2026; UpdateChecker.swift in each; NetPulse Sources/NetPulse/PanelView.swift and NetModel.swift; counts computed from the code for a full history; NetPulse Sources/NetPulse/PanelView.swift, windowedSamples; NetPulse Sources/NetPulse/NetModel.swift, historyCap; NetPulse Sources/NetPulse/NetModel.swift (IdleInterval, tick); wake-ups computed from the intervals; NetPulse 57bf0b3, Sample on a user-set interval while the panel is closed; NetPulse 57bf0b3; Sources/NetPulse/NetModel.swift, tick; NetPulse Sources/NetPulse/NetModel.swift, tick and IdleInterval; DayDial Sources/DayDial/GlyphView.swift (cacheKey) and DayModel.swift (Ticker); redraws computed from the code over one day of 1 s ticks; DayDial Sources/DayDial/GlyphView.swift, cacheKey; DayDial Sources/DayDial/GlyphView.swift, cacheKey and readout; DayDial Sources/DayDial/DayModel.swift, Ticker.

Where it fits

  • To SignalWall: SignalWall's iPhone app is written in SwiftUI, the framework these three menu bar apps are built with.