Add notch hover usage overlay - #3164
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 31, 2026, 8:33 AM ET / 12:33 UTC. ClawSweeper reviewWhat this changesThis PR adds an opt-in macOS notch-hover usage dashboard with provider and agent-session summaries, settings, shortcuts, localization, documentation, and focused tests. Merge readiness⛔ Blocked until stronger real behavior proof is added - 6 items remain Keep this owner-held feature PR open. Its branch records the overlay under already-shipped v0.56.2 rather than current main’s 0.56.3 Unreleased section, and current native interaction proof is still insufficient. Priority: P3 Review scores
Verification
How this fits togetherCodexBar collects provider usage and active agent-session data, then renders it in its menu bar and settings UI. This change adds an optional overlay below a MacBook camera notch that consumes those existing stores without starting another scan. flowchart LR
A[Usage and session stores] --> B[Notch overlay model]
C[Notch settings] --> D[Overlay controller]
B --> E[SwiftUI dashboard]
D --> E
F[Notch hover or shortcut] --> D
E --> G[Provider and session summary]
Decision needed
Why: The owner approved the direction but explicitly reserved final review pending native interaction proof. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Rebase onto current main, place the release note under 0.56.3 Unreleased, and attach sanitized built-bundle evidence for the full native interaction lifecycle. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a new opt-in dashboard. The introduced changelog defect is directly verifiable by comparing the branch with v0.56.2 and current main. Is this the best way to solve the issue? No: the direction is approved, but the branch needs an Unreleased release note and real native interaction proof before it is a merge-ready solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ff81d718cff. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (39 earlier review cycles; latest 8 shown)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2f342ed97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d2f342e to
74e3b41
Compare
|
Both review findings are fixed in f3b6fec, and the branch is rebased onto current main (merge state is clean now):
|
|
Fixed in ab83688: all three bar factories (
|
steipete
left a comment
There was a problem hiding this comment.
Really nice work overall — the self-reported sizing approach and the no-global-monitor/no-AX design are exactly right, and the focused suites plus make check all pass on a merge with latest main. Four findings before this can land, two of them blocking:
P1 — Disabled feature still registers a global shortcut. NotchUsageOverlayController.swift:54 installs the KeyboardShortcuts handlers unconditionally, and the dependency registers any saved shortcut system-wide the moment a handler is attached. Disabling the overlay never unregisters it, and PreferencesNotchPane.swift:38 allows recording a shortcut while the feature is off. That breaks the off-by-default guarantee and can steal shortcuts from other apps. Handlers should only exist while the overlay is enabled.
P1 — Any settings change destroys an expanded overlay. The activation observation (NotchUsageOverlayController.swift:123) reads a computed property backed by the whole observable defaults struct, so unrelated preference changes re-fire it; at line 143 an existing panel is preserved only when collapsed — an expanded panel is closed and recreated, losing hover/shortcut state. Please narrow the observation to the fields that actually affect activation, and preserve an expanded panel across benign changes.
P2 — Controller restarts accumulate shortcut handlers. Handlers registered at line 71 are never removed on stop; each stop/start adds another callback, and in Toggle mode two callbacks make one press open-and-immediately-close the panel. The dependency ships KeyboardShortcuts.removeHandler(for:) for exactly this lifecycle.
P2 — Codex credits aren't actually a fallback. NotchUsageOverlayModel.swift:191 appends monthly credits whenever fewer than four bars exist, even when the extra window/spend bar was already chosen — a Codex account with two ordinary windows shows both, contradicting the documented mutually-exclusive fallback. Gate the append on the fallback slot being unfilled.
Happy to merge once these are addressed — the feature itself is a great addition.
4521c61 to
8fb9030
Compare
|
Addressed all four findings in 8fb9030 (rebased onto current main):
Verification on the rebased head:
@clawsweeper please re-review the current head. |
# Conflicts: # Sources/CodexBar/Resources/ar.lproj/Localizable.strings # Sources/CodexBar/Resources/ca.lproj/Localizable.strings # Sources/CodexBar/Resources/de.lproj/Localizable.strings # Sources/CodexBar/Resources/en.lproj/Localizable.strings # Sources/CodexBar/Resources/es.lproj/Localizable.strings # Sources/CodexBar/Resources/fa.lproj/Localizable.strings # Sources/CodexBar/Resources/fr.lproj/Localizable.strings # Sources/CodexBar/Resources/gl.lproj/Localizable.strings # Sources/CodexBar/Resources/id.lproj/Localizable.strings # Sources/CodexBar/Resources/it.lproj/Localizable.strings # Sources/CodexBar/Resources/ja.lproj/Localizable.strings # Sources/CodexBar/Resources/ko.lproj/Localizable.strings # Sources/CodexBar/Resources/nl.lproj/Localizable.strings # Sources/CodexBar/Resources/pl.lproj/Localizable.strings # Sources/CodexBar/Resources/pt-BR.lproj/Localizable.strings # Sources/CodexBar/Resources/ru.lproj/Localizable.strings # Sources/CodexBar/Resources/sv.lproj/Localizable.strings # Sources/CodexBar/Resources/th.lproj/Localizable.strings # Sources/CodexBar/Resources/tr.lproj/Localizable.strings # Sources/CodexBar/Resources/uk.lproj/Localizable.strings # Sources/CodexBar/Resources/vi.lproj/Localizable.strings # Sources/CodexBar/Resources/zh-Hans.lproj/Localizable.strings # Sources/CodexBar/Resources/zh-Hant.lproj/Localizable.strings
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
Summary
Adds an opt-in notch usage overlay under Settings → Notch, off by default. It shows enabled provider tiles and an optional agent-session band, supports one to four columns, independently scrolling sections, reordering, and an optional Toggle/Hold shortcut. Agent sessions come from the existing store, not a second scanner.
The feature direction is approved in the owner review. The four original findings are addressed: shortcut registration follows enablement/start-stop, benign settings changes preserve expanded panels, restart does not accumulate handlers, and Codex credits occupy only an otherwise unused fallback slot.
Owner review hold: keep this feature PR open for Peter's review. Direction approval and passing CI do not authorize an unattended merge. Fresh sanitized before/after screenshots and native interaction proof are still pending.
Maintainer click-safety repair
Verification
swift test --jobs 4 --filter 'Notch|ProviderArchitectureGatekeeperTests': 78 tests in six suites passed, including new geometry and hover-state coverage and the existing owner-fix tests.make check: passed with zero violations across 2,063 Swift files.make test: passed — 968 selections across 81 groups, all first-pass successful; zero failures, retries, or timeouts (1,010.4 seconds). The final changelog-only follow-up leaves application and test sources identical to this tested tree.5317e595c31b6c6de9d1ee653d48098eae7bc7f4imports the already-landed fix: publish completed Codex cost history without rescanning #3279 changes without modifying notch source, settings, tests, or visuals. Its complete tree differs from the previously verified build, so the full-suite, whole-repository lint, signed-bundle, and packaging results above are previous-head evidence. CI for this updated head is separate. Before further local suite runs, incorporate the session-file isolation repair from fix: isolate provider session files during tests #3280. Fresh signed-build native interaction evidence and Peter's review remain required before any merge.Routine verification uses a clean environment with Keychain access suppressed, Codex-file isolation enabled, and live provider fetching disabled. No real provider/account request is required for the interaction repair. No release is part of this PR update.
Existing contributor visuals (before the click-safety repair)
These show the feature and settings, not proof of the repaired native click-through boundary.