mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
* plugins: app and terminal theme contributions Manifests can contribute themes (public CSS tokens over a light or dark base) and terminal themes (an ANSI palette), each at most 16 KiB. App themes must set --background and --foreground; omitted tokens are derived from them (surfaces copy the background, muted text, borders and accents mix the foreground into it), and values must be colors (no keywords, lengths, calc, var or url). Both load through the shared artifact-pack registry with the plugin's display name and a content revision, reach the renderer over IPC and are re-validated there. Catalog releases can declare app-theme and terminal-theme, and marketplaces stop hiding theme listings. docs/reference/plugin-themes.md documents the format. * plugins: resolve a selected plugin terminal palette on every host Selecting a plugin terminal theme saves a copy of its palette in settings (terminalPluginPalettes). The shared lookup reads it, so main, headless serve and relays answer terminal color queries and native chat matches the terminal without the plugin loaded; a malformed snapshot falls back to the default theme. * plugins: one Theme list with plugin themes, painted safely Appearance keeps the System/Dark/Light control until a plugin offers a theme; then Theme becomes one list with plugin themes after a divider, labelled with the publisher when names collide. Choosing one stores its base in theme and remembers the earlier built-in choice, which comes back while the plugin is off or after it is uninstalled; a plugin update that changes the base re-syncs theme. It also offers the plugin's terminal colors in one click. The renderer paints only values CSS parses as colors, checks every text/surface pair, ring and border against the effective set (plugin values over this mode's built-ins) and repeats until nothing changes, so dropping one pair cannot expose another. The applied theme is cached with its id and revision, painted before first render, and dropped as soon as settings show it no longer applies. Main bounds the new settings on every write and load, and uninstalling a plugin clears its theme choices and palette copies. Terminal themes appear under Plugins in the picker with the plugin's name and are passed to lookups instead of read from a store. * plugins: type the theme settings normalizer input; let the store own its normalization * fix(plugins): check text contrast on the editor surface and clear terminal overrides when adopting a theme's terminal colors * fix(plugins): reject theme colors the canvas probe silently ignores
1.8 KiB
1.8 KiB
Plugin themes
Plugins contribute three kinds of theme through orca-plugin.json contributes:
themes (app colors), terminalThemes (an ANSI palette) and, separately, icon themes.
Each entry is { "id", "label", "path" } pointing at a JSON file of at most 16 KiB.
App themes
{ "base": "dark", "tokens": { "--background": "#1b1430", "--foreground": "#e8e0ff" } }
base(lightordark) becomes the app's light/dark mode while the theme is selected.--backgroundand--foregroundare required. Every other public token is optional; an omitted token is derived from the ones you set (cards and sidebars from--background, text from--foreground, sidebar accents from--accent, rings from--primary, and so on), so a two-token theme still colors the whole app.- The public tokens are
PLUGIN_APP_THEME_TOKENSinsrc/shared/plugins/plugin-theme-artifact.ts. Other variables cannot be set. - Values must be colors: hex, a color function (
rgb,hsl,oklch, …) or a color name.transparent,currentColor, CSS-wide keywords, lengths,calc(),var()andurl()are refused. - Each text/surface pair (for example
--background/--foreground,--primary/--primary-foreground) must be opaque with at least 4.5:1 contrast; a pair that fails is dropped and keeps Orca's built-in colors. - Trust and approval dialogs always use Orca's own colors, whatever theme is active.
Terminal themes
{ "schemaVersion": 1, "mode": "dark", "terminal": { "background": "#1b1430", "foreground": "#e8e0ff", "red": "#ff6b8b" } }
Colors are hex. A palette needs background, foreground and at least one ANSI color. When a
user selects it, Orca saves a copy of the palette in settings so hosts, headless servers and
relays answer terminal color queries without the plugin loaded.