Adds right-click → Delete on sidebar thread items using Electron's
native Menu.popup() when running in desktop, with an imperative DOM
fallback for browser environments. The contextMenu.show() API is
generic so the returned item id is type-safe based on the items passed.
Co-Authored-By: Claude Haiku 4.5 <[email protected]>
- Switch from turbo watch to turbo run --parallel for dev scripts
- Simplify contracts exports to use ./src/index.ts for types directly
- Add --watch --clean to contracts dev script
- Root dev task depends on contracts#build, is persistent
- Revert typecheck to depend on ^typecheck (contracts types from source)
- Remove redundant server dev task override
- Desktop dev depends only on t3#build (contracts implied)
- Uncomment server dist wait in dev-electron.mjs
Co-Authored-By: Claude Opus 4.6 <[email protected]>
tsdown escalates warnings to errors when CI=true. Adding
inlineOnly: false suppresses the bundled-dependency warning
since we intentionally inline contracts and zod.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
tsdown v0.20.3 errors when it detects undeclared dependencies in the
bundle. Since @t3tools/contracts (already in noExternal) transitively
pulls in zod, explicitly declare it to avoid the build failure.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Remove --filter=t3 from dev:desktop since electron spawns its own
server from dist/index.mjs (running server via turbo would conflict)
- Add t3#build and contracts#build as dependencies of desktop dev task
so the server is built before electron starts
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Change turbo typecheck task to dependsOn: ["^build"] so the contracts
package generates .d.cts/.d.mts declaration files before downstream
packages run tsc
- Revert contracts types back to generated declaration files
- Remove unused useGitState.ts that imported missing @tanstack/react-query
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Point @t3tools/contracts type exports to ./src/index.ts instead of
generated .d.cts/.d.mts files that only exist after build
- Remove unused useGitState.ts that imported missing @tanstack/react-query
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Move BranchToolbar below the chat input box to match Codex app layout
- Change worktree path to ~/.t3code/worktrees/{repo}/{branch}
- Split desktop tsdown config into separate main/preload builds to prevent
code-splitting from leaking node:os into the sandboxed preload script
- Migrate turbo scripts to turbo watch, add desktop start/smoke-test tasks
- Update server output to .mjs, add CJS format, remove tsx dependency
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verifies that querying branches from a worktree directory correctly
reports the worktree's branch as current, while the main repo still
shows its own branch — the assumption the BranchToolbar fix relies on.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Use worktree path instead of project cwd for git branch queries so
worktree threads correctly report their branch as current. Also update
error banner to use semantic color tokens for light mode support.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Both openInEditor and the Cmd+O shortcut now use the thread's
worktreePath when available instead of always using activeProject.cwd.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Move git operations (listGitBranches, checkoutGitBranch, createGitWorktree,
etc.) from main.ts into git.ts for testability. Add 20 integration tests
that run real git commands against temporary repos covering checkout,
branch creation, worktrees, conflicts, and thread-switching flows.
Also fix: branch checkout now runs regardless of envMode, worktree
creation passes cwd to ensureSession to avoid stale closure bug, and
current branch auto-fills on new threads.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace hardcoded dark-mode colors with theme-aware semantic classes
(bg-popover, text-foreground, bg-accent, etc.) so the branch picker
works in both light and dark mode. Detect the real default branch via
git symbolic-ref and show a "default" label (with "current" taking
precedence when both apply).
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add non-null assertion for activeProject in worktree creation path
(guarded by earlier check) and add missing branch/worktreePath to
test fixture.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Wire up git:checkout IPC channel across the full stack so branch
selection actually checks out the branch. Clear error banners when
a subsequent checkout or branch creation succeeds.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Move branch picking from sidebar context menu into ChatView input
toolbar. Add env mode toggle (local/worktree) that locks after first
message, branch dropdown with create-new-branch inline form, and
wire up git:create-branch IPC channel.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Allows users to right-click "+ New thread" to create threads from specific git branches, with optional worktree creation for isolated work. Includes branch sorting (current/default first), graceful handling of non-git repos, and ability to initialize git repos.
- New git IPC contract (listBranches, createWorktree, removeWorktree, init)
- Branch context menu with worktree sub-option in Sidebar
- Thread model extended with branch/worktreePath fields
- Session cwd uses worktree path when available
- Branch sorting: current > main/master > alphabetical
Co-Authored-By: Claude Haiku 4.5 <[email protected]>
* feat: scaffold apps/server package and WebSocket protocol types
- Create apps/server with package.json, tsconfig, tsup config
- Copy codexAppServerManager, providerManager, fixPath from desktop (no Electron deps)
- Add WebSocket message protocol schemas (WsRequest, WsResponse, WsPush) to @acme/contracts
- Define WS_METHODS and WS_CHANNELS constants for type-safe routing
Co-authored-by: Theo Browne <[email protected]>
* feat: implement WebSocket + HTTP server and CLI entry point
- wsServer.ts: WebSocket server routes NativeApi methods, serves static files
- Provider events pushed to all connected clients
- SPA fallback for client-side routing
- Server welcome message with cwd/projectName on connect
- index.ts: CLI entry point
- Auto-detects available port (default 3773)
- Resolves renderer dist for static serving
- Opens browser on startup via 'open' package
- Graceful shutdown on SIGINT/SIGTERM
Co-authored-by: Theo Browne <[email protected]>
* feat: WebSocket transport and NativeApi implementation for browser
- wsTransport.ts: WebSocket client with request/response, push subscriptions,
auto-reconnect with exponential backoff
- wsNativeApi.ts: Full NativeApi implementation over WebSocket transport
- All provider methods routed through WS_METHODS
- Provider events streamed via WS_CHANNELS.providerEvent
- Todos/terminal/agent stubbed (not needed for web mode)
- dialogs.pickFolder returns null (text input fallback in UI)
- session-logic.ts: readNativeApi() now auto-detects environment
- Prefers Electron preload bridge if available (window.nativeApi)
- Falls back to WebSocket transport for browser mode
- onServerWelcome() hook for renderer to receive cwd on connect
Co-authored-by: Theo Browne <[email protected]>
* feat: adapt renderer for browser mode
- App.tsx: Add AutoProjectBootstrap that listens for server welcome
and auto-creates project + thread from server's cwd
- Sidebar: Conditionalize drag region (Electron only), hide Browse button in browser
- ChatView: Conditionalize drag region, adjust padding for browser
- DiffPanel: Same drag region treatment
- index.html: Update title to 'CodeThing'
- env.ts: isElectron detection utility
Co-authored-by: Theo Browne <[email protected]>
* feat: monorepo & CLI integration
- Root package.json: Add dev, dev:server, dev:web, start scripts
- dev runs both server and renderer in parallel via turbo
- VITE_WS_URL injected so renderer connects to server in dev mode
- turbo.json: Add WS env vars to globalEnv
- vite.config.ts: Inject VITE_WS_URL at build time for WS server discovery
- wsTransport.ts: Use VITE_WS_URL env var in dev, fall back to page URL in prod
- Server dev script: Uses tsx for direct TypeScript execution with VITE_DEV_SERVER_URL
Co-authored-by: Theo Browne <[email protected]>
* feat: remove Electron desktop app, clean up contracts and docs
- Delete apps/desktop/ entirely (replaced by apps/server)
- Remove IPC_CHANNELS constant from contracts (no longer needed)
- Keep NativeApi interface (still the renderer's API contract)
- Keep EDITORS constant (used by both server and renderer)
- Update README.md with new architecture diagram and scripts
- Update AGENTS.md with new package roles and architecture
Co-authored-by: Theo Browne <[email protected]>
* test: add WebSocket server integration tests
- Tests welcome message on connect with cwd/projectName
- Tests server.getConfig method
- Tests providers.listSessions returns empty array
- Tests error response for unknown methods
- Tests graceful handling of invalid JSON
- All 73 tests pass across 12 test files
Co-authored-by: Theo Browne <[email protected]>
* fix: address lint warnings in new files
- wsTransport.ts: Use addEventListener instead of on-function assignments
- wsServer.ts: Replace filter(Boolean).pop() with direct array access
- wsServer.test.ts: Use addEventListener for WebSocket events
Co-authored-by: Theo Browne <[email protected]>
* fix: race condition in auto-project bootstrap + cleanup
- wsNativeApi: Cache last welcome payload and replay to late subscribers.
Fixes race where WS connect + welcome arrives before React effect fires.
- App.tsx: Add bootstrappedRef to prevent duplicate project creation,
skip bootstrap in Electron mode
- wsTransport: Use standard import.meta.env for VITE_WS_URL access
- CLAUDE.md: Fix header (was incorrectly '# AGENTS.md')
Co-authored-by: Theo Browne <[email protected]>
* fix: use tsx command directly in server dev script
Use 'tsx src/index.ts' instead of 'node --import tsx' for simpler dev execution
Co-authored-by: Theo Browne <[email protected]>
* chore: clean up stale Electron references and config
- Remove smoke-test script (was desktop-only)
- Remove dist-electron from turbo outputs and .gitignore
- Rename ELECTRON_RENDERER_PORT → PORT in vite.config.ts
- Clean up turbo globalEnv (remove ELECTRON_RENDERER_PORT, WS_SERVER_PORT)
- Update CI workflow to use bun 1.3.9 (matches package.json engines)
Co-authored-by: Theo Browne <[email protected]>
* feat: make t3 package publishable for npx
- Remove private:true so package can be published to npm
- Add files field to limit published files to dist/
- Move @acme/contracts to devDependencies (bundled by tsup)
- Add @acme/renderer devDependency for turbo build ordering
- Add bundle-client.mjs: copies renderer build into dist/client/
- Update resolveStaticDir to check dist/client/ first (npx scenario),
then fall back to monorepo layout (../../renderer/dist)
- Full build pipeline: contracts → renderer → server + bundle client
Co-authored-by: Theo Browne <[email protected]>
* fix tests
* turborepo and better logging
* bring back electron
* fix
* Promise catching fixes
---------
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Theo Browne <[email protected]>
* init components
* use them
* Fix select trigger styling in dark mode and add open state highlight
Remove dark mode background bleed on select triggers and add accent
background when popup is open.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---------
Co-authored-by: Claude Opus 4.6 <[email protected]>
* Add open-in-editor feature with Cmd+O shortcut
Add dropdown in header to open workspace in Cursor or system file manager (Finder/Explorer/Files). Include Cmd+O/Ctrl+O global keyboard shortcut to open in last-used editor, persisted to localStorage.
Co-Authored-By: Claude Haiku 4.5 <[email protected]>
* Move editor definitions to contracts for strict IPC typing
EDITORS config and EditorId type now live in @acme/contracts so the
shell.openInEditor IPC channel is strictly typed end-to-end. The main
process uses the contract's command field (null = file manager via
shell.openPath).
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Fix biome formatting issues
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix: add error handling and address review feedback
- Validate cwd is non-empty in shell:open-in-editor IPC handler
- Check shell.openPath() return value and throw on error
- Attach spawn error listener to prevent crashes from missing CLI
- Validate localStorage lastEditor against known EDITORS list
- Only call preventDefault() for Cmd+O when action will run
Co-authored-by: Julius Marminge <[email protected]>
---------
Co-authored-by: Claude Haiku 4.5 <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
- remove model picker when creating projects and default to the project model
- add Cmd+Shift+O shortcut to open a new thread in the active project
- remove project/status pills from chat chrome for a cleaner layout
- only surface actionable item lifecycle events (tool/command/file change)
- add tests covering reasoning and agent-message filtering