Skip to content

feat: Electron menu bar app with native screenshot capture - #1007

Open
arbiterFF wants to merge 2 commits into
enricoros:mainfrom
arbiterFF:feat/electron-menubar
Open

feat: Electron menu bar app with native screenshot capture#1007
arbiterFF wants to merge 2 commits into
enricoros:mainfrom
arbiterFF:feat/electron-menubar

Conversation

@arbiterFF

Copy link
Copy Markdown

Summary

  • Adds a minimal Electron shell that runs big-AGI as a macOS menu bar tray app — directly addressing Desktop client for big-AGI #338
  • Spawns the Next.js standalone server (BIG_AGI_BUILD=standalone) on a random port, opens a frameless BrowserWindow that reuses the existing WebkitAppRegion: 'drag' CSS in OptimaBar.tsx
  • Exposes desktopCapturer via a preload script for silent native screenshot capture (no browser picker dialog)
  • Adds Is.Electron detection to pwaUtils.ts so the app knows it's running in Electron

Changes

New files (all in electron/):

  • electron/main.js — Main process: tray icon, frameless window, standalone server lifecycle
  • electron/preload.jscontextBridge exposing electronAPI.captureScreen() and isElectron
  • electron/electron-builder.yml — macOS build config (DMG + ZIP)

Modified files (2 only, minimal changes):

  • src/common/util/pwaUtils.ts — Added Is.Electron flag + (Desktop) device name suffix
  • src/common/util/screenCaptureUtils.ts — Electron-native capture path before getDisplayMedia fallback

How to run

npm install
BIG_AGI_BUILD=standalone npx next build
cp -r dist/static dist/standalone/dist/static
cp -r public dist/standalone/public
./node_modules/.bin/electron electron/main.js

Future consideration: tray quick-capture widget

With desktopCapturer already wired up, a natural next step would be a Claude-style tray widget — a small popover from the tray icon that lets you:

  1. Capture a screenshot with one click (silent, no picker)
  2. Type a quick prompt alongside it
  3. Start a conversation directly from the menu bar without opening the full window

This would make big-AGI a true "always available" desktop AI assistant, similar to how Claude Desktop's quick capture works. The plumbing is already in place with the preload API.

Test plan

  • npm run electron:dev → tray icon appears in macOS menu bar
  • Click tray → window opens with full big-AGI UI
  • Chat works (tRPC calls hit local Next.js server)
  • Screenshot button in attachment menu uses native capture (no browser picker)
  • Window is frameless, top bar is draggable
  • Closing window → app stays in tray; quit from tray menu exits fully

Closes #338

🤖 Generated with Claude Code

Adds a minimal Electron shell that runs big-AGI as a macOS menu bar app:
- Spawns the Next.js standalone server on a random port
- Shows a tray icon in the macOS menu bar with show/quit controls
- Opens a frameless BrowserWindow (reuses existing WebkitAppRegion drag CSS)
- Exposes desktopCapturer via preload for silent screenshot capture (no picker)
- Adds Is.Electron detection to pwaUtils.ts
- Only 2 existing files modified; all new code lives in electron/

Closes enricoros#338

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 4, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Token Fabrics Pro Team on Vercel.

A member of the Team first needs to authorize it.

- Add 38px fixed dark gray title bar for macOS traffic light buttons
- Adjust PageCore height to calc(100dvh - 38px) to prevent content overflow
- Add postinstall script to patch Electron.app plist (name + icon)
- Remove dock icon toggling (pure menu bar app)
- Set app name and userData path to "big-AGI"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open Ready Ready Preview Mar 4, 2026 2:51am

Request Review

Repository owner deleted a comment from claude Bot Mar 4, 2026
@enricoros

Copy link
Copy Markdown
Owner

@claude I've been outsmarted by this PR! How can I get back on track? JK, please implement all that's missing - i.e. I'd love a CI pipeline or at least the multi-platform builds for MacOS Arm and Win 64

@claude

claude Bot commented Mar 4, 2026

Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

@enricoros

Copy link
Copy Markdown
Owner

@claude Since the jobs are failing when you try to fetch feat/electron-menubar, can you access the code on https://github.com/arbiterFF/big-AGI/tree/feat/electron-menubar, or 6f6f365 ?

@claude

claude Bot commented Mar 4, 2026

Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

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.

Desktop client for big-AGI

2 participants