feat(pulse/menubar): surface active PAI sessions with read-only transcript popover#1280
Open
janrenz wants to merge 1 commit into
Open
feat(pulse/menubar): surface active PAI sessions with read-only transcript popover#1280janrenz wants to merge 1 commit into
janrenz wants to merge 1 commit into
Conversation
…cript popover
Adds a session-aware view to the existing macOS menubar app so the user can
glance at what PAI is doing across all terminals without opening anything else.
What's new in PulseMenuBar.swift:
- Reads ~/.claude/PAI/MEMORY/STATE/work.json (already kept fresh by
ISASync.hook.ts) and surfaces two sections in the menubar dropdown:
- Active Sessions: in-flight runs (phase != complete, updated < 5min),
sorted newest first, capped at 5.
- Recent (N): collapsible flyout submenu, completed/idle sessions
within the last 24h, capped at 3.
- Active-session count badge next to the menubar icon.
- Click any session entry -> NSPopover anchored to the status item,
showing a read-only transcript view of that session's .jsonl from
~/.claude/projects/*/<sessionUUID>.jsonl. Auto-refreshes every 2s.
- Indicators: ⚡ active algorithm phase, 📡 native, ✓ complete.
- Pure addition: zero behavioural change to existing jobs / status /
controls / logs. Filesystem-only, no Pulse HTTP dependency.
Compiles cleanly with the existing build.sh (swiftc -O -whole-module-optimization).
Closes nothing — opt-in feature, ships only via the existing install.sh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a session-aware view to the existing macOS menubar app so you can glance at what PAI is doing across all terminals without opening anything.
Single-file addition to
Releases/v5.0.0/.claude/PAI/PULSE/MenuBar/PulseMenuBar.swift. Pure addition — zero behavioural change to existing jobs / status / controls / logs.How it works
~/.claude/PAI/MEMORY/STATE/work.json— already kept fresh byISASync.hook.tson every ISA frontmatter edit. No new pipeline, no Pulse HTTP dependency.phase != complete, updated within 5 min), sorted newest first, capped at 5NSPopoveranchored to the status item, showing a read-only transcript view of that session's~/.claude/projects/-Users-{name}/<sessionUUID>.jsonl. Auto-refreshes every 2 s while open.Visual
Popover content:
Implementation notes
WorkSession,WorkRegistry,TranscriptEvent,TranscriptKind.parseWorkRegistry(from:),loadTranscript(uuid:limit:),formatAgeShort(_:),parseISO(_:),sessionIndicator(...),sessionLabel(...),formatSessionMenuTitle(...).SessionPopoverViewController(NSViewController with NSTextView in NSScrollView, 2-second refresh timer bound to viewWillAppear / viewWillDisappear).openSessionPopover(_:)replaces the previous direct file-open behaviour for session menu items.Build & verify
Compiles cleanly with the existing
build.sh(no script changes):swiftc -O -whole-module-optimization— 0 warnings, 0 errors. Tested locally; deployed viainstall.sh; menubar process healthy, popover renders, transcript loads and auto-refreshes.Diff stat
Zero deletions — strictly additive on top of upstream
main.Future work (not in this PR)
POST /chat/{slug}Pulse endpoint that runs SDKresumeon the session UUID (same plumbing as the Telegram bot) + a text input in the popover. Deliberately scoped out so the read-only viewer ships first and the reply architecture gets validated against actual usage.