Skip to content

Commit 9986f68

Browse files
bobbyjohnstxclaude
andcommitted
docs: document Electron desktop app improvements
Document comprehensive desktop app improvements across security, platform lifecycle, and polish: Security (P0): - CSP headers, navigation origin validation, setWindowOpenHandler restrictions - URL scheme validation on shell.openExternal (http/https/mailto only) - Global uncaughtException/unhandledRejection handlers Platform Lifecycle (P0): - Minimum window size (960x600), macOS dock behavior, dock icon restoration - Theme change listener syncs with OS dark/light mode Professional Polish (P1): - Cross-platform menus (Windows/Linux/macOS) with GitHub Help links - System tray with Show Window/Quit context menu - Non-blocking update notification banner from GitHub Releases - Persistent zoom level and window state Nice-to-Have (P2): - Dock badge (macOS) and taskbar flash (Windows) on notifications - Global hotkey Cmd/Ctrl+Shift+T for window focus Updated: README.md desktop section, CLAUDE.md packages/desktop docs, packages/desktop/README.md with comprehensive feature list and updated dev/build commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 08d51f7 commit 9986f68

3 files changed

Lines changed: 44 additions & 6 deletions

File tree

‎CLAUDE.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ SolidJS + TailwindCSS v4 web app. Connects to the tinycode API server. Used by b
105105

106106
Electron shell wrapping `packages/app`. Run with `bun run --cwd packages/desktop dev`.
107107

108+
**Key implementation files:**
109+
- **Security** (`src/main/window.ts`): Content Security Policy headers, navigation origin validation, `setWindowOpenHandler` preventing uncontrolled new windows, and `shell.openExternal` URL scheme validation (http/https/mailto only)
110+
- **System tray** (`src/main/tray.ts`): Cross-platform tray integration with Show Window and Quit context menu actions
111+
- **Application menus** (`src/main/menu.ts`): Cross-platform menus for Windows/Linux/macOS with Help menu linking to GitHub (repo, discussions, issues). No longer macOS-only
112+
- **Update notification** (`packages/app/src/components/update-notification-banner.tsx`): Non-blocking slide-in banner notifying about available updates from GitHub Releases. Includes i18n and ARIA accessibility
113+
- **Global exception handling** (`src/main/index.ts`): Captures `uncaughtException` and `unhandledRejection` globally
114+
- **Platform lifecycle**: Minimum window size 960x600, macOS dock icon restoration, theme change listener for OS dark/light mode sync, persistent zoom level and window state
115+
108116
### `packages/plugin` — Plugin SDK
109117

110118
Source for `@tinycode/plugin`. Provides the public plugin API.

‎README.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ The primary interface is the **terminal UI (TUI)** — a full-featured interacti
1818

1919
For teams or remote access, tinycode also ships a **web UI** (SolidJS + TailwindCSS) that connects to the tinycode API server. Open `http://localhost:4096` after starting the server, or run `bun dev web` to launch both. The web UI provides the same conversation, agent, and tool capabilities in a browser tab.
2020

21-
A **standalone desktop app** (Electron) is available for macOS, Windows, and Linux. It wraps the web UI in a native window with system tray integration. Run `bun run --cwd packages/desktop dev` to launch in development, or build distributable binaries with `bun run --cwd packages/desktop build`.
21+
A **standalone desktop app** (Electron) is available for macOS, Windows, and Linux. It wraps the web UI in a native window with system tray integration, auto-updates via GitHub Releases, and platform-specific features. Run `bun run --cwd packages/desktop dev` to launch in development, or build distributable binaries with `bun run --cwd packages/desktop build`.
22+
23+
**Desktop app features:**
24+
- **System tray integration**: Access tinycode from the menu bar (macOS) or system tray (Windows/Linux) with Show/Hide and Quit actions
25+
- **Global hotkey** (Cmd/Ctrl+Shift+T): Bring the window to front or minimize it without closing the app
26+
- **Auto-updates**: Automatically checks for new releases on GitHub and notifies you with an in-app banner
27+
- **Platform-specific behaviors**:
28+
- macOS: Closing the window keeps the app running in the dock; Cmd+Q quits fully. Dock badge shows notification count
29+
- Windows/Linux: App menu with Help links to GitHub (repo, discussions, issues). Taskbar flashes on background notifications
30+
- **Persistent settings**: Zoom level and window state persist across app restarts
31+
- **Theme sync**: Automatically detects OS dark/light mode changes and updates the app appearance
2232

2333
### IDE Integration (ACP)
2434

‎packages/desktop/README.md‎

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
# tinycode Desktop
22

3-
The tinycode Desktop app, built with Electron.
3+
The tinycode Desktop app, built with Electron. Wraps the web UI in a native window with system tray integration, auto-updates, and platform-specific features for macOS, Windows, and Linux.
4+
5+
## Features
6+
7+
- **System tray integration**: Access tinycode from the menu bar (macOS) or system tray (Windows/Linux)
8+
- **Global hotkey** (Cmd/Ctrl+Shift+T): Bring the window to front or minimize
9+
- **Auto-updates**: Checks GitHub Releases for updates and notifies via in-app banner
10+
- **Cross-platform menus**: Application menus with Help links to GitHub (repo, discussions, issues)
11+
- **Theme sync**: Automatically detects OS dark/light mode changes
12+
- **Persistent settings**: Zoom level and window state saved across restarts
13+
- **Security**: Content Security Policy headers, navigation origin validation, URL scheme validation on external links
14+
- **Platform-specific behavior**:
15+
- macOS: Closing the window keeps the app running in the dock. Cmd+Q quits fully. Dock badge shows notification count.
16+
- Windows/Linux: Taskbar flashes on background notifications
417

518
## Development
619

20+
From the repo root:
21+
722
```bash
23+
# Install dependencies
824
bun install
9-
bun dev
25+
26+
# Launch Electron app in development
27+
bun run --cwd packages/desktop dev
1028
```
1129

1230
## Build
1331

14-
Run the `build` script to build the app's JS assets, then `package` to
15-
bundle the assets as an application. The resulting app will be in `dist/`.
32+
From the repo root:
1633

1734
```bash
18-
bun run build && bun run package
35+
# Build web UI assets and package as distributable app
36+
bun run --cwd packages/desktop build && bun run --cwd packages/desktop package
1937
```
38+
39+
The resulting app will be in `packages/desktop/out/` with platform-specific installers and binaries ready for distribution.

0 commit comments

Comments
 (0)