Decouple bundled UI from runtime API and add remote instance tooling (#1228)
Add a packaged-client runtime boundary so the shared UI can talk to local, desktop, remote, and VS Code runtimes through the right transport instead of assuming one same-origin web server. Centralize OpenChamber-owned API access behind RuntimeAPIs, runtimeFetch, and runtime URL helpers, while keeping official OpenCode traffic on the SDK path. Support runtime switching, remote host selection, desktop client credentials, and headless connection links for pairing packaged clients with remote OpenChamber servers. Harden the new auth model by moving long-lived client tokens out of browser URLs, introducing short-lived scoped URL tokens for browser-owned transports, restricting URL-token access to explicit readable/realtime routes, and making client-token management session-scoped or self-scoped as appropriate. Update browser-owned assets and preview proxy flows to work with the split runtime model, including authenticated project icons, preview token propagation, CSP-safe preview bridge injection, and preview proxy auth that survives short-lived URL-token expiry. Tighten Electron security boundaries for packaged clients by gating privileged preload state to trusted origins and requiring explicit confirmation before connect deep-links import or switch remote runtimes. Also refresh agent guidance and project skills so future runtime/API, auth, preview, UI, CLI, settings, locale, and drag-to-reorder work follows the new architecture.
This commit is contained in:
committed by
GitHub
parent
a4314c189b
commit
2031e3b4a8
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: Adding Themes
|
||||
---
|
||||
|
||||
# Adding Themes
|
||||
|
||||
## Custom Themes (User)
|
||||
|
||||
Drop a JSON file into `~/.config/openchamber/themes/`. No rebuild needed.
|
||||
|
||||
1. Create theme file (e.g., `my-theme.json`)
|
||||
2. In app: **Settings → Theme → Reload themes**
|
||||
3. Select from dropdown
|
||||
|
||||
See `docs/CUSTOM_THEMES.md` for full format reference.
|
||||
|
||||
## Built-in Themes (Development)
|
||||
|
||||
### 1. Create JSON Files
|
||||
|
||||
Add to `packages/ui/src/lib/theme/themes/`:
|
||||
- `<id>-light.json`
|
||||
- `<id>-dark.json`
|
||||
|
||||
Use existing themes (e.g., `flexoki-dark.json`) as reference for the full structure.
|
||||
|
||||
### 2. Register in presets.ts
|
||||
|
||||
```typescript
|
||||
import mytheme_light_Raw from './mytheme-light.json';
|
||||
import mytheme_dark_Raw from './mytheme-dark.json';
|
||||
|
||||
export const presetThemes: Theme[] = [
|
||||
// ... existing themes
|
||||
mytheme_light_Raw as Theme,
|
||||
mytheme_dark_Raw as Theme,
|
||||
];
|
||||
```
|
||||
|
||||
### 3. Validate
|
||||
|
||||
```bash
|
||||
bun run type-check && bun run lint && bun run build
|
||||
```
|
||||
|
||||
## Key Files
|
||||
|
||||
- Theme types: `packages/ui/src/types/theme.ts`
|
||||
- Presets: `packages/ui/src/lib/theme/themes/presets.ts`
|
||||
- Example: `packages/ui/src/lib/theme/themes/flexoki-dark.json`
|
||||
- Custom themes doc: `docs/CUSTOM_THEMES.md`
|
||||
Reference in New Issue
Block a user