feat(electrobun): wire persistence — SQLite, 17 themes, font system

Persistence:
- bun:sqlite at ~/.config/agor/settings.db (WAL mode, 500ms busy_timeout)
- 4 tables: schema_version, settings, projects, custom_themes
- 5 RPC handlers: settings.get/set/getAll, projects get/set

Theme system (LIVE switching):
- All 17 themes ported from Tauri (4 Catppuccin + 7 Editor + 6 Deep Dark)
- applyCssVars() sets 26 --ctp-* vars on document.documentElement
- Parallel xterm ITheme mapping per theme
- theme-store.svelte.ts: Svelte 5 rune store, persists to SQLite

Font system:
- font-store.svelte.ts: UI/terminal font family + size
- Live CSS var application (--ui-font-family/size, --term-font-family/size)
- onTermFontChange() callback registry for terminal instances
- Persists all 4 font settings to SQLite

AppearanceSettings wired: 17-theme grouped dropdown, font steppers
Init on startup: restores saved theme + fonts from SQLite
This commit is contained in:
Hibryda 2026-03-20 05:29:03 +01:00
parent 0b9e8b305a
commit 6002a379e4
13 changed files with 1043 additions and 53 deletions

View file

@ -33,6 +33,9 @@ const rpc = Electroview.defineRPC<PtyRPCSchema>({
export const electrobun = new Electroview({ rpc });
/** Exported for use by stores that need RPC access (theme-store, font-store). */
export { rpc as appRpc };
const app = mount(App, {
target: document.getElementById("app")!,
});