Commit Graph
2429 Commits
Author SHA1 Message Date
LGUG2Z 5763df9f73 feat(config): the platform table, read from the markers of the one StaticConfig
platforms::reads(platform, key) says whether a platform reads a top-level key and platforms::unsupported_keys(raw, platform) lists the keys of a configuration text that are keys of komorebi.json but that the platform does not read, which is what a daemon can say at load time instead of dropping them silently. The table is the x-komorebi-platforms markers themselves, so a key cannot be added without saying who reads it. The daemons do not call it yet: reporting at load time is a visible change of behaviour for the user's decision.

The oracle test checks the table against the three checked-in schemas (every key of a tree's schema.json is read by that platform) and on examples.

Verified: native cargo test -p komorebi-config: 4 unit + 9 schemas + 1 doctest passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z 657360d358 refactor(windows): use StaticConfig and its family of komorebi-config
static_config re-exports StaticConfig, WorkspaceConfig, MonitorConfig, BorderColours, ThemeOptions, Wallpaper, AnimationsConfig, AppSpecificConfigurationPath, TabsConfig and StackbarConfig from komorebi-config and loses their definitions, the end_of_life/aliases/deprecated notices and read_raw/read (about 650 lines). The inherent impl StaticConfig cannot stay in the daemon (orphan rule): apply_globals is a private trait (ApplyGlobals) and preload, postload and reload are the public extension trait StaticConfigExt, bodies unchanged; process_command, window_manager and main import the trait (komorebic only calls read and the notices, which are inherent in the crate, so it is untouched). The From<&WindowManager> and From<&Monitor> conversions fill the keys Windows never writes (border_radius, titleless_applications, tabbed_applications, window_hiding_position) with None or Default. The five #[deprecated] attributes of the old fields are gone (the schema marker replaced them; see the crate).

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2); the oracle test proves the Windows view of this StaticConfig equals schema.json byte for byte. Not verified: Windows unit tests (cannot run), running komorebic.exe or the daemon.
2026-10-31 01:37:54 -07:00
LGUG2Z 15e6498a9e refactor(windows): use the placement types of komorebi-config
core re-exports WindowPlacement, PlacementTarget, PlacementMatchingRules and InitialWindowPlacementRules from komorebi-config and loses the local definitions and impls (about 230 lines) with the imports they alone needed. PlacementTarget is now the crate's copy (the KDE one): it parses the same values (a name, a number, or numeric text) and only the wording of its error for a bad value differs; the schema text Windows checked in for it is part of the Windows view of komorebi-config (changes.rs), which printing already uses.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2). Not verified: Windows unit tests (cannot run).
2026-10-31 01:37:54 -07:00
LGUG2Z 93e4d51108 refactor(mac): use StaticConfig and its family of komorebi-config
static_config re-exports StaticConfig, WorkspaceConfig, MonitorConfig, BorderColours, ThemeOptions, Wallpaper, AnimationsConfig and AppSpecificConfigurationPath from komorebi-config and loses their definitions, read_raw and read (about 410 lines). The inherent impl StaticConfig cannot stay in the daemon (orphan rule): apply_globals is a private trait (ApplyGlobals) and preload, postload and reload are the public extension trait StaticConfigExt (the macOS preload keeps its run_loop parameter), bodies unchanged; process_command, window_manager and main import the trait. The From conversions stay and fill the keys macOS never writes with None or Default.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: finished, 0 errors, no warnings in komorebi (tier 2). Not verified: macOS unit tests (cannot run), running komorebic.
2026-10-31 01:37:54 -07:00
LGUG2Z 857e14320e refactor(kde): use StaticConfig and its family of komorebi-config
static_config re-exports StaticConfig, WorkspaceConfig, MonitorConfig, BorderColours, ThemeOptions, Wallpaper, AnimationsConfig and AppSpecificConfigurationPath from komorebi-config and loses their definitions, read_raw and read (about 480 lines). The inherent impl StaticConfig can no longer exist in the daemon (orphan rule): its apply_globals is a private trait (ApplyGlobals) and preload, postload and reload are the public extension trait StaticConfigExt, with the bodies unchanged; callers import the trait (process_command, window_manager, main and the integration tests that call StaticConfig::preload, postload or reload: one added use line each, no assertion touched). The From<&WindowManager> and From<&Workspace> conversions stay (a reference to a local type is local) and fill the keys KDE never writes with None or Default.

Two places read the schema of StaticConfig to know which keys are read; the one type now carries every platform's keys, so they ask for the KDE view: the unknown-key diagnostic (check.rs known_keys) and the test config_parity (keys_that_are_read: only its source of the key list changed, the assertions are the same).

Verified: KDE cargo test --workspace --no-fail-fast -- --test-threads=1: 876 passed, 0 failed, 80 binaries (baseline 891: 4 unit tests moved to komorebi-config with the matching types, doc tests 45 -> 41 as examples moved; the other 7 are not itemised); komorebic static-config-schema and application-specific-configuration-schema byte-identical to the checked-in files. Windows and macOS untouched by this revision.
2026-10-31 01:37:54 -07:00
LGUG2Z f605a555e7 refactor(config): add read, read_raw and the load notices to StaticConfig
read_raw and read are identical in the three daemons (KDE's docs and doctest are taken); end_of_life, aliases and deprecated are the Windows pure string checks that print what a configuration file should change. None of them touches a window manager, so they live next to the type; the daemons' own inherent impls cannot (the orphan rule), they become an extension trait in the wiring revisions.

Verified: native cargo test -p komorebi-config: 4 unit + 8 schemas + 1 doctest passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z 13c0e2faba refactor(themes): make the nine stackbar theme fields unconditional
KomorebiThemeBase16, KomorebiThemeCatppuccin and KomorebiThemeCustom carried stackbar_focused_text, stackbar_unfocused_text and stackbar_background under cfg(target_os = "windows"), so what a Linux or macOS build accepted (and what its schema said) depended on the compile target: a Linux build could not even generate the Windows schema. komorebi-config needs one set of types, so the nine cfg attributes are removed. The KDE and macOS schemas keep their bytes because their views remove the fields again (changes.rs, applied after pruning); the Windows tree is unchanged.

Consequences, all mechanical: the places in KDE and macOS that build a KomorebiThemeCustom, KomorebiThemeCatppuccin or ThemeOptions by name (workspace.rs in both, two KDE tests and a komorebi-client test) now say stackbar_*: None, which keeps what they meant. A KDE or macOS komorebi.json that sets one of the three keys in a theme is now accepted and ignored instead of ignored as an unknown key. The macOS bar's own schema (komorebi-for-mac/schema.bar.json) will gain the three fields when it is next generated; it cannot be regenerated on this host and is left for step 4b, whose per-platform view takes care of it.

The oracle test now compares the Windows view too: all three views of StaticConfig are byte-identical to the checked-in schema.json files (Windows 141169, KDE 127164, macOS 120057 bytes).

Verified: native cargo test -p komorebi-config: 4 unit + 8 schemas passed, 0 failed; Windows cargo clippy --workspace --locked --all-targets -D warnings clean; KDE cargo check --workspace --all-targets clean (after the wallpaper test fix), komorebic output byte-identical to schema.json and schema.asc.json; macOS fake-CC cargo check --workspace --all-targets: 0 errors. Not verified: macOS and Windows unit tests, schema.bar.json of either bar.
2026-10-31 01:37:54 -07:00
LGUG2Z dec9198492 refactor(mac): print the macOS view of the schema of komorebi-config
komorebic static-config-schema and the daemon's StaticConfigSchema answer print schema::view::<StaticConfig>(Platform::CURRENT) of the shared crate instead of the schema derived from the daemon's own StaticConfig; the oracle test proves the macOS view equals schema.json byte for byte.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: finished, 0 errors (tier 2). Not verified: running komorebic or the macOS tests.
2026-10-31 01:37:54 -07:00
LGUG2Z 82ee9dd13a refactor(kde): print the KDE view of the schema of komorebi-config
komorebic static-config-schema and the daemon's StaticConfigSchema answer print schema::view::<StaticConfig>(Platform::CURRENT) of the shared crate instead of the schema derived from the daemon's own StaticConfig.

Verified: KDE cargo check --workspace --all-targets: no warnings; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic static-config-schema and application-specific-configuration-schema: byte-identical to the checked-in schema.json and schema.asc.json (no diff).
2026-10-31 01:37:54 -07:00
LGUG2Z 6cbeee20ae refactor(windows): print the Windows view of the schema of komorebi-config
komorebic static-config-schema prints schema::view::<StaticConfig>(Platform::CURRENT) of the shared crate instead of deriving the schema of the daemon's own StaticConfig: the text is the same, and the oracle test proves the Windows view equals schema.json (once komorebi-themes drops its cfgs, the next revision). The daemon's StaticConfigSchema socket answer (which answers the SocketMessage schema on Windows today) is left alone.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2). Not verified: running komorebic.exe.
2026-10-31 01:37:54 -07:00
LGUG2Z 2200bec995 refactor(config): add the one StaticConfig and its schema views to komorebi-config
static_config.rs holds the union: StaticConfig with all 56 keys and no cfg on a field, BorderColours, ThemeOptions, Wallpaper, WorkspaceConfig, MonitorConfig, AppSpecificConfigurationPath, AnimationsConfig, TabsConfig and StackbarConfig, taken from the Windows text (the superset) plus the KDE/macOS keys (border_radius, titleless_applications, tabbed_applications, window_hiding_position). A key that not every platform reads carries x-komorebi-platforms (22 Windows-only, 5 Windows+KDE, 4 KDE+macOS); the five #[deprecated] attributes became schemars deprecated markers so no daemon gets a deprecation warning for a key it still reads. The schema defaults that read daemon run-time statics are constants in defaults.rs (Windows values).

changes.rs holds what a platform's schema says differently from the union as data: descriptions (spelling and platform sentences), the defaults that are platform facts (paddings 10/5/5, border width 8/10/10, offset -1/0/0, no transparency default on KDE) and the nine komorebi-themes stackbar fields KDE and macOS never had. It was generated from the difference between the union view and each tree's checked-in schema.json; every entry is a candidate for a converge revision. schema::view applies it after pruning.

The oracle test builds the KDE and macOS views of StaticConfig and compares them with schema.json byte for byte: both identical (KDE 127164 bytes, macOS 120057 bytes). Windows is added when komorebi-themes drops its target_os cfgs (a Linux build omits those nine fields). No tree uses the new types yet.

Verified: native cargo test -p komorebi-config: 4 unit + 8 schemas passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z 55c9efb0b2 refactor(kde): use the placement types of komorebi-config
core re-exports WindowPlacement, PlacementTarget, PlacementMatchingRules and InitialWindowPlacementRules from komorebi-config; the local definitions and impls (about 190 lines) are removed together with the imports they alone needed, so no call site changes.

Verified: KDE cargo check --workspace --all-targets: no warnings; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic regeneration: schema.json and schema.asc.json byte-identical to the checked-in files at this revision (no diff).
2026-10-31 01:37:54 -07:00
LGUG2Z b0e4479723 refactor(config): move the placement types into komorebi-config
WindowPlacement, PlacementTarget (with its Display, FromStr, Ord, Serialize, Deserialize and hand-written JsonSchema impls), PlacementMatchingRules and InitialWindowPlacementRules, from the KDE copy: Windows and KDE have identical WindowPlacement, PlacementMatchingRules and InitialWindowPlacementRules, and PlacementTarget differs (Windows accepts the same values through a visitor and writes a different hand-made schema). The KDE copy is the union; Windows' schema text for PlacementTarget is carried as a per-platform difference of the view in the StaticConfig stage, so the Windows tree switches to these types in that stage, not before (switching earlier would change what its own derived schema prints).

The oracle checks the generated definitions of the three enums against Windows and KDE schema.json and PlacementTarget against KDE's.

Verified: native cargo test -p komorebi-config: 4 unit + 7 schemas passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z 04139cce01 refactor(mac): use asc of komorebi-config
core::asc re-exports ApplicationSpecificConfiguration, AscApplicationRules and AscApplicationRulesOrSchema from komorebi-config; the local copy (60 lines) is removed. AscApplicationRules is now the union with the five Windows-only rule kinds, which macOS never sets.

As for KDE, the applications schema is printed and answered as the macOS view of the union (komorebic application-specific-configuration-schema, with the komorebi-config dependency, and the daemon's socket answer), so the printed text stays what schema.asc.json holds; the oracle test compares that view with the checked-in file byte for byte.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: finished, 0 errors (tier 2). Not verified: macOS unit tests, running komorebic.
2026-10-31 01:37:54 -07:00
LGUG2Z 415e73a9ac refactor(kde): use asc of komorebi-config
core::asc re-exports ApplicationSpecificConfiguration, AscApplicationRules and AscApplicationRulesOrSchema from komorebi-config; the local copy (60 lines) is removed. AscApplicationRules is now the union with the five Windows-only rule kinds: KDE only reads and writes its own, the others are None and skipped when written.

A derived schema of the union would carry the Windows-only kinds and the x-komorebi-platforms markers, so the places that print or answer the applications schema ask for the KDE view instead: komorebic (application-specific-configuration-schema; komorebic gains the komorebi-config dependency, a two-line change in the arm) and the daemon's socket answer (same view, array form as before). This is the minimum change to komorebic that keeps its output; step 4 owns the rest of the file.

Verified: KDE cargo check --workspace --all-targets: no warnings; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic regeneration: schema.asc.json byte-identical to the checked-in file (git: no diff against wip-main), schema.json only differs by the earlier description-only converge revisions.
2026-10-31 01:37:54 -07:00
LGUG2Z 2bd0269df6 refactor(windows): use asc and the application configuration data of komorebi-config
core::asc re-exports ApplicationSpecificConfiguration, AscApplicationRules and AscApplicationRulesOrSchema, and config_generation re-exports ApplicationOptions and ApplicationConfiguration, from komorebi-config. The From<Vec<ApplicationConfiguration>> conversion that komorebic uses moved with them (orphan rule). The YAML generator stays. 215 lines removed.

AscApplicationRules is now the union, so komorebic's application-specific-configuration-schema prints the Windows view of it (komorebic gains the komorebi-config dependency; a three-line change in the arm, the minimum that keeps its output equal to schema.asc.json; step 4 owns the rest of the file). The daemon's own socket answer for this message is a different schema (Vec<ApplicationConfiguration>) and is untouched.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2). Not verified: running komorebic.exe; the oracle test proves the Windows view equals schema.asc.json byte for byte.
2026-10-31 01:37:54 -07:00
LGUG2Z 89c729e731 refactor(config): move asc and the application configuration data into komorebi-config
ApplicationSpecificConfiguration, AscApplicationRulesOrSchema and AscApplicationRules are code-identical in the trees except that AscApplicationRules differs in its rule kinds: five Windows-only kinds, titleless and tabbed on KDE and macOS. The crate holds the union (declaration order floating-first as before; the platform-only fields carry x-komorebi-platforms, so a view prunes them) and, for the Windows From<Vec<ApplicationConfiguration>> conversion that the orphan rule keeps next to its types, ApplicationOptions and ApplicationConfiguration (data only: the YAML generator stays in the Windows daemon). The crate gains the color-eyre dependency.

The oracle test builds the view of ApplicationSpecificConfiguration for Windows, KDE and macOS and compares it with each tree's checked-in schema.asc.json byte for byte: all three are identical. This is the first proof that per-platform views of one union reproduce the checked-in files exactly (D17/D18); the three trees still use their own copies.

Verified: native cargo test -p komorebi-config: 4 unit + 6 schemas passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z befbc200d0 feat(config): generate a platform's schema as a view of the union schema
schema::view prunes the schema of a type to what one platform reads: properties whose x-komorebi-platforms list does not name the platform are dropped (and removed from required), the markers are stripped, and the definitions that nothing refers to any more are removed, in the original order. Descriptions that komorebi-protocol writes differently per compile target (ApplicationIdentifier::Class, PathBuf, FocusFollowsMouseImplementation) are set per platform from a table, so a view is the same on every host. The approach is the one of D17/D18; the next revision proves it on the applications schema.

Verified: native cargo test -p komorebi-config compiles (tier 1); exercised by the next revision's test.
2026-10-31 01:37:54 -07:00
LGUG2Z be0e243d04 refactor(mac): use AspectRatio and PerAnimationPrefixConfig of komorebi-config
window and animation re-export the three types from komorebi-config; the local definitions and their imports are removed, so no call site changes.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: finished, 0 errors, no warnings in komorebi (tier 2). Not verified: macOS unit tests.
2026-10-31 01:37:54 -07:00
LGUG2Z 4095f45fd3 refactor(kde): use AspectRatio and PerAnimationPrefixConfig of komorebi-config
window and animation re-export the three types from komorebi-config; the local definitions (82 lines) and their imports are removed, so no call site changes.

Verified: KDE cargo check --workspace --all-targets: no warnings; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic regeneration: schema.json and schema.asc.json byte-identical to the checked-in files.
2026-10-31 01:37:54 -07:00
LGUG2Z 96b706b61c refactor(windows): use AspectRatio and PerAnimationPrefixConfig of komorebi-config
window re-exports AspectRatio and PredefinedAspectRatio and animation re-exports PerAnimationPrefixConfig from komorebi-config; the local definitions are removed (87 lines) with the imports they needed, so no call site changes. cargo fmt also drops two stray blank lines left by the previous revision in border_manager and core.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2). schema.json untouched.
2026-10-31 01:37:54 -07:00
LGUG2Z 44e0b32459 refactor(config): move AspectRatio and PerAnimationPrefixConfig into komorebi-config
AspectRatio and PredefinedAspectRatio (with the Default and width_and_height impls) and the generic PerAnimationPrefixConfig<T> have identical code in the three trees and, after the previous converge revisions, identical docs; the crate takes the Windows copy. The trees keep their copies until the next revisions.

The oracle gains a check that the generated AspectRatio and PredefinedAspectRatio definitions equal those of all three checked-in schema.json files. PerAnimationPrefixConfig has no check of its own: its definitions are numbered per instantiation, so the AnimationsConfig move covers it.

Verified: native cargo test -p komorebi-config: 4 unit + 5 schemas passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z 7ebead10aa refactor(mac): converge the docs of AspectRatio to the Windows text
Same two variant docs as in the KDE revision before: 'A predefined aspect ratio' and 'A custom W:H aspect ratio' become the Windows 'Predefined aspect ratio' and 'Custom W:H aspect ratio'.

Schema: komorebi-for-mac/schema.json cannot be regenerated on this host, so the two description lines were edited to the text of the doc comments; the file equals the old one after deleting every description (jq walk), so description-only. The next revisions compare the generated definitions of the shared crate with this file.

Verified: jq description-only comparison (4 changed lines). Doc comments only: no compile needed, not run.
2026-10-31 01:37:54 -07:00
LGUG2Z cc02f57a7c refactor(kde): converge the docs of AspectRatio to the Windows text
The two variant docs said 'A predefined aspect ratio' and 'A custom W:H aspect ratio' in KDE and macOS and 'Predefined aspect ratio' and 'Custom W:H aspect ratio' in Windows; the code of AspectRatio and PredefinedAspectRatio is identical in all three trees, so the docs are what stops one shared copy.

Schema: komorebi-for-kde/schema.json regenerated with the real komorebic: 2 description lines change, and the file equals the old one after deleting every description (jq walk), so description-only. schema.asc.json unchanged.

Verified: KDE komorebic build and regeneration (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z d2a975aa0a refactor(mac): use the behaviour enums of komorebi-config
core re-exports WindowContainerBehaviour, FloatingLayerBehaviour, Placement, CrossBoundaryBehaviour and WindowHidingPosition from komorebi-config; the local definitions and impls are removed, so no call site changes.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: finished, 0 errors, no new warnings (tier 2). Not verified: macOS unit tests.
2026-10-31 01:37:54 -07:00
LGUG2Z 5dc1fe0b4c refactor(kde): use the behaviour enums of komorebi-config
core re-exports WindowContainerBehaviour, FloatingLayerBehaviour, Placement, CrossBoundaryBehaviour and WindowHidingPosition from komorebi-config; the local definitions and impls are removed, so no call site changes.

Verified: KDE cargo check --workspace --all-targets clean; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic static-config-schema and application-specific-configuration-schema regenerated: schema.json and schema.asc.json unchanged (byte-identical, no diff).
2026-10-31 01:37:54 -07:00
LGUG2Z 92adaf72fa refactor(windows): use the behaviour enums of komorebi-config
core re-exports WindowContainerBehaviour, FloatingLayerBehaviour, Placement, CrossBoundaryBehaviour and WindowHandlingBehaviour, and border_manager re-exports ZOrder, from komorebi-config; the local definitions and their impls (including From<ZOrder> for isize, which the orphan rule requires to move with the type) are removed, so no call site changes.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2). schema.json untouched.
2026-10-31 01:37:54 -07:00
LGUG2Z 79c9af95d1 refactor(config): move the behaviour enums into komorebi-config
WindowContainerBehaviour, FloatingLayerBehaviour (with should_float), Placement (with should_center and should_resize), CrossBoundaryBehaviour, WindowHidingPosition (KDE and macOS), WindowHandlingBehaviour and ZOrder (with its From<ZOrder> for isize; Windows) in behaviour.rs. The text is the KDE copy for the five that all trees share (identical to the Windows and macOS copies after the previous converge revision) and the Windows copy for the two Windows-only enums. A platform-only enum is defined here without a cfg: the daemon that does not read the key says so at load time. The trees keep their copies until the next revisions. The crate gains the clap dependency (ValueEnum) and the three Cargo.lock files the package entry.

The oracle gains a check that the generated definition of each enum equals the $defs entry of every checked-in schema.json that has it (all three trees for four of them, KDE and macOS for WindowHidingPosition, Windows for the other two).

Verified: native cargo test -p komorebi-config: 4 unit + 4 schemas passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z aa78347add refactor(kde): converge the docs of the core behaviour enums to the Windows spelling
WindowContainerBehaviour, FloatingLayerBehaviour, Placement, CrossBoundaryBehaviour and WindowPlacement said 'behavior' in KDE and 'behaviour' in Windows and macOS (the doc text is otherwise identical), so one copy in komorebi-config can be moved only after they agree. Same choice as the step 2 payload enums.

Schema: komorebi-for-kde/schema.json regenerated with the real komorebic (5 description lines, 10 changed lines); equal to the old file after deleting every description (jq walk), so description-only. schema.asc.json is unchanged. Windows and macOS schemas are untouched (they already said 'behaviour').

Verified: KDE cargo build -p komorebic and regeneration (tier 1). Not done: komorebi-for-kde/nix/komorebi-options.nix still carries the old text and an old schema-sha256 header (already out of date since step 2); no schemars-nixgen here, refreshed by substitution at the end of the step.
2026-10-31 01:37:54 -07:00
LGUG2Z 5b7e769207 refactor(mac): use the matching types of komorebi-config
komorebi depends on komorebi-config (workspace dependency with the schemars feature, like komorebi-protocol) and core::config_generation re-exports the five matching types from it, so no call site changes. 84 duplicated lines are removed. Cargo.lock gains the komorebi-config package.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: finished, 0 errors (tier 2, type-check only). Not verified: macOS unit tests (cannot run).
2026-10-31 01:37:54 -07:00
LGUG2Z 6c44f62787 refactor(kde): use the matching types of komorebi-config
komorebi depends on komorebi-config (workspace dependency with the schemars feature, like komorebi-protocol) and core::config_generation re-exports the five matching types from it, so no call site changes. 159 lines are removed: the five types and, with them, the four unit tests that now run in the crate.

Verified: KDE cargo check --workspace --all-targets: clean; cargo test -p komorebi --lib: 289 passed, 0 failed (was 293 before: the 4 tests moved to komorebi-config); --test rules, transparency, rule_commands: 6, 1, 6 passed. Full workspace test run follows at the end of the stage.
2026-10-31 01:37:53 -07:00
LGUG2Z dc0b9751a5 refactor(windows): use the matching types of komorebi-config
komorebi depends on komorebi-config and core::config_generation re-exports MatchingRule, WorkspaceMatchingRule, IdWithIdentifier, MatchingStrategy and IdWithIdentifierAndComment from it, so no call site changes. The 84 duplicated lines (five types and the From impl) are removed; ApplicationOptions, ApplicationConfiguration and the generator stay.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2, persistent target). Schema files untouched.
2026-10-31 01:37:53 -07:00
LGUG2Z 504290e5a8 refactor(config): move the matching types into komorebi-config
MatchingRule, WorkspaceMatchingRule, IdWithIdentifier, MatchingStrategy and IdWithIdentifierAndComment (with the From impl) are byte-identical, docs included, in config_generation.rs of the three trees apart from imports. The crate takes the KDE copy (module docs and its four tests) with ApplicationIdentifier from komorebi-protocol. The trees still carry their own copies; they switch in the next revisions.

The oracle test gains a check that the generated definitions of MatchingRule, IdWithIdentifier and MatchingStrategy equal the $defs of all three checked-in schema.json files (ApplicationIdentifier is the protocol crate's and differs per platform by design).

Verified: native cargo test -p komorebi-config: 4 unit + 3 schemas passed, 0 failed (tier 1).
2026-10-31 01:37:53 -07:00
LGUG2Z 06436c98fe test(config): pin the checked-in schemas of the three trees as the oracle
tests/schemas.rs reads schema.json and schema.asc.json of the Windows tree, komorebi-for-kde and komorebi-for-mac by path and checks that every file is in the canonical form the generator prints (so a regenerated schema compares with == on text) and that each keeps today's keys: 53/37/33 properties, 60/52/47 definitions, the six definitions of the applications schema. Nothing is generated from the crate yet, so at this point the test guards the three files against accidental edits; each following stage adds a comparison of the types it moves with these definitions.

Verified: native cargo test -p komorebi-config: 2 passed, 0 failed (tier 1). The three checked-in files were byte-identical to their regenerated forms before this stage (Windows 141169/5945 bytes, KDE 127164/5051, macOS 120057/5051; S/step3/regen.sh).
2026-10-31 01:37:53 -07:00
LGUG2Z 67c1189bd8 build(config): add the komorebi-config crate skeleton
Add crates/komorebi-config (edition 2024, root workspace member) with the feature-gated schema module that prints a schema the way komorebic does (pretty JSON plus a newline). No type has moved yet: the crate depends on komorebi-layouts, komorebi-themes and komorebi-protocol, which every type that follows needs.

Verified: native cargo test -p komorebi-config compiles (tier 1). Cargo.lock gains only the new package. Windows, KDE and macOS trees do not depend on the crate yet.
2026-10-31 01:37:53 -07:00
LGUG2Z b15d7cdc53 build(nix): import the nested flakes instead of locking them as inputs
The root flake got the code of komorebi-for-kde and komorebi-for-mac through two locked path inputs (kfde, kfm), so the root flake.lock pinned the content of those directories and needed 'nix flake update kfde kfm' after any edit under them; a stale pin gave 'attribute lib missing'.

Now the root imports komorebi-for-kde/flake.nix and komorebi-for-mac/flake.nix as plain files and calls their outputs/lib.mkOutputs with inputs declared in the root under the names kfde-* and kfm-* (nixpkgs, nixpkgs-lib, flake-compat, flake-parts, crane, rust-overlay, treefmt-nix, git-hooks-nix, and gitignore for kfm), pinned by revision in the URL to exactly the revisions of each nested flake.lock, with the same follows structure. The nested flakes are unchanged and still have their own locks. The kfde and kfm nodes are gone from flake.lock. When a nested flake.lock is bumped, update the revisions of the matching kfde-*/kfm-* inputs by hand.

Verified (tier 2): derivation paths unchanged before and after for kfde fmt, deny, nextest, schema-fresh, the Windows workspace clippy check, kfde-komorebic and kfm-komorebic (aarch64-darwin, eval only); every narHash of the nested locks is present in the root lock; nix flake check --no-build passes on x86_64-linux; nixosModules, overlays, darwinModules evaluate; kfde-vm has 34 suites.
2026-10-31 01:37:53 -07:00
LGUG2Z 374ad1bad5 chore(repo): combine step 2 with the integration line
Merge revision: wip-main (history merges, fixes, step 0 path dependencies, step 1 komorebi-collections, KDE A3 fixes, flake phase 2) and wip-step2 (the komorebi-protocol crate, goldens and the unified SocketMessage used by all three trees). Conflicts in the root Cargo.toml members line, the trees' Cargo.toml dependency tables and the Cargo.lock files are resolved in this revision by keeping both sides' additions.
2026-10-31 01:37:53 -07:00
LGUG2Z 2d6423f13c build(nix): relock the nested flakes after the step 1 and crates changes
The root flake.lock pins the content of komorebi-for-kde and komorebi-for-mac (D14 of the flake phase 2 work: the root passes its own self to the nested mkOutputs, and the lock records the nested directories). Their trees changed with the step 1 crate and the crates directory in the source filter, so the pins are updated with nix flake update kfde kfm. Only flake.lock changes.
2026-10-31 01:37:53 -07:00
LGUG2Z a4996ac633 refactor(protocol): use SocketMessage from komorebi-protocol in the macOS daemon
Delete macOS's SocketMessage, as_bytes and FromStr and its now unused imports, and re-export the crate's SocketMessage from core. process_command stays an exhaustive match: the 41 variants macOS does not handle (33 Windows only, 6 Windows and KDE, 2 KDE only) get one explicit or-pattern arm that writes the 'not supported on this platform' reply and returns before anything else happens. Behaviour change: those variants used to fail to parse on macOS and now parse and are answered that way.

Verified: fast-check macOS (fake CC) cargo check --workspace --all-targets: PASS (0 errors, only the existing komorebi-bar warnings). macOS tests not run (cannot).
2026-10-31 01:37:53 -07:00
LGUG2Z 68601ced53 build(nix): give the KDE and macOS builds the shared crates directory
The nested flakes cut the repository down to their own tree and the root crates they depend on by path (rootCrates). Step 1 added crates/komorebi-collections, which both trees now depend on, so crates/ must be in that list or the root flake cannot build kfde (and kfm cannot evaluate its sources). Listing the directory rather than each crate means later shared crates (protocol, config, ...) are picked up without another flake change. Verified: see the following progress entry.
2026-10-31 01:37:53 -07:00
LGUG2Z 7483d5837e test(kde): a message of another platform is answered as not supported
Two tests against the fake desktop: ForceFocus, StackbarMode and ToggleTitleBars (Windows only) are answered with 'X is not supported on this platform', and a message KDE handles (Retile) is not.

Verified: cargo test -p komorebi --test unsupported_messages in komorebi-for-kde: 2 passed, 0 failed.
2026-10-31 01:37:53 -07:00
LGUG2Z 8c22a18dce chore(repo): combine the flake phase 2 work with the integration line
Merge revision: wip-main (history merges, fixes, step 0 path dependencies, step 1 komorebi-collections, KDE A3 fixes) and wip-flake (the root flake builds the KDE package with the whole repository as source, the macOS package evaluates the same way, the root flake no longer requires dirtyRev). The root flake.lock pins the content of the nested flakes, so it is relocked in the next revision.
2026-10-31 01:37:53 -07:00
LGUG2Z 2adcced406 refactor(protocol): use SocketMessage from komorebi-protocol in the KDE daemon
Delete KDE's SocketMessage, as_bytes and FromStr and its now unused imports, and re-export the crate's SocketMessage from core. process_command stays an exhaustive match: the 34 variants KDE does not handle (33 Windows only, plus PanGesture which only Windows and macOS have) get one explicit or-pattern arm that writes the 'not supported on this platform' reply and returns before anything else happens (no notification to subscribers). Behaviour change: those variants used to fail to parse on KDE and now parse and are answered that way. The doctest of SocketMessage lives in the crate now.

Verified: cargo check --workspace --all-targets in komorebi-for-kde: 0 errors, no warnings; cargo test -p komorebi --lib --test schemas --test rule_commands: 302 + 5 + 6 passed, 0 failed; komorebic static-config-schema byte-identical to schema.json. Full workspace run at the end of the stage.
2026-10-31 01:37:53 -07:00
LGUG2Z 412f380ce7 chore(repo): combine the step 1 crate with the KDE A3 fixes
Merge revision on the integration line: wip-step1 (the komorebi-collections crate and its wiring in all three trees, on top of the step 0 path dependencies) and wip-a3-kde (the KDE path-coupling, test-isolation, dirtyRev and lock-order fixes). No file needed manual resolution. Verification of this merge: not run separately; each side passed its own gates (step 1: Windows clippy, KDE 885 tests, macOS type-check; KDE A3: 895 tests three times).
2026-10-31 01:37:53 -07:00
LGUG2Z 74433e30bc build(nix): build the KDE and macOS packages from the whole repository
The root flake no longer re-exports the nested flakes' own outputs. It keeps them as inputs for their pinned nixpkgs, crane and rust-overlay (inputs.<name>.inputs), but calls their lib.mkOutputs with the whole repository (self) as the source, a nested self carrying the root rev, dirtyRev and inputs, and the tree's directory, then re-exports packages, checks (without vm-*), legacyPackages.kfde-vm, nixosModules, overlays and darwinModules from those. flake.lock is updated for the changed nested flakes: the lock pins their content, so it needs 'nix flake update kfde kfm' whenever a file under komorebi-for-kde or komorebi-for-mac changes.

Verified (Linux, x86_64): nix build -L of packages.kfde-komorebic and kfde-komorebi succeed and both binaries run with --help (exit 0); checks kfde-schema-fresh, nix-options-validation, keybindings-fixtures, komorebi-bridge-js, nixos-module-eval, plasma-guests-eval, run-kde-dry-run, run-kde-doctor, komorebi-workspace-fmt, -deny and -nextest build; kfde-komorebi-workspace-toml-fmt FAILS because komorebi-for-kde/Cargo.toml itself is not taplo-formatted (same result running taplo on the file directly; not caused by this change). nix eval of aarch64-darwin kfm-komorebic and kfm-komorebi drvPath print .drv paths (evaluated, not built). Windows clippy and default drvPaths are identical to those before this revision. nix flake check --no-build passes for x86_64-linux. Not verified: any darwin build, kfde clippy/doc, the VM suites.
2026-10-31 01:37:53 -07:00
LGUG2Z 68c3133d4e refactor(protocol): use SocketMessage from komorebi-protocol in the Windows daemon
Delete the Windows SocketMessage, its as_bytes and FromStr (now in the crate) and re-export komorebi_protocol::message::SocketMessage from core, so komorebi::SocketMessage and komorebi_client::SocketMessage keep working. process_command stays an exhaustive match: the two KDE-only variants (ReloadHotkeys, HotkeysState) get one explicit arm that writes the 'not supported on this platform' reply (SocketMessage::not_supported_reply) and returns before anything else happens, so subscribers are not notified either. Behaviour change: those two used to fail to parse on Windows and now parse and are answered that way.

Verified: Windows clippy --workspace --locked --all-targets -D warnings clean; native cargo test -p komorebi-protocol passes. Windows unit tests and e2e not run (cannot on Linux).
2026-10-31 01:37:53 -07:00
LGUG2Z 9b8be3ea70 refactor(kde): take ring and lockable_sequence from the komorebi-collections crate
Deletes the KDE copies, adds the komorebi-collections path dependency via the workspace table, re-exports ring and lockable_sequence from lib.rs, #[macro_use] extern crate for impl_ring_elements!, and forwards the schemars feature. Cargo.lock updated.

Verified: fast-check KDE cargo check, --lib tests and schemas test: PASS.
2026-10-31 01:37:53 -07:00
LGUG2Z 3a8176875e fix(kde): sync-e2e-core checks against the root e2e/lib, which is the source of truth
The e2e core was vendored twice (komorebi/e2e/lib and the KDE VM lib), synced by a script. The script now checks the KDE copy against ../e2e/lib in the root, treating the root as the single source, as the plan's A3 requires. Verified: running the script reports the copies in sync.
2026-10-31 01:37:53 -07:00
LGUG2Z a57ca82f0c fix(nix): do not require dirtyRev in the root flake
A path flake (a jj workspace without .git) has neither rev nor dirtyRev, so the commit stamp default in mkKomorebiPackages failed to evaluate. It now falls back to "unknown", as the nested flakes do.

Verified: nix eval --raw .#checks.x86_64-linux.komorebi-workspace-clippy.drvPath now prints z9nb5j12qlfp1j8d71ykp9qnafk553ra-komorebi-workspace-clippy-0.1.0.drv (it failed before); .#packages.x86_64-linux.default.drvPath is cq0i40300hgsm0ih2llcdjpkcg9sfqaf-komorebi-workspace-0.1.0.drv. Neither was built.
2026-10-31 01:37:53 -07:00
LGUG2Z 7e1db827bd feat(protocol): add the unified SocketMessage and the platforms() support table
message.rs holds the one SocketMessage with the 197 variants of the three trees: the Windows enum verbatim (195 variants, in its order, with ApplyState(StateBlob) and DebugWindow(i64) as converged in the previous revisions) plus the two KDE-only variants (ReloadHotkeys, HotkeysState) at the end, as_bytes and FromStr. platforms.rs has Platform, Platforms and SocketMessage::platforms(), one exhaustive match generated from tests/golden/variants-table.tsv (155 on all three, 33 Windows only, 6 Windows and KDE, 1 Windows and macOS, 2 KDE only). No tree uses it yet.

The golden test now runs the real enum: every golden instance of each platform is accepted with identical wire text (path-expansion instances only with STRICT_PATHS=1, which is meaningful on the target platform only; ApplyState on Windows by tag), every variant of every platform is in the unified schema and every generated instance round-trips, and platforms() matches each platform's variant list both ways.

Verified: native cargo test -p komorebi-protocol: 5 unit + 6 golden + 2 doctests passed, 0 failed. Not run: STRICT_PATHS=1 (fails on Linux for the Windows goldens by design).
2026-10-31 01:37:53 -07:00