Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ zeron/
rpc/ zeron-rpc # UiRpc/ControlRpc: typed req/resp/stream over WS (tokio-
# tungstenite) + in-memory transport; device-room virtual
# sockets ({s,k,to,from} frames)
theme/ zeron-theme # source-neutral theme schema + built-in/custom registry,
# validation, provenance, and local VS Code compiler
ui/ zeron-ui # gpui app: shell, sidebar, conversation, composer,
# terminal view, diff pane, settings, animation kit
apps/
Expand Down Expand Up @@ -199,8 +201,13 @@ feature spec `docs/research/feature-inventory.md` §1.
ease-out width/height transitions for sidebar/panes, sidebar-resort **slide animation**
(we own the list, so animate row positions directly — the View Transitions equivalent, 260ms
cubic-bezier(0.22,1,0.36,1)), reduced-motion switch.
- **Theme**: always-dark monochrome, oklch-derived neutral scale precomputed to Hsla, hairline
borders, Geist/Geist Mono bundled fonts.
- **Theme**: independent light/dark resolved variants, theme-owned semantic/syntax/terminal
palettes, optional interaction-accent overlays, and a device-local surface preference that
resolves each variant's recommended frost/opaque treatment without changing theme selection.
Forced frost derives contrast-checked tints from mapped theme surfaces. Local VS Code
file/package compilation and imported/linked custom families retain last-known-good
persistence. Colors remain paint-only; hairline borders and bundled Geist/Geist Mono remain
shared presentation foundations.

## 5. Engine plan

Expand Down
21 changes: 21 additions & 0 deletions CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Domain context

## Theme vocabulary

- **Theme family** — A named collection of related theme variants that share an origin, such as Night Owl and Night Owl Light.
- **Theme variant** — One complete, resolved palette for a single appearance (`light` or `dark`). Runtime UI consumes variants, not source-format tokens.
- **Theme source** — The durable origin of a custom family: an imported snapshot, linked file, linked package, or editable native file.
- **Imported snapshot** — A self-contained copy of a compiled theme family. It no longer follows changes to its original source.
- **Linked theme** — A custom family that follows a source on disk and can be reloaded without re-importing it.
- **Linked file** — A link to one VS Code-compatible theme definition.
- **Linked package** — A link to a VS Code extension folder or `package.json` that declares one or more related theme variants.
- **Editable theme** — A duplicate stored as a native resolved-family JSON file. Users edit the file directly and explicitly reload it; invalid edits preserve the last known good family.
- **Last known good** — The most recent successfully compiled family retained by a linked theme when its current source is missing or invalid.
- **Import report** — A per-variant summary of mapped roles, fallbacks, unsupported values, and inferred decisions produced during compilation.
- **Mapping review** — The optional advanced view of an import report. Normal theme selection and import do not expose token names.
- **Theme hardening** — Deterministic post-mapping repairs that prefer stronger semantically related source colors, minimally adjust only shared Zeron roles when needed, and record every decision in the mapping review.
- **Theme default accent** — The interaction accent chosen or inferred for a theme variant by its authoring source.
- **Accent override** — A Zeron preset that replaces interaction roles only; syntax, terminal ANSI, diff, warning, error, and success colors remain owned by the theme.
- **Recommended surface treatment** — A theme variant's authored recommendation for whether its surfaces are frosted or opaque. It is used only when the user keeps the surface preference at theme default.
- **Surface preference** — A device-local choice of theme default, frosted, or opaque that is independent of appearance, theme, and accent selections.
- **Resolved surface treatment** — The effective frosted or opaque treatment produced by applying the surface preference to the active variant's recommendation.
60 changes: 60 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
resolver = "2"
members = [
"crates/theme",
"crates/proto",
"crates/doc",
"crates/sync",
Expand Down Expand Up @@ -29,6 +30,7 @@ zeron-rpc = { path = "crates/rpc" }
zeron-update = { path = "crates/update" }
zeron-ui = { path = "crates/ui" }
zeron-syntax = { path = "crates/syntax" }
zeron-theme = { path = "crates/theme" }

# CRDT
loro = "1.13"
Expand Down Expand Up @@ -81,6 +83,8 @@ async-trait = "0.1"
# serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
json5 = "0.4"
plist = "1"
uuid = { version = "1", features = ["v4", "serde"] }

# storage
Expand Down
76 changes: 76 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,79 @@ queries are consumed from the pinned Rust crates listed in `Cargo.lock`.
| Tree-sitter TOML, Markdown, YAML, Kotlin, Swift, SQL, Lua, Nix, Make and Containerfile grammars and queries | pinned in `Cargo.lock` | MIT-compatible; see each crate | Crate repositories recorded in `Cargo.lock` |

The full Zeron distribution remains licensed under the terms in `LICENSE`.

## Bundled theme palette adaptations

Zeron includes manually curated palette adaptations derived from the projects
below. The source repository and exact audited revision are also embedded in
each resolved theme variant. These projects are not affiliated with or endorsed
by Zeron. Their names identify the corresponding palette adaptations.

| Theme project | Audited revision | License and upstream notice |
| --- | --- | --- |
| Visual Studio Code Dark+/Light+ | `e33d147d4c0fa65ce17cb73ec9d798f064b4bf1f` | [MIT](https://github.com/microsoft/vscode/blob/e33d147d4c0fa65ce17cb73ec9d798f064b4bf1f/LICENSE.txt) |
| Catppuccin for VS Code | `befc9e6fc41980f4241408f7049755d47c06ff45` | [MIT](https://github.com/catppuccin/vscode/blob/befc9e6fc41980f4241408f7049755d47c06ff45/LICENSE) |
| Tokyo Night VS Code Theme | `7c0f11eaef322f293621ca7befe462214b7ea468` | [MIT](https://github.com/tokyo-night/tokyo-night-vscode-theme/blob/7c0f11eaef322f293621ca7befe462214b7ea468/LICENSE.txt) |
| Dracula for Visual Studio Code | `1b9ecf4d7e0c8cc2e2e890a7a41ad1db5fff1e6c` | [MIT](https://github.com/dracula/visual-studio-code/blob/1b9ecf4d7e0c8cc2e2e890a7a41ad1db5fff1e6c/LICENSE) |
| GitHub VS Code Theme | `cd78e5e4e7bcf132a6f428ae0f32264bb1b729cf` | [MIT](https://github.com/primer/github-vscode-theme/blob/cd78e5e4e7bcf132a6f428ae0f32264bb1b729cf/LICENSE) |
| Ayu for VS Code | `444ef92911cb75c3933c8003e3a7c79b6b6c914f` | [MIT](https://github.com/ayu-theme/vscode-ayu/blob/444ef92911cb75c3933c8003e3a7c79b6b6c914f/LICENSE) |
| Gruvbox Theme | `ca3b8ad203e84a884ca33fb84b5795cf43032709` | [MIT](https://github.com/jdinhify/vscode-theme-gruvbox/blob/ca3b8ad203e84a884ca33fb84b5795cf43032709/LICENSE) |
| Rosé Pine for VS Code | `d8f5ebe8e096fa833e997c07eb7685ee1677a4ba` | [MIT](https://github.com/rose-pine/vscode/blob/d8f5ebe8e096fa833e997c07eb7685ee1677a4ba/LICENSE) |
| Nord Visual Studio Code | `8ead09822c02d0d49d0f764104505e5a34d3689f` | [MIT](https://github.com/nordtheme/visual-studio-code/blob/8ead09822c02d0d49d0f764104505e5a34d3689f/license) |
| One Dark Pro | `e6ccf638d5b69aa38cd1005edb0ee7ba7ef6fedc` | [MIT](https://github.com/Binaryify/OneDark-Pro/blob/e6ccf638d5b69aa38cd1005edb0ee7ba7ef6fedc/LICENSE.txt) |
| Atom One Dark Theme | `a8be970644982221f9b61fb1c4b3da74b4beab79` | [MIT](https://github.com/akamud/vscode-theme-onedark/blob/a8be970644982221f9b61fb1c4b3da74b4beab79/LICENSE) |
| Night Owl | `cc291eba7976b20d7c66bde6883c27b902196b07` | [MIT](https://github.com/sdras/night-owl-vscode-theme/blob/cc291eba7976b20d7c66bde6883c27b902196b07/LICENSE.md) |
| Winter is Coming | `260547834cb6ac37dd5b8bb5842cc1c8d3164946` | [MIT](https://github.com/johnpapa/vscode-winteriscoming/blob/260547834cb6ac37dd5b8bb5842cc1c8d3164946/LICENSE.md) |
| Palenight Theme | `6291efaace90855abe3d79025327ca41b9a3138c` | [MIT](https://github.com/whizkydee/vscode-palenight-theme/blob/6291efaace90855abe3d79025327ca41b9a3138c/license.md) |
| SynthWave '84 | `ecfa2fe1279f7233663fa3f98a96e6756000567b` | [MIT](https://github.com/robb0wen/synthwave-vscode/blob/ecfa2fe1279f7233663fa3f98a96e6756000567b/LICENSE) |
| Shades of Purple | `e8eb49f33e5db05ceba6677367b33ddb27ad821c` | [MIT text with an additional “With condition” section](https://github.com/ahmadawais/shades-of-purple-vscode/blob/e8eb49f33e5db05ceba6677367b33ddb27ad821c/LICENSE.md); Zeron is MIT-licensed, satisfying the stated condition |
| Cobalt2 | `c4e9574372b85afad1682ed0fdd1ac0411c62512` | [MIT](https://github.com/wesbos/cobalt2-vscode/blob/c4e9574372b85afad1682ed0fdd1ac0411c62512/LICENSE) |
| Andromeda | `d1abb48c69493000aa0133a32d594eb25e523d4f` | [MIT](https://github.com/EliverLara/Andromeda/blob/d1abb48c69493000aa0133a32d594eb25e523d4f/LICENSE.md) |

The palette values are adapted under the corresponding upstream license. The
linked license pages contain each project's copyright and permission notice and
are pinned to the same revision as the adapted source.

Copyright notices retained from those pinned upstream licenses:

- Copyright (c) 2015 - present Microsoft Corporation
- Copyright (c) 2021 Catppuccin
- Copyright (c) 2018-present Enkia
- Copyright (c) 2016 Dracula Theme
- Copyright (c) 2020 Primer
- Copyright (c) 2016 Ike Kurghinyan
- Copyright © 2017 JD
- Copyright (c) 2021 Rosé Pine
- Copyright (c) 2016-present Sven Greb <development@svengreb.de> (https://www.svengreb.de)
- Copyright (c) 2013-2022 Binaryify
- Copyright (c) 2015 Mahmoud Ali
- Copyright (c) 2018 Sarah Drasner
- Copyright (c) 2015-2017 JohnPapa.net, LLC
- Copyright (c) 2017-present Olaolu Olawuyi
- Copyright (c) 2019 Robb Owen
- Copyright (c) 2015-∞ Ahmad Awais
- Copyright (c) 2018 Wes Bos, Roberto Achar
- Copyright (c) 2017 <eliverlara@gmail.com>

The common MIT permission notice for the adaptations above follows:

> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the “Software”), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.

The pinned Shades of Purple license additionally says that anything built with
it should also be MIT licensed. Zeron is distributed under MIT terms.
19 changes: 19 additions & 0 deletions crates/theme/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "zeron-theme"
version.workspace = true
edition.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]
anyhow.workspace = true
clap.workspace = true
json5.workspace = true
plist.workspace = true
serde.workspace = true
serde_json.workspace = true
sha2.workspace = true
thiserror.workspace = true

[dev-dependencies]
tempfile.workspace = true
68 changes: 68 additions & 0 deletions crates/theme/src/bin/zeron-theme-import.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
use std::fs;
use std::path::PathBuf;

use anyhow::{Context as _, Result};
use clap::{Parser, ValueEnum};
use zeron_theme::Appearance;
use zeron_theme::vscode::{ImportOptions, import_file};

#[derive(Debug, Clone, Copy, ValueEnum)]
enum AppearanceArg {
Dark,
Light,
}

impl From<AppearanceArg> for Appearance {
fn from(value: AppearanceArg) -> Self {
match value {
AppearanceArg::Dark => Self::Dark,
AppearanceArg::Light => Self::Light,
}
}
}

/// Convert a VS Code JSON/JSONC color theme into a complete Zeron theme draft.
#[derive(Debug, Parser)]
struct Args {
#[arg(long)]
input: PathBuf,
#[arg(long)]
output: PathBuf,
#[arg(long)]
report: PathBuf,
#[arg(long)]
id: String,
#[arg(long)]
family_id: String,
#[arg(long)]
name: String,
#[arg(long, value_enum)]
appearance: AppearanceArg,
#[arg(long)]
source_url: String,
#[arg(long)]
revision: String,
#[arg(long)]
license: String,
}

fn main() -> Result<()> {
let args = Args::parse();
let imported = import_file(
&args.input,
ImportOptions {
id: args.id,
family_id: args.family_id,
name: args.name,
appearance: args.appearance.into(),
source_url: args.source_url,
revision: args.revision,
license: args.license,
},
)?;
fs::write(&args.output, serde_json::to_vec_pretty(&imported.theme)?)
.with_context(|| format!("could not write {}", args.output.display()))?;
fs::write(&args.report, serde_json::to_vec_pretty(&imported.report)?)
.with_context(|| format!("could not write {}", args.report.display()))?;
Ok(())
}
Loading