Skip to content

feat(desktop): Electron app with tiled widget frames - #57

Merged
sanchitrk merged 10 commits into
canaryfrom
claude/desktop-app-startup-4d4912
Oct 9, 2026
Merged

sanchitrk merged 10 commits into
canaryfrom
claude/desktop-app-startup-4d4912

Conversation

@sanchitrk

Copy link
Copy Markdown
Contributor

Desktop app (Electron) rendering the web app, with a first widget desktop tiled by webwm.

Desktop shell

  • Scaffold apps/desktop (Electron main/preload) and apps/web (React + TanStack Router), served over a custom codework-dev:// / codework:// scheme.
  • pnpm dev:desktop: one command runs the web dev server and main-process watcher, launches Electron when both are ready, and restarts it when main or preload rebuilds.
  • Fix the dev proxy: drop the forwarded Origin header (module scripts failed as CORS requests) and launch electron . so preload and web assets resolve. Web dev server pinned to 127.0.0.1:5173.

Widget desktop (apps/web/src/desktop)

  • Four empty widget frames tiled by webwm (installed from its GitHub release).
  • Drag a frame by its title to snap it into a new slot; pin to lock it; maximize/restore.
  • Drag the gap between master and stack columns to resize, clamped to widget minimum widths (arrow keys too).
  • Tailwind v4 with --cw-* CSS-variable theme tokens (light/dark), subtle 3D frames, lucide icons.

Verification

  • vp check and typecheck pass for apps/desktop and apps/web.
  • Exercised in the real Electron window via DevTools-protocol mouse/keyboard input: reorder, pin, maximize, and divider limits.

🤖 Generated with Claude Code

sanchitrk and others added 10 commits September 28, 2026 17:47
Add apps/web (Vite+ + React + TanStack file-based routing, hello world)
and apps/desktop (Electron shell embedding the web build via a
privileged codework:// scheme, dev-server proxy via CODEWORK_WEB_URL),
wired into the pnpm workspace with vite-plus-core as the vite alias.
# Conflicts:
#	pnpm-lock.yaml
#	vite.config.ts
`pnpm dev:desktop` runs the web dev server and main-process watcher,
launches Electron once both are ready, and restarts it when the main or
preload bundle rebuilds.

- Drop the forwarded Origin header in the dev proxy; it made net.fetch
  treat module scripts as CORS requests the dev server rejects.
- Launch `electron .` so the app path resolves preload and web assets.
- Pin the web dev server to 127.0.0.1:5173.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add apps/server, an Effect app server the desktop runs as a child
process (Electron binary in Node mode). It serves Effect RPC over a
loopback WebSocket on an OS-chosen port and keeps app state in SQLite
under Electron's userData (@effect/sql-sqlite-node, built on
node:sqlite). First RPCs: fs.list and package-scoped kv.get/kv.set.

Electron main starts the server, waits for its ready line, then opens
the window and hands the RPC URL to the page through the preload. Main
and preload are bundled separately because a sandboxed preload cannot
load a shared chunk. The dev runner also watch-builds the server.

Restructure apps/web/src into OS domains: kernel (server client),
shell (chrome, workspace switcher), wm (tiling, frames, instances),
sdk (widget contract) and widgets (built-ins plus registry).
defineWidget declares a widget with a props schema; the window manager
renders instances through the registry and validates saved props.

The first built-in is an explorer powered by @pierre/trees: folders
load lazily on expand, one query atom per path, and the expanded set
is saved per instance in SQLite. It is the master widget on Main.

Also add the pierre trees agent skill to skills-lock.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sanchitrk
sanchitrk merged commit bef2d43 into canary Oct 9, 2026
@sanchitrk
sanchitrk deleted the claude/desktop-app-startup-4d4912 branch October 9, 2026 13:58
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