Skip to content

feat(go): Electron desktop app for workspace#340

Open
baryhuang wants to merge 7 commits intoopenagents-org:developfrom
baryhuang:feature/packages-go-electron
Open

feat(go): Electron desktop app for workspace#340
baryhuang wants to merge 7 commits intoopenagents-org:developfrom
baryhuang:feature/packages-go-electron

Conversation

@baryhuang
Copy link
Copy Markdown
Collaborator

@baryhuang baryhuang commented Apr 4, 2026

Summary

  • New packages/go — Electron desktop wrapper around the workspace frontend
  • Workspace selector on launch: paste a URL or pick from recent history
  • Switch workspace anytime via ⇄ button in sidebar header
  • Workspace credentials persisted locally in Electron userData

How to test

  1. cd packages/go && npm install
  2. npm run electron:dev — launches Electron with Next.js dev server
  3. Paste a workspace URL (e.g. https://workspace.openagents.org/<id>?token=<token>) to connect
  4. Verify workspace loads and functions normally
  5. Click ⇄ next to workspace name in sidebar → workspace selector with cancel option
  6. Quit and relaunch → should auto-connect to last workspace
  7. npm run build → verify Next.js build succeeds

How to build and install

  1. Bump version: cd packages/go && npm version patch (currently 0.1.0)
  2. Build: npm run electron:build
  3. Output in packages/go/dist/.dmg (macOS), .exe (Windows), .AppImage (Linux)
  4. macOS: open the .dmg, drag "OpenAgents Go" to Applications, launch from Launchpad

Technical notes for reviewers

  • Static export: Uses Next.js output: export with images: { unoptimized: true } since the image optimizer requires a server. The [workspaceId] dynamic route is removed — routing is handled client-side in page.tsx by reading window.location.pathname.
  • Local HTTP server: Packaged app serves the static export via a local HTTP server (same pattern as ai-meeting-notes-agent desktop). SPA fallback serves index.html for any unknown path, enabling client-side routing.
  • CORS: webSecurity: false is set on BrowserWindow because the workspace API (workspace-endpoint.openagents.org) does not allow requests from http://127.0.0.1. This only affects the Electron app, not the web version.
  • Dev vs packaged: electron:dev uses Next.js dev server on localhost:3001 (full SSR, hot reload). Packaged app uses static export + local HTTP server. Both paths should be tested.
  • Workspace history: Stored in Electron userData/settings.json. storage.js auto-maintains up to 10 history entries and updates workspace names on switch.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 4, 2026

@baryhuang is attempting to deploy a commit to the Raphael's projects Team on Vercel.

A member of the Team first needs to authorize it.

@zomux
Copy link
Copy Markdown
Contributor

zomux commented Apr 4, 2026

checked in

@zomux
Copy link
Copy Markdown
Contributor

zomux commented Apr 4, 2026

@QuanCheng-QC Please do a thorough test

@baryhuang
Copy link
Copy Markdown
Collaborator Author

@zomux @QuanCheng-QC All commits are done. Ready for review and test.

Clone workspace frontend into packages/go and wrap it as an Electron
desktop app with:
- Hidden titlebar with macOS traffic lights and window drag region
- Loading screen with spinner animation
- Custom app icon with rounded corners and macOS dock icon
- Native menu bar (Edit, View, Window)
- OAuth popup support for Google/GitHub auth
- Auto-redirect to default workspace (configured via env vars)
- electron-builder config for macOS/Windows/Linux packaging
- Add Electron settings persistence (electron/storage.js) with
  workspace history tracking (up to 10 entries)
- Landing page shows workspace selector with URL input, up to 3
  recent workspace chips with name + hover URL tooltip, and a
  dropdown of full history on the input field
- Switch workspace via ⇄ button in sidebar header (saves current
  workspace name to history, navigates to selector with cancel option)
- Auto-connect to last used workspace on launch
- Support env var fallback (NEXT_PUBLIC_DEFAULT_WORKSPACE_*)
Replace non-square logo-icon.png with the 512x512 rounded app icon
on the workspace selector page for consistent branding.
- Switch to static export (output: export) with unoptimized images
- Replace standalone server with local HTTP server + SPA fallback
  (same pattern as ai-meeting-notes-agent desktop)
- Handle all routing client-side in root page.tsx via
  window.location.pathname instead of Next.js dynamic routes
- Add webSecurity: false to bypass CORS for workspace API calls
  from the local HTTP server origin
- Update electron-builder to use extraResources for out/ directory
@baryhuang baryhuang force-pushed the feature/packages-go-electron branch from 431f638 to 0996786 Compare April 4, 2026 22:02
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