diff --git a/Cargo.lock b/Cargo.lock index c62fcb0..72979a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -548,7 +548,7 @@ dependencies = [ [[package]] name = "canvas-pilot" -version = "0.9.42" +version = "0.9.43" dependencies = [ "base64", "craft-dwg", diff --git a/Cargo.toml b/Cargo.toml index f659fa8..5ae637e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["crates/canvas-pilot"] resolver = "3" [workspace.package] -version = "0.9.42" +version = "0.9.43" edition = "2024" license = "MIT" repository = "https://proxy.dandaedre.com/gitea/idle-org/canvas-pilot" diff --git a/crates/canvas-pilot/src/theme_packs.rs b/crates/canvas-pilot/src/theme_packs.rs index e7d1c30..6c7f349 100644 --- a/crates/canvas-pilot/src/theme_packs.rs +++ b/crates/canvas-pilot/src/theme_packs.rs @@ -357,7 +357,7 @@ pub fn install(ctx: &egui::Context, directory: &Path, source: &Path) -> Result<( mod tests { use super::*; use crate::theme::Theme; - const EXAMPLES: [(&str, &[u8], &str); 4] = [ + const EXAMPLES: [(&str, &[u8], &str); 5] = [ ( "tokyo-night", include_bytes!("../../../docs/theme-packs/tokyo-night.zip"), @@ -378,6 +378,11 @@ mod tests { include_bytes!("../../../docs/theme-packs/vivid-world.zip"), include_str!("../../../docs/theme-packs/vivid-world/manifest.json"), ), + ( + "ravenswatch", + include_bytes!("../../../docs/theme-packs/ravenswatch.zip"), + include_str!("../../../docs/theme-packs/ravenswatch/manifest.json"), + ), ]; fn zip(files: &[(&str, &[u8])]) -> Vec { let mut zip = zip::ZipWriter::new(std::io::Cursor::new(Vec::new())); @@ -446,13 +451,13 @@ mod tests { } } } - assert_eq!(choices(&ctx).len(), 4); + assert_eq!(choices(&ctx).len(), EXAMPLES.len()); let restarted = egui::Context::default(); assert!(load(&restarted, &packs).is_empty()); assert_eq!(choices(&restarted), choices(&ctx)); let isolated = egui::Context::default(); assert!(choices(&isolated).is_empty()); - let missing = Theme::Pack("vivid-world/default".into()); + let missing = Theme::Pack("ravenswatch/default".into()); missing.apply(&isolated); assert_eq!(Theme::current(&isolated), missing); assert_eq!( diff --git a/docs/canvas-pilot/changelog.md b/docs/canvas-pilot/changelog.md index 50a0d87..6a1ad15 100644 --- a/docs/canvas-pilot/changelog.md +++ b/docs/canvas-pilot/changelog.md @@ -4,6 +4,13 @@ ## Unreleased +### v0.9.43 + +- Added a standalone Ravenswatch palette with midnight-blue surfaces, aged ivory + text and crimson accents inspired by the supplied reference. Kept the existing + 16-theme collection unchanged at the version-1 limit; packaging now lists its + members explicitly. Added import/contrast and collection membership checks. + ### v0.9.42 - Replaced the distributed Minecraft palette with Vivid World: midnight navy, diff --git a/docs/canvas-pilot/guide/theme-packs.md b/docs/canvas-pilot/guide/theme-packs.md index 2307c53..bfe56b1 100644 --- a/docs/canvas-pilot/guide/theme-packs.md +++ b/docs/canvas-pilot/guide/theme-packs.md @@ -12,17 +12,19 @@ appears in **More themes…** and recent themes. The picker stays open while you try alternatives. Selecting **High Contrast** twice returns to your last theme, including an installed one. -Download [extra-themes.zip](../../theme-packs/extra-themes.zip) to install **all -16 themes in one operation**. It is a single pack: select **extra-themes** in the +Download [extra-themes.zip](../../theme-packs/extra-themes.zip) to install **16 themes in one operation**. It is a single pack: select **extra-themes** in the manager and scroll its contents to try each palette. Removal or replacement applies to the whole collection. Individual packs remain available below; installing both -keeps separate copies, so you only need one option. +keeps separate copies, so you only need one option for those themes. +**Ravenswatch** is available separately: the collection is at the version-1 limit +of 16 themes. Install its standalone ZIP alongside the collection. | Pack | Palette | Editable manifest | | --- | --- | --- | | [Tokyo Night](../../theme-packs/tokyo-night.zip) | Dark blue with cool cyan accents | [manifest.json](../../theme-packs/tokyo-night/manifest.json) | | [Catppuccin Mocha](../../theme-packs/catppuccin.zip) | Soft charcoal and pastel accents | [manifest.json](../../theme-packs/catppuccin/manifest.json) | | [Detroit: Become Human](../../theme-packs/detroit-become-human.zip) | Deep blue, pale text and cyan android-inspired accents | [manifest.json](../../theme-packs/detroit-become-human/manifest.json) | +| [Ravenswatch](../../theme-packs/ravenswatch.zip) | Midnight blue, ivory and crimson (standalone) | [manifest.json](../../theme-packs/ravenswatch/manifest.json) | | [Vivid World](../../theme-packs/vivid-world.zip) | Midnight navy, violet, pink and cyan crystal accents | [manifest.json](../../theme-packs/vivid-world/manifest.json) | | [Deep Rock Galactic](../../theme-packs/deep-rock-galactic.zip) | Dark, gold/molten-orange accents | [manifest.json](../../theme-packs/deep-rock-galactic/manifest.json) | | [Dispatch](../../theme-packs/dispatch.zip) | Dark, yellow/cyan accents | [manifest.json](../../theme-packs/dispatch/manifest.json) | @@ -40,7 +42,7 @@ keeps separate copies, so you only need one option. Tokyo Night adapts the [upstream palette](https://github.com/folke/tokyonight.nvim), and Catppuccin uses [Mocha colors](https://catppuccin.com/palette/). Their license notices travel inside the ZIP and can be viewed under **Attribution and licenses**. -The Detroit, Vivid World, Dispatch, Helldivers and Deep Rock Galactic themes are +The Detroit, Vivid World, Ravenswatch, Dispatch, Helldivers and Deep Rock Galactic themes are original, unofficial color interpretations; they include no game artwork, fonts or code and are not endorsed by the games' owners. diff --git a/docs/interfaces/theme-packs.md b/docs/interfaces/theme-packs.md index 229c046..3d2b954 100644 --- a/docs/interfaces/theme-packs.md +++ b/docs/interfaces/theme-packs.md @@ -104,9 +104,9 @@ the importer continues to accept both stored and DEFLATE-compressed packs. ## Bundled collection `docs/theme-packs/extra-themes.zip` is a normal version-1 pack (`extra-themes`, -revision 4), containing all 16 distributed themes. One import validates and installs +revision 4), containing 16 curated themes. One import validates and installs all entries atomically; it does not unpack nested ZIPs. The build script combines -individual manifests in sorted path order, prefixes theme IDs with their source +the explicitly listed collection manifests in sorted path order, prefixes theme IDs with their source pack ID and preserves all notices. Individual packs and the collection have distinct saved choices and can coexist. Updates and removal operate on the whole collection. @@ -114,3 +114,7 @@ Collection revision 4 replaces `minecraft-overworld` with `vivid-world-default`. Updating while Minecraft is active uses the existing removed-theme fallback to Midra Dark; Vivid World can then be selected explicitly. Older standalone Minecraft installations are not deleted or remapped by this collection update. + +Ravenswatch is a separate version-1 pack, not a seventeenth collection entry. +The build script validates every standalone archive and requires every listed +collection manifest; adding a standalone pack does not change collection contents. diff --git a/docs/theme-packs/ravenswatch.zip b/docs/theme-packs/ravenswatch.zip new file mode 100644 index 0000000..e62d03a Binary files /dev/null and b/docs/theme-packs/ravenswatch.zip differ diff --git a/docs/theme-packs/ravenswatch/manifest.json b/docs/theme-packs/ravenswatch/manifest.json new file mode 100644 index 0000000..0f8e890 --- /dev/null +++ b/docs/theme-packs/ravenswatch/manifest.json @@ -0,0 +1,32 @@ +{ + "version": 1, + "id": "ravenswatch", + "revision": 1, + "themes": [ + { + "id": "default", + "name": "Ravenswatch", + "light": false, + "colors": { + "canvas": "#161b2a", + "banner": "#30252d", + "grid": "#626779", + "layer": "#3b2834", + "pattern": [ + "#3b2834", + "#252d40" + ], + "bg": "#10121f", + "panel": "#191d2a", + "field": "#262b3a", + "line": "#626779", + "text": "#f5edcf", + "muted": "#c5c1ae", + "cyan": "#e5d9a0", + "amber": "#f06b68", + "purple": "#782533" + } + } + ], + "notices": "Original Canvas Pilot palette inspired by the supplied Ravenswatch title-art reference: midnight blue, aged ivory and crimson. Unofficial; no game artwork, fonts, logos or code included. Not affiliated with or endorsed by the game owners. Palette provided under the Canvas Pilot MIT license." +} diff --git a/scripts/build-theme-packs.py b/scripts/build-theme-packs.py index 4ddd2ec..4ffa0c7 100644 --- a/scripts/build-theme-packs.py +++ b/scripts/build-theme-packs.py @@ -7,6 +7,13 @@ import json import zipfile ROOT = Path(__file__).resolve().parents[1] +# Curated v1 collection: new standalone packs must not silently replace its entries. +COLLECTION_PACKS = frozenset({ + 'catppuccin', 'deep-rock-galactic', 'detroit-become-human', 'dispatch', + 'dracula', 'github-dark', 'github-light', 'gruvbox-dark', 'helldivers', + 'monokai', 'nord', 'one-dark', 'solarized-dark', 'solarized-light', + 'tokyo-night', 'vivid-world', +}) def archive(manifest): @@ -23,6 +30,9 @@ def archive(manifest): def collection(sources): """One normal v1 pack: the existing importer installs every contained theme.""" + sources = [source for source in sources if source.parent.name in COLLECTION_PACKS] + if {source.parent.name for source in sources} != COLLECTION_PACKS: + raise ValueError('A required collection manifest is missing') themes = [] notices = [] for source in sorted(sources): diff --git a/tests/test_theme_packs.py b/tests/test_theme_packs.py index c46fa12..7a99cca 100644 --- a/tests/test_theme_packs.py +++ b/tests/test_theme_packs.py @@ -30,7 +30,7 @@ class ThemePackExamples(unittest.TestCase): def test_archives_match_sources_and_rebuild_exactly(self): manifests = list((ROOT / 'docs/theme-packs').glob('*/manifest.json')) - self.assertEqual(len(manifests), 16) + self.assertEqual(len(manifests), 17) for source in manifests: with self.subTest(pack=source.parent.name): expected = source.parent.with_suffix('.zip').read_bytes() @@ -39,7 +39,7 @@ class ThemePackExamples(unittest.TestCase): self.assertEqual(archive.namelist(), ['manifest.json']) self.assertEqual(archive.read('manifest.json'), source.read_bytes()) - def test_collection_contains_every_theme_and_notice(self): + def test_collection_contains_curated_themes_and_notices(self): sources = list((ROOT / 'docs/theme-packs').glob('*/manifest.json')) data = module.collection(sources) self.assertEqual(data, module.collection(reversed(sources))) @@ -48,8 +48,16 @@ class ThemePackExamples(unittest.TestCase): self.assertEqual(combined['id'], 'extra-themes') self.assertEqual(len(combined['themes']), 16) self.assertEqual(len({t['id'] for t in combined['themes']}), 16) + self.assertNotIn('ravenswatch-default', {t['id'] for t in combined['themes']}) for source in sources: + if source.parent.name not in module.COLLECTION_PACKS: + continue manifest = json.loads(source.read_bytes()) self.assertIn(manifest['notices'], combined['notices']) for theme in manifest['themes']: self.assertIn({**theme, 'id': manifest['id'] + '-' + theme['id']}, combined['themes']) + + def test_missing_collection_manifest_is_rejected(self): + sources = list((ROOT / 'docs/theme-packs').glob('*/manifest.json')) + with self.assertRaisesRegex(ValueError, 'required collection manifest'): + module.collection(source for source in sources if source.parent.name != 'dispatch')