Skip to content

feat/vpr status bar popover - #890

Open
alexanderludwig wants to merge 9 commits into
mainfrom
codex/vpr-status-bar-popover
Open

feat/vpr status bar popover#890
alexanderludwig wants to merge 9 commits into
mainfrom
codex/vpr-status-bar-popover

Conversation

@alexanderludwig

Copy link
Copy Markdown
Collaborator

What

Adds a macOS status-bar popover for AntSeed VPR and the multi-instance desktop development workflow needed to test it safely in parallel.

The status-bar popover:

  • Opens from a left-click on the tray icon and anchors beneath it.
  • Reuses the floating VPR panel’s routing components, data, and actions.
  • Shows balance, routing status, recent sessions, model selection, and VPR shortcuts.
  • Supports model changes, per-chat model pins, connected-app launching, deposits, and navigation.
  • Uses cached data when available and displays a stable loading screen during startup.
  • Includes a compact, scrollable layout with edge-aware positioning and pointer alignment.
  • Preserves the floating pill and native right-click tray menu.

The multi-instance workflow:

  • Adds isolated desktop development instances with separate ports and data directories.
  • Prevents development instances from interfering with the primary runtime.
  • Hardens shared buyer/runtime lifecycle behavior during startup and shutdown.

Why

The tray previously provided only native menu actions and did not expose live VPR routing information. The new popover gives users fast access to routing status, recent activity, and model controls without opening the full desktop window.

Multi-instance development is included so the popover and runtime behavior can be tested alongside another AntSeed desktop instance without port, process, profile, or data-directory conflicts.

Testing

Validated with:

  • pnpm -C apps/desktop run build:main
  • node --test apps/desktop/dist/main/ui/vpr-menu-bar-presentation.test.js
    • 9 tests covering sizing, tray anchoring, display-edge clamping, pointer alignment, macOS presentation, and menu-tracking cleanup.
  • pnpm -C apps/desktop exec vitest run src/renderer/ui/components/compact/CompactRoutingPanel.test.ts
    • 3 tests covering loading, disconnected, idle, insufficient-funds, and active-routing states.
  • pnpm -C apps/desktop run typecheck:renderer
  • pnpm -C apps/desktop run build:renderer
  • git diff --check

The production renderer build passes with the repository’s existing CSS-target and bundle-size warnings.

Checklist

  • pnpm run build passes
  • pnpm run test passes
  • Breaking changes documented — no breaking changes introduced

@alexanderludwig
alexanderludwig changed the base branch from feat/desktop-multi-instance-dev to main August 17, 2026 09:10
@alexanderludwig alexanderludwig changed the title Codex/vpr status bar popover feat/vpr status bar popover Aug 17, 2026
@alexanderludwig

Copy link
Copy Markdown
Collaborator Author

@claude pls review

@claude

claude Bot commented Aug 17, 2026

Copy link
Copy Markdown

Claude finished @alexanderludwig's task in 3m 17s —— View job


Review

  • Gather context (PR description, changed files list)
  • Review multi-instance dev workflow changes (process-manager, dev-instance, shared-buyer)
  • Review tray/status-bar popover (window.ts, vpr-menu-bar-presentation.ts, tray.ts)
  • Review renderer changes (CompactRoutingPanel, VprMenuBarApp, FloatApp refactor)
  • Review IPC/preload/bridge changes

Note: the branch's origin/main ref available in this sandbox is a shallow, out-of-date fetch (network access to re-fetch was unavailable), so I reviewed the working tree directly against the file list in the PR description rather than a git diff origin/main...HEAD.

Findings

1. Blank floating-pill panel when routing stops with cached chats (regression from the latest "retain stopped popover sessions" commit)

apps/desktop/src/renderer/ui/components/compact/CompactRoutingPanel.tsx:213-222:

{!runtimeOn && conversations.length === 0 ? <div className={styles.empty}>Not connected — routing is stopped...</div> : null}
...
{showConversations ? conversations.map((chat) => { ... }) : null}

showConversations = compactRoutingShowsConversations(variant, runtimeOn) is false for variant === 'float' whenever runtimeOn is false (CompactRoutingPanel.tsx:31-36). The "Not connected" fallback message, however, is only shown when conversations.length === 0.

Once a user has had any chat activity, recentConversations in apps/desktop/src/renderer/modules/app/float.ts:329-335 is retained (by design, from the latest commit) even after the runtime stops — it's just marked active:false, not cleared. So for the floating pill (not the menu-bar popover), stopping routing with any prior chat history now renders neither the chat list (hidden by showConversations) nor the "Not connected" message (hidden because conversations.length > 0) — the panel body goes blank with no explanation. This combination (float variant + stopped + non-empty history) isn't covered by CompactRoutingPanel.test.ts, which only asserts compactRoutingShowsConversations in isolation.

Likely fix: gate the empty-state message on !showConversations (or equivalently !runtimeOn && !showConversations) instead of conversations.length === 0, so the float pill still explains why the list is empty regardless of whether stale history exists.

Fix this →

Other observations (not blocking)

  • apps/desktop/src/main/runtime/process-manager.ts:756-795stop() force-kills after 5s and resolves the promise unconditionally at 7.5s even if the child never actually exits. This is pre-existing behavior, not introduced by this PR, but worth a note since the multi-instance work leans harder on stop(mode, preserve) semantics.
  • The multi-instance dev plumbing (process-manager.ts attach/detach, shared-buyer.ts, ipc/runtime.ts) is well-isolated behind isMultiInstanceDevelopment() and has solid targeted test coverage (process-manager.test.ts, shared-buyer.test.ts) for the attach/reuse/detach lifecycle.
  • vpr-menu-bar-presentation.ts bounds/height/pointer math is pure and has thorough edge-case tests (multi-display, negative coordinates, short work areas).
  • CHANGELOG.md was updated for the user-facing popover change, consistent with repo policy.

Summary

The popover implementation and multi-instance dev tooling are solid and well-tested overall. The one concrete bug is the blank-panel regression in the floating pill described above, introduced by the final "retain stopped popover sessions" commit — it only reused the retained-conversations logic correctly for the menu-bar variant and left a gap for the float variant.

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