Skip to content

Menu bar: an option to show the eye without the countdown - #84

Open
cpugenius wants to merge 1 commit into
krishhgg:mainfrom
cpugenius:feat/hide-menubar-countdown
Open

cpugenius wants to merge 1 commit into
krishhgg:mainfrom
cpugenius:feat/hide-menubar-countdown

Conversation

@cpugenius

@cpugenius cpugenius commented Oct 11, 2026 •

Copy link
Copy Markdown

What changes

  • New setting: Settings > App > "Show the countdown in the menu bar" (showMenuBarCountdown). It is on by default, and a config.json without the key loads it as on, so nothing changes for existing installs.
  • Off, the status item is the eye alone. The eye opens while a session starts or runs and closes otherwise. The countdown and the hold-to-end ring are not drawn, and the item is no wider than when idle. Clicking the eye still opens the extend pills. VoiceOver reads the time left on the eye, from the minute-granularity remainingText, so the bar is not redrawn every second for it.
  • The right-click menu takes over what the bar no longer shows. While a session runs with the countdown off, the menu leads with the time left ("2h 14m remaining") and offers End Session above Settings…, standing in for the ring. The time is re-read when the menu opens (refreshCountdown()), because the 1 Hz redraw stops while the lid is closed. End Session has no key equivalent. With the countdown on, the menu is unchanged.
  • Docs: README "Using it" and docs/spec.md section 1 describe the setting. docs/releasing.md adds a real-Mac check for it.

StatusMenu.menu(...) takes a new endSession: selector, and the two StatusMenuWarningTests that build an NSMenu pass it.

Tests

MenuBarCountdownOptionTests:

  • the key decodes tolerantly, defaults on and round-trips off
  • the menu order with the time-left line and End Session
  • End Session is a live item on its own selector with no key equivalent
  • StatusItemController.menuItems adds the line and the item only while a session runs with the countdown off
  • the measured status item is as wide as idle in .starting and .running with the countdown off, and wider again once it is turned back on

swift test passes locally: 1228 tests, 0 failures, 13 skipped for want of tmux. The release build with -warnings-as-errors is clean.

Real Mac

On macOS 27.0.1 with the built-in display and a Studio Display: the eye opens and closes with the session with nothing beside it, the menu shows the time left, and End Session ends the session.

Two macOS 27 problems turned up during that run. Neither comes from this PR, and both are on main. Clicks on a widened status item reach the app twice: first through the WindowServer's menu bar window, which the global monitor takes for a click in another app and so collapses the pills, then at the item's centre rather than under the pointer, so a click on Days or Minutes lands on Hours. Separately, the eye's tap bounce can stop at 0.86 when the item's resize lands mid-bounce. Those fixes will be a separate PR.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Adds an option to hide the menu bar countdown while keeping the eye visible.

  • The menu bar can show only the eye during a session.
  • The right-click menu shows time left and an End Session action.

No actionable issues found. Native macOS tests and UI checks were not run in this Linux environment.

cpugenius explicitly deferred two pre-existing macOS 27 problems: widened-item clicks can collapse or misdirect the pills, and resizing can leave the eye's bounce at 0.86. Neither is introduced by this PR.

Reviews (3) · Last reviewed commit: "Menu bar: an option to show the eye with..." · Reviewed by Greptile

Settings > App > "Show the countdown in the menu bar" (showMenuBarCountdown,
on by default and for a config.json without the key). Off, the status item
is the eye alone: open while a session starts or runs, closed otherwise,
with no countdown and no hold-to-end ring. While a session runs the
right-click menu then leads with the time left ("2h 14m remaining", read
when the menu opens) and offers End Session above Settings, standing in
for the ring. Clicking the eye still opens the extend pills. VoiceOver
reads the time left on the eye.

Checked on a real Mac (macOS 27.0.1, built-in display plus a Studio
Display): the eye opens and closes with the session, the menu shows the
time left, and End Session ends the session.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@krishhgg

Copy link
Copy Markdown
Owner

End-to-end test in a VM on macOS 27.0.1

The option works as described. With "Show the countdown in the menu bar" switched off, a running session shows only the eye in the menu bar. The right-click menu then adds the time left and End Session, and End Session ends the session and restores sleep. The switch is on by default, and main's menu bar is unchanged.

Setup

A Tart VM on the maintainer's Mac mini, macOS 27.0.1 (26A434) with Xcode 27.0. Each version was built from source and installed with scripts/install.sh, then driven by a script inside the VM using Accessibility and posted mouse events.

Main (76e517d) against this PR's head (aad9e76). The script (t84.sh) switched the option off in Settings (PR only), started a session by clicking the eye and pressing Enter, took the menu bar, right-clicked the eye, read the menu items and clicked End Session. A second script (t84b.sh) took the Settings screenshot.

Results

main this PR, countdown off
Settings no such switch "Show the countdown in the menu bar", on by default; switching it off wrote "showMenuBarCountdown": false to config.json
Menu bar during a session eye, countdown and ring (status item 120 pt wide) eye only (34 pt wide)
Right-click menu during a session status lines, Settings…, Quit Insomnia "3h 59m remaining", status lines, End Session, Settings…, Quit Insomnia
After clicking End Session log: session end (user), sleep restored, app nap restored for 20 app(s); no session.json, SleepDisabled 0

The menu bar during a session, main on top and this PR (countdown off) below:

main

this PR

The right-click menu, main on top and this PR below:

menu main

menu this PR

The switch in Settings, at its default (on):

settings

Not covered

  • Clicking the eye to add time while the countdown is off.
  • Switching the countdown back on during a running session.
  • macOS 26 and real hardware.

The full logs are run-full-lab27.log and run-followup-lab27.log.

🤖 Generated with Claude Code

@cpugenius
cpugenius marked this pull request as draft October 18, 2026 01:51
@cpugenius
cpugenius marked this pull request as ready for review October 18, 2026 01:51
@krishhgg krishhgg closed this Oct 18, 2026
@krishhgg krishhgg reopened this Oct 18, 2026
@krishhgg
krishhgg marked this pull request as draft October 18, 2026 04:27
@krishhgg
krishhgg marked this pull request as ready for review October 18, 2026 04:27
@krishhgg

Copy link
Copy Markdown
Owner

Thank you for this. Your head commit aad9e76 is merged unchanged into #145, together with five other menu bar pull requests that change the same files. When #145 merges, GitHub marks this pull request as merged too, with your commits and your authorship.

Please don't push to this branch from now on. A new commit wouldn't be in #145, so this pull request would stay open instead of showing as merged. If you want to change something, comment here and I'll add it to #145.

#145's description lists the conflicts resolved in its merge commits and the two maintainer fixes after them.

🤖 Generated with Claude Code

@krishhgg krishhgg mentioned this pull request Oct 24, 2026
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.

2 participants