Commit Graph
89 Commits
Author SHA1 Message Date
LGUG2Z 6f8bc2b0ba refactor(settings): pin a configuration load through the handle
Adds crates/komorebi-settings/tests/reload.rs: a load applied through a
Handle merges what the file gives, resets layout_defaults and the aspect
ratio when absent (the first load without the key turns the initial
Widescreen into Standard, as the statics do), keeps paddings and display
index preferences, never touches groups it does not name, and a reader that
holds the earlier snapshot still sees the earlier load whole. Test only.

Verified: native cargo test -p komorebi-settings: 18 unit + 3 integration
passed.
2026-11-05 10:30:05 -08:00
LGUG2Z b937a3d716 chore(repo): merge kfde's core line into the package migration
Merge of wip-u-core (kfde: komorebi-core with Container, Workspace<P>, Monitor<P>) and wip-u-pkg-mig3.
Conflicts and how they were resolved:
- komorebi-for-kde/Cargo.toml, komorebi-for-kde/Cargo.lock: deleted, as in the migration (one root
  workspace); kfde's only edit there, the komorebi-core workspace dependency, is applied as a path
  dependency in the crate manifest.
- komorebi-for-kde/komorebi/Cargo.toml: the migration's manifest (inlined dependencies, package name
  komorebi-linux, [lib]/[[bin]]) plus kfde's komorebi-core dependency and the komorebi-core/schemars
  feature.
- Cargo.lock: the migration's lock re-resolved with cargo metadata --offline: the only change is the
  new komorebi-core 0.1.42 entry; no version of any other package moved (compared by name/version with
  both parents; kfde's Windows lock differs only by the komorebi -> komorebi-windows rename).
- komorebi-bar/src/widgets/komorebi.rs: deleted (the Windows bar moved to komorebi-bar/src/windows/);
  kfde's one-line edit (title: value.title() instead of value.title().ok()) applied to
  komorebi-bar/src/windows/widgets/komorebi.rs.
- komorebi-for-kde/nix/root-crates.json: crates/komorebi-core added (tools/kde-closure-check now ok with
  11 root crates).
Gates run: tools/fast-check --since wip-u-pkg-mig3: native tests, Windows clippy -D warnings, KDE check+lib+schemas, macOS fake-CC check, nix evaluation (root and both nested flakes) PASS; KDE cargo test -p komorebi-linux -p komorebic -p komorebi-client -p komorebi-hotkeys -p komorebi-core: 902 passed, 0 failed; CLI docs oracle identical x3; bar schema harness byte-identical for both bars (its Window::title stub now returns Option); bar-core tests 3+6; kde-closure-check ok; by evaluation an edit of the Windows bar or daemon leaves the kfde derivations unchanged, a KDE edit leaves Windows unchanged, and an edit of crates/komorebi-core changes Windows and kfde but not macOS. Not run: nix builds, VM, e2e (the Windows daemon changed: kfde's e2e gate applies), any Mac run.
2026-11-05 10:30:05 -08:00
LGUG2Z 072ba7a471 chore(repo): merge the kfm clippy fixes into the package migration line
wip-u-kfm carries the macOS clippy fixes (&Path, drain, filter, slice fill, sort_by_key, collapsible_match allows, capture_spike, bar stroke literals). The bar stroke literal revision touches komorebi-for-mac/komorebi-bar, which the migration moved to komorebi-bar/src/macos; conflicts are resolved here by applying the same edit at the new paths.
2026-11-05 10:30:05 -08:00
LGUG2Z 74b9992e1c feat(core): Monitor<P> with the shared half of monitor.rs
komorebi-core gets Monitor<P: MonitorPlatform> (MonitorPlatform extends
WorkspacePlatform), moved from komorebi-for-kde/komorebi/src/monitor.rs
and made generic: the id and serial_number_id are the platform's
associated types (Id with serialize_id/deserialize_id hooks so each daemon
keeps writing its id as the plain number it always did; SerialNumber), and
the fields only a platform has are P::Extra, flattened into the monitor's
JSON (NoExtra for a platform with none). The schema is named Monitor.
The workspace accessors (impl_ring_elements! is not generic) are written
out, and eight functions move with them: focused_workspace_layout,
focused_workspace_name, new_workspace_idx, ensure_workspace_count,
remove_workspaces, remove_workspace_by_idx, add_container and
focus_workspace, the last taking the name the platform last knew for a
new workspace from the known_workspace_name hook (Windows keeps its
names in the extra fields). WorkspacePlatform now needs Clone, Debug and
PartialEq of the platform marker and ContainerWindow needs Debug, because
the derives on the generic structs ask for them.

One serde fact the tests pin: a flattened map is read through a buffer
that keeps its keys as strings, so an extra field with integer keys (the
Windows workspace_names) needs a deserialize_with that parses them; the
Windows converge must carry it.

Tests with stub platforms: the JSON of a monitor with flat extra fields
and the id as a number, a monitor without extra fields, the name hook of
focus_workspace, the schema name and flat properties.

Verified: cargo test -p komorebi-core --features schemars (native): 27
passed, 0 failed; Windows clippy --workspace --locked --all-targets
-D warnings: PASS. Not run: the daemons.
2026-10-31 13:17:50 -07:00
LGUG2Z dcd707c688 feat(core): promote_container, effective_layout_options, new_floating_window and hide are shared
Four more functions of the workspace move into komorebi-core, written
from the KDE text with three hooks that have defaults: primary_container_idx
(the layout's primary position; 0 for the default layouts, Windows
overrides it for custom layouts), unmaximize_window (KDE asks the
compositor, a no-op on Windows, as new_floating_window does there today)
and before_hide_containers (the KDE scrolling prelude of hide, returning
the resize adjustments to put back). effective_layout_options needs no
hook: a layout that is not one of the defaults has no default options,
which is the Windows custom-layout arm and an unreachable pattern on KDE.
Tests with the stub platform cover promote, new_floating_window and hide.
The daemons still have their own copies; the next revisions make them use
these.

Verified: cargo test -p komorebi-core --features schemars (native): 23
passed, 0 failed. Not run: the daemons.
2026-10-31 13:02:17 -07:00
LGUG2Z 5cdb1ab33a fix(bar-core): WidgetConfig::supported as matches!
clippy::match_like_matches_macro (-D warnings, seen by native clippy on the Mac Mini) flagged the match
with a Keyboard/Media/Systray arm of cfg!(target_os = "windows") and a true arm. The same boolean is
written !matches!(self, Keyboard | Media | Systray) || cfg!(target_os = "windows"): false only for those
three variants off Windows. Behaviour identical.
Gates run: Windows clippy -D warnings PASS; native cargo clippy -p komorebi-bar-core --all-targets -D
warnings PASS; bar-core tests (3 unit + 6 oracle) PASS; macOS fake-CC check PASS.
2026-10-31 12:53:21 -07:00
LGUG2Z f225e51982 feat(core): Workspace<P> with the shared half of workspace.rs
komorebi-core gets Workspace<P: WorkspacePlatform>, moved from
komorebi-for-kde/komorebi/src/workspace.rs (KDE is the base), together
with WorkspaceLayer, WorkspaceWindowLocation, CachedLayoutDefault and the
two threshold helpers, and these 52 functions of its impl, whose text is
the same on both daemons (add_container_to_back/front, the container
focus and removal family, insert_container_at_idx, swap_containers,
preselect and monocle operations, new_container_for_window and
resolve_placement_index, location_from_exe, visible_windows, the
enforce_resize_* family, the window lookups, remove_floating_window and
the floating focus helpers, is_scrolling). They are generic over
P::Window (Container<P::Window>, PlatformWindowId<P>), and every private
function is pub so the daemons' own methods can call it. The accessors
the impl_ring_elements! macro made are written out.

WorkspacePlatform is the hook trait: Window (a WorkspaceWindow), State
(what only a platform keeps in a workspace; skipped in the JSON and the
schema), default_padding, foreground_window_id, cursor_position,
should_act_window and should_act_window_individual (the platform holds
the compiled regexes), the three scrolling lookups and
after_floating_removed (KDE refocuses a floating window). Default for
Workspace<P> is the KDE one with the padding from the hook. serde and
schemars bounds are on P::Window; the schema is named Workspace.

Not used by any daemon yet; the next revisions make each daemon use it.
Four tests with a stub platform cover new_container_for_window, the
focus, the JSON keys and the default.

Verified: cargo test -p komorebi-core --features schemars (native): 20
passed, 0 failed; Windows clippy --workspace --locked --all-targets
-D warnings: PASS (compiles the crate). Not run: the daemons.
2026-10-31 12:50:34 -07:00
LGUG2Z 1e10f45bb9 refactor(config): StaticConfig::read takes &Path, not &PathBuf
clippy::ptr_arg: the function only opens the file, so any path will do, and
every caller that passes a &PathBuf still compiles through deref. Needed so
the macOS StaticConfigExt methods can take &Path (next revision).

Verified: fast-check native, Windows clippy -D warnings, KDE check and lib
tests, macOS fake-CC type-check PASS. Verified on the Mini: not yet.
2026-10-31 12:36:14 -07:00
LGUG2Z b2ba3847cb feat(core): WorkspaceWindow, what a workspace asks of a window
A supertrait of ContainerWindow with the four lookups the shared workspace
code makes (title, exe, class, path, each Option<String>), for the
functions that move into komorebi-core next. The crate's stub window
implements it and a test checks the four answers. Nothing uses it yet.

Verified: cargo test -p komorebi-core --features schemars (native): 16
passed, 0 failed. Not run: the daemons.
2026-10-31 12:32:31 -07:00
LGUG2Z 88afd37d36 feat(core): WorkspaceGlobals moves into komorebi-core
The plain data a monitor gives the workspaces it shows (padding, border
width and offset, work area, offsets, floating layer behaviour), moved
from komorebi-for-kde/komorebi/src/workspace.rs (the Windows struct is
the same nine fields with the same derives) into komorebi-core, with the
KDE doc comments and two unit tests. komorebi-core now depends on
komorebi-config (for FloatingLayerBehaviour, default features off) and
komorebi-layouts (for Rect); its schemars feature enables theirs. The
struct derives JsonSchema under the feature, as Windows' did; a workspace
skips the field when serialised and in its schema, so no schema changes.

No daemon uses it yet: the next two revisions converge KDE and Windows.

Verified: cargo test -p komorebi-core --features schemars (native): 15
passed, 0 failed. Not run: the daemons.
2026-10-31 12:14:35 -07:00
LGUG2Z caf24494a7 feat(core): komorebi-core with Container generic over the platform window
New crate crates/komorebi-core, a member of the root workspace (KDE and
macOS take it by path when they adopt it). It holds Container<W>, moved
from komorebi-for-kde/komorebi/src/container.rs (KDE is the base) and
made generic: W is any type that implements ContainerWindow, a small
trait for what the container asks of a platform window (its id, the
executable name, hide and restore, and the hide and restore that
load_focused_window uses, which on Windows leave the border alone).
Container keeps no Backend calls; hiding and restoring is the window's
own business.

The serialised form is unchanged: id, locked (which may be missing when
read, as on Windows), windows with elements and focused. The schemars
schema of Container<W> is named Container whatever W is
(schemars(rename)), so schema.json keeps its definition name; a test
checks it. The tests of container.rs that need no daemon moved with it,
over a stub window, plus tests for the JSON, the hide/restore calls and
the missing locked field.

No daemon uses it yet: the next revisions converge KDE and Windows.

Verified: cargo test -p komorebi-core --features schemars (native):
13 passed, 0 failed. Not run: Windows, KDE, macOS builds (nothing
depends on the crate yet).
2026-10-31 11:36:54 -07:00
LGUG2Z 12870fa533 chore(repo): base for the package migration
Merge of wip-stage (kfde, bar, settings), wip-cand1 (kfw, kfm), wip-u-nix and wip-u-pkg (the
unified-binaries doc), so the migration is built on the open stacks and does not conflict with them later.
2026-10-31 11:31:14 -07:00
LGUG2Z 1b3b33fb2c chore(repo): combine the kfde, bar and settings stacks (staging)
Staging merge of three stacks that make no runtime change on Windows or KDE: the KDE Backend/Container/process_command refactors (wip-u-kfde), the shared bar core moves (wip-u-bar) and komorebi-settings with the S1/S2 pins (wip-u-settings). Conflicts, if any, are resolved here. Not yet gated: the KDE VM suites and the Windows bar check are owed.
2026-10-31 11:25:59 -07:00
LGUG2Z fb145f96a8 feat(settings): add the shared settings and the load merge
Shared now holds every non-platform setting of docs/dev/settings.md 2.1:
border (enabled, width, offset, radius, six colours), animation (global and
per-prefix enabled, style, duration; fps; Animation::motion_for reading all
three from one snapshot), paddings and constants, transparency, floating
window aspect ratio, layout defaults, display index preferences, with the
per-platform defaults (PlatformDefaults::{WINDOWS, KDE, MACOS}: border 8/10/10
and -1/0/0, padding 10/5/5). SharedDelta::apply reproduces what
StaticConfig::apply_globals does with each key: absent keys keep the old value
(border, paddings, transparency, display preferences, a missing animation
block), absent layout_defaults and floating_window_aspect_ratio reset (the
latter to Standard although the static starts at Widescreen), an animation
block without fps resets fps, a global animation value clears its per-prefix
map and a map replaces the whole map.

No daemon uses the crate yet.

Verified: native cargo test -p komorebi-settings: 18 passed (9 handle, 9
shared: defaults per platform, default colours equal the komorebi-themes
conversion, keep-versus-reset per key, animation merge, motion_for);
clippy clean for the crate. The tests encode what apply_globals does as read
on wip-main; they were not run against the daemons.
2026-10-31 11:25:28 -07:00
LGUG2Z 1fb5e74fe3 feat(settings): add komorebi-settings with the snapshot handle
New crate crates/komorebi-settings (workspace member, Cargo.lock +1
package, no new third-party dependency). Settings<P> is a shared part and a
platform part P; Handle<P> holds the current value as an Arc that readers
snapshot once per unit of work and writers replace through update (writers
serialised, one publish, nothing published if the edit panics). Handle::scoped
sets one field and restores the previous value on drop only if the field
still holds the value it set, replacing the save-and-restore store pairs in
the daemons (Windows WINDOW_HANDLING_BEHAVIOUR, KDE ANIMATION_ENABLED_GLOBAL).
Shared starts with the border and the per-platform defaults; the rest follows
in the next revision. See docs/dev/settings.md.

No daemon uses the crate yet.

Verified: native cargo test -p komorebi-settings: 9 passed (snapshot
isolation, concurrent updates lose nothing, no torn reads under a writer,
scoped restore and 'change made meanwhile wins'); clippy clean for the crate.
komorebi-config warns about an unused import when built without its schemars
feature (not touched here). KDE, macOS and Windows trees not touched.
2026-10-31 11:25:28 -07:00
LGUG2Z 91840eb34f refactor(bar-core): move the komorebi layout widget into the core
The two komorebi_layout.rs were identical except for the position of one
`pub use`. The widget moves to
crates/komorebi-bar-core/src/widgets/komorebi_layout.rs together with the
KomorebiLayoutExt trait; the shells re-export the module. Its three
komorebi_client calls go through the platform seam: new hook
`BarPlatform::send_komorebi_message` (next to send_komorebi_batch), which
both os.rs implement as `komorebi_client::send_message`, so each bar sends
exactly what it sent. DefaultLayout and SocketMessage come from
komorebi-layouts and komorebi-protocol (what komorebi_client re-exports).
About 290 lines per bar are gone.

Verified: native bar-core tests 3+6; schema harness macOS and Windows
byte-identical (3,774 / 9,091 lines); Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors (files touched first). Not
run: the bars; clicking the layout widget is unverified on both.
2026-10-31 10:56:04 -07:00
LGUG2Z b65a32446e chore(repo): combine the kfw and kfm stacks for the e2e gate
Candidate for the Windows e2e gate: the Windows Backend switches and lock order (wip-u-kfw) with the macOS registry and Window methods (wip-u-kfm). Merge of two independent stacks that both touch crates/komorebi-backend; conflicts, if any, are resolved in this revision.
2026-10-31 10:55:01 -07:00
LGUG2Z ef89899bd9 refactor(bar-core): move config.rs (KomobarConfig and the mouse options) into the core
The (now identical) config.rs of both bars becomes
crates/komorebi-bar-core/src/config/komobar.rs; each shell config.rs is one
line, `pub use komorebi_bar_core::config::*;`. Import edits only: statics
from crate::statics, PathExt/SocketMessage from komorebi-protocol, Rect from
komorebi-layouts, the platform hooks and WidgetConfig as in the core. The
core gains komorebi-themes (KomobarTheme, Colour; schemars forwarded): one
line in each Cargo.lock. About 590 lines per bar are gone.

Because the configuration types are now all in the core, the oracle test
regenerates the macOS schema natively: the macOS view of
`schema_for!(KomobarConfig)` is byte-identical to
komorebi-for-mac/schema.bar.json (new test `generated`). Windows is still
compared by the out-of-tree harness: three descriptions in komorebi-protocol
and komorebi-themes read differently when compiled for Windows, which a
Linux test cannot do.

Verified: native bar-core tests 3 unit + 6 oracle (incl. the generated macOS
view); schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); Windows clippy -D warnings --locked clean; macOS fake-CC check
--locked 0 errors (core files touched first). Not run: the bars.
2026-10-31 10:54:51 -07:00
LGUG2Z 7e61c3a934 refactor(bar): reach exec_powershell and send_batch through BarPlatform hooks
The mouse code in config.rs called `crate::bar::exec_powershell` and
`komorebi_client::send_batch` directly, which ties config.rs to the Windows
shell. Two new hooks, `exec_shell_command(&str)` and
`send_komorebi_batch(Vec<SocketMessage>)`, carry them: Windows os.rs calls
exactly `crate::bar::exec_powershell` and `komorebi_client::send_batch`;
macOS os.rs forwards send_batch the same way and answers
exec_shell_command with an Unsupported error (the macOS bar has no shell
session, and its mouse block was commented out), which nothing calls yet.
Windows behaviour is unchanged (same calls); config.rs of Windows now only
depends on the platform seam.

Verified: Windows clippy -D warnings --locked clean; macOS fake-CC check
--locked 0 errors (files touched first). Not run: the bars.
2026-10-31 10:52:09 -07:00
LGUG2Z 4831a6c3ab refactor(bar-core): WidgetConfig with a variant for every widget lives in the core
The widget configuration enum moves to widgets/widget.rs of the core with
all thirteen variants (Keyboard, Media and Systray are no longer cfg-gated
or commented out per tree), plus `supported()`/`unsupported()`/`enabled()`
(enabled is now false for a widget the platform cannot run) and
`warn_unsupported`, which both shells call when they read the config. The
construction of the widget from its config (`as_boxed_bar_widget`, which
needs the runtime types) becomes the extension trait `WidgetConfigExt` in
each shell widget.rs; macOS builds a no-op `Unsupported` for the three
Windows-only widgets, which `enabled()` never lets through.

BEHAVIOUR (macOS), per D-coord-1: a macOS config with a `Keyboard`, `Media`
or `Systray` widget is now accepted and skipped with a logged warning ("the
Keyboard widget is not supported on this platform and is skipped"); before
it failed to deserialize (unknown variant), so the whole bar config was
rejected. Mac hand check: such a config starts the bar and logs the
warning. The macOS schema view removes the three variants from the
schema, so komorebi-for-mac/schema.bar.json and the nix options do not
change.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean (re-run after touching the files: Checking komorebi-bar-core and
komorebi-bar); macOS fake-CC check --locked 0 errors. Not run: the bars.
2026-10-31 10:51:02 -07:00
LGUG2Z a57648f36d refactor(bar-core): move the network widget config types into the core
NetworkConfig, NetworkSelectConfig, InterfaceDisplayType and
DefaultInterfaceConfig move to widgets/network_config.rs (the macOS file had
the first two without default_interface_options). The union NetworkConfig
therefore also has `default_interface_options` on macOS. The macOS schema
view already removes it from the schema, and serde ignored the key before,
so reading a config is unchanged; the macOS network widget now logs a
warning when the key is set ("not supported on macOS and is ignored").

BEHAVIOUR (macOS): one new log line when `default_interface_options` is
configured; nothing else. Needs no gate beyond the Mac hand check listed in
docs/dev/macos-handcheck.md.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines; the macOS view is what removes the field); native bar-core tests
3+5; Windows clippy -D warnings --locked clean; macOS fake-CC check
--locked 0 errors.
2026-10-31 10:48:17 -07:00
LGUG2Z c2e6b01f89 refactor(bar-core): move the komorebi widget config types and KomorebiLayout into the core
The seven Komorebi*Config structs (komorebi.rs) and the KomorebiLayout enum
with its hand-written Deserialize and Display (komorebi_layout.rs) are data:
they move to crates/komorebi-bar-core/src/widgets/komorebi_config.rs, which
needs komorebi-layouts (DefaultLayout; schemars forwarded) and color-eyre
in the core: two lines in each Cargo.lock. The two shells re-export them.
The inherent impl of KomorebiLayout (is_default, on_click, show_icon, show,
the egui painting) cannot stay an inherent impl of a foreign type: it
becomes the extension trait `KomorebiLayoutExt` in each shell with the same
bodies; komorebi.rs imports the trait. Because the types are no longer in
the shell file, the two komorebi_layout.rs differ no more than the Windows
one; the macOS widget files keep their own komorebi.rs runtime.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors (core files touched first). I
reverted a stray `cargo fmt --all` that had reformatted unrelated files.
Not run: the bars.
2026-10-31 10:47:01 -07:00
LGUG2Z e1820d9bbe refactor(bar-core): move the config types of the Keyboard, Media and Systray widgets into the core
KeyboardConfig, MediaConfig, SystrayConfig, OverflowTogglePosition,
ButtonPosition, FieldMatch and HiddenIconRule (pure data: serde and schemars
derives, no platform code) move from the Windows widget files to
crates/komorebi-bar-core/src/widgets/platform_config.rs, so that the next
revision can give WidgetConfig a variant for every widget. The Windows
widget files re-export them (`pub use`), so no other file changes; the
runtime halves (Win32, systray_util) stay in komorebi-bar. The core gains the
komorebi-config dependency (for MatchingStrategy; the schemars feature now
forwards to komorebi-config and komorebi-protocol); one line in each
Cargo.lock. Nothing on macOS refers to the types yet, so the macOS schema
cannot change. The schema harness (out of tree) no longer slices systray.rs
by line number.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors. Not run: the bars.
2026-10-31 10:42:45 -07:00
LGUG2Z a290449763 refactor(bar-core): move the applications widget into komorebi-bar-core
Move of the (now byte-identical) applications.rs of both bars to
crates/komorebi-bar-core/src/widgets/applications.rs. Edits: `PathExt` comes
from komorebi_protocol::pathext (what komorebi_client re-exports; it picks
%VAR% handling by target_os), `ImageIcon` from widgets::icons. The core
gains the komorebi-protocol (default features off) and tracing dependencies:
two lines in each Cargo.lock. Both bars re-export the module. 409 lines per
bar are gone. The schema harness now builds a copy of the core next to its
copy of komorebi-protocol (out of tree).

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors. Not run: the bars.
2026-10-31 10:40:07 -07:00
LGUG2Z 1bc806c9d9 refactor(bar): converge applications.rs of both bars behind BarPlatform::command_icon
The two applications.rs differed in how an application icon is found for a
command string. The shared file now asks the platform (new hook
`BarPlatform::command_icon(&str) -> Option<ImageIcon>`). Windows os.rs gets
the former `UserCommand::get_executable` logic verbatim (as the private
`executable_of`) and the windows-icons lookup; macOS returns None, exactly
what its commented-out version did. `1.0` vs `1.0_f32` unified. The two
files are now byte-identical. No schema text changes.

Known and preserved: `UserCommand::launch_if_ready` spawns `cmd /C <command>`
in both bars, so launching an application from the macOS bar is broken (it
was before).

Verified: schema harness macOS and Windows byte-identical; Windows clippy
-D warnings --locked clean; macOS fake-CC check --locked 0 errors. Not run:
the bars.
2026-10-31 10:35:25 -07:00
LGUG2Z 0c197e8652 refactor(bar-core): move ImageIcon, ImageIconId and the icons cache into the core
The icon cache (IconsCache, ICONS_CACHE, ImageIcon, ImageIconId,
rgba_to_color_image) was in widgets/mod.rs of both bars with two small
differences: Windows has `Hwnd(isize)`, `SystrayIcon(String)` and `remove`,
macOS has `WindowId(u32)` and a private rgba_to_color_image. The core file
is the Windows one with the macOS variant and `From<u32>` added (an enum
with every variant, as D26 does for WidgetConfig); both bars re-export the
items from widgets/mod.rs so no widget changes. The core gains the `image`
dependency (one line in each Cargo.lock) and a Default impl for IconsCache
(clippy).

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors (re-run after touching the core
files). Not run: the bars.
2026-10-31 10:30:21 -07:00
LGUG2Z 0a2562b9cf feat(backend): frame(id) is a cheap live frame query with the reason for a failure
Windows call sites read the frame about 60 times and rely on the Win32
error (or unwrap_or_default). The shared window_rect is built on window(id),
which also asks title, class, exe and path and gives None for every failure.
Add the provided method Backend::frame(id) -> Result<Rect>: WindowGone for
an unknown window, Platform for a failed read. The default goes through
window() (a table lookup on KDE through Shared<B> and on the fake, so the
cached/requested-rect semantics of seam.md section 2 row 2 are kept);
WindowsBackend overrides it with Window::window_rect (one DWM call) and
MacosBackend with MacosApi::window_rect (the two Accessibility reads, no
metadata). The contract tests check frame agrees with window().rect and is
WindowGone for an unknown id; FakeBackend gets a test. A provided method, so
no adapter had to change to compile.

Not a behaviour change (nothing calls it yet). Verified: tools/fast-check
(native crate tests pass, Windows clippy -D warnings, KDE check + lib tests,
macOS fake-CC type-check) PASS; macOS cannot be run here.
2026-10-31 10:22:38 -07:00
LGUG2Z 60fcd3071a refactor(bar-core): move the time widget into komorebi-bar-core
Pure move of the (now byte-identical) time.rs of both bars into
crates/komorebi-bar-core/src/widgets/time.rs; the only edit is the path of
Alignment. komorebi-bar-core gains the lazy_static dependency (TIME_RANGES);
Cargo.lock of the root and of komorebi-for-mac get that one line. Both bars
re-export the module. 541 lines per bar are gone.

Verified: schema harness: macOS byte-identical (3,774 lines), Windows
byte-identical (9,091 lines); native bar-core tests 3+5 passed; Windows
clippy -D warnings clean (--locked); macOS fake-CC check --locked 0 errors.
Not run: the bars.
2026-10-31 10:18:21 -07:00
LGUG2Z d8aa0dcd62 refactor(bar-core): move the storage widget into komorebi-bar-core
Pure move of the (now byte-identical) storage.rs of both bars into
crates/komorebi-bar-core/src/widgets/storage.rs; the only edit is the path
of Alignment (crate::bar::Alignment -> crate::alignment::Alignment). Both
bars re-export it (`pub use komorebi_bar_core::widgets::storage`), so no
other file changes. 207 lines per bar are gone.

Verified: schema harness: macOS byte-identical (3,774 lines), Windows
byte-identical (9,091 lines); native bar-core tests 3+5 passed; Windows
clippy -D warnings clean; macOS fake-CC check 0 errors. Not run: the bars.
2026-10-31 10:14:41 -07:00
LGUG2Z bfddb6f0c3 refactor(bar): converge storage.rs of both bars behind a platform hook
The two storage.rs differed in the click handler and in four doc strings.
The click now asks the platform (new SystemTool::StorageLocation(label)) and
each shell keeps exactly what it spawned: Windows `cmd.exe /C explorer.exe
<first word of the label>`, macOS `open <label without its last word>`. The
macOS doc strings take the Windows spelling (C:\, Local Disk); the macOS
schema view sets the macOS text back, so komorebi-for-mac/schema.bar.json
and nix/komorebi-bar-options.nix do not change.

Verified: schema harness S/bar2/regen.sh: macOS byte-identical (3,774
lines), Windows byte-identical (9,091 lines); the two storage.rs are now
byte-identical to each other; Windows clippy -D warnings clean; macOS
fake-CC check 0 errors. No click was exercised (cannot here).
2026-10-31 10:13:25 -07:00
LGUG2Z 352cda3be3 refactor(bar): print --schema through the platform view
Both bars now print `schema.bar.json` as the view of the generated union
schema (komorebi_bar_core::schema::generated_text): Windows through the
Windows view (the identity), macOS through the macOS view. The sources of
both bars are still separate, so the generated text is what it was and the
macOS changes set what is already there (they are idempotent); this is the
switch that lets the next revisions move code that differs only in schema
text into the core in the Windows spelling.

Verified: out-of-tree schema harness (S/bar2/regen.sh, real sources, bins
updated to call generated_text): macOS byte-identical to
komorebi-for-mac/schema.bar.json (3,774 lines), Windows byte-identical to
schema.bar.json (9,091 lines). Native bar-core tests 3+5 passed, Windows
clippy -D warnings clean, macOS fake-CC check 0 errors. The binaries were
not run (cannot on Linux).
2026-10-31 10:09:33 -07:00
LGUG2Z 4c9094d776 feat(backend): Registry, a thread-safe table from WindowId to a platform handle
Step 11(ii), the pure part. macOS cannot act on a window from its id: it
needs the Accessibility element, the pid and the observer. Registry<H> is
that table, generic over the handle so that its rules run on any host.
Rules, written at the top of registry.rs and tested: thread-safe; a
lookup clones the handle and releases the lock before anything is done to
it; a removed or replaced handle is handed back to the caller instead of
being dropped under the lock (dropping a macOS handle can make an AX round
trip, which must never happen with a lock held: seam.md 3.3); a stale or
unknown id is Error::WindowGone, never a panic; an entry ends on remove,
remove_pid (application quit) or a failed call; re-inserting replaces.

Nothing uses it yet; no daemon changes.

Verified: native cargo test -p komorebi-backend: 38 unit (9 new) + 7 doc
(1 new) + 1 compile_fail passed, 0 failed. Not run: the Windows, KDE and macOS
checks (the new module is std-only and no other file changed).
2026-10-31 10:08:57 -07:00
LGUG2Z 280eea6fec feat(bar-core): per-platform views of one union bar schema
The Windows schema.bar.json is the union of the bar configuration (every
widget, the mouse options, Windows spelling). New module `schema` holds the
macOS view as data: 16 changes (set text/defaults that read differently,
remove the mouse property, the Keyboard/Media/Systray widget variants and
the NetworkConfig default_interface_options) followed by pruning of the
definitions nothing refers to any more. Same design as komorebi-config
(schema.rs, changes.rs); the changes are idempotent so a bar can print its
own generated schema through its view.

Nothing uses the views yet; no bar source changed.

Verified: native `cargo test -p komorebi-bar-core` 3 unit + 5 oracle passed
(new: the macOS view of the checked-in Windows file is byte-identical to
komorebi-for-mac/schema.bar.json; the Windows view is the Windows file; a
view is idempotent). Windows clippy -D warnings clean; macOS fake-CC check
0 errors. Not verified: nothing rendered.
2026-10-31 10:00:37 -07:00
LGUG2Z 83819b22b1 docs(backend): focus is one call on Windows and macOS too
The doc of Backend::focus said Windows and macOS do focus and then center_cursor_in; writing the adapters showed that Window::focus on both takes mouse_follows_focus and centres the pointer itself (Windows also defers the focus while the window slides in). Doc comment only.

Verified: see the gates below; native cargo test -p komorebi-backend passes (doctests unchanged).
2026-10-31 01:37:54 -07:00
LGUG2Z 998396dfc5 test(backend): contract tests that any Backend must pass
komorebi_backend::contract: a Harness trait (how a test puts a live window on the desktop of the backend under test) and 14 checks, run by check_all::<H>(): windows listed by id; window agrees with windows/is_window/window_rect; an unknown window is not a window; every window command on an unknown or on a destroyed window fails with WindowGone naming that window; a destroyed window is neither alive nor listed; set_rect on a live window succeeds and the frame stays readable (a request: the value read is not checked); hide/restore tolerate repeats; focus names a known window; capabilities and Unsupported agree (supported means never Unsupported, unsupported means always Unsupported, with a live or unknown window); monitors are sane and found by point; Batch scopes nest around writes; the backend works from another thread; it is usable as a trait object.

Only what the Backend documentation promises is checked, because a write is a request and platforms act at different speeds. The fake passes under three configurations (plain, with a frame offset, with no capability at all, as macOS would be) and a deliberately broken backend (set_rect answers Ok for a gone window) is shown to fail exactly the two checks that cover it.

Verified: native cargo test -p komorebi-backend: 29 unit tests passed, 6 doctests passed, 1 compile_fail doctest passed, 0 failed; clippy --all-targets -D warnings clean.
2026-10-31 01:37:54 -07:00
LGUG2Z 6874a51769 feat(backend): FakeBackend with failure injection and frame offsets
The in-memory desktop of komorebi-for-kde (backend/fake.rs) moved into the shared crate, rewritten against WindowId/MonitorId/Result and the generic Backend only (look, border colours, wallpaper and drag frames stay out: they are KDE's).

Same behaviour as the KDE fake (permissive mode, minimum sizes, user_* helpers, maximize, fullscreen, workspaces, the ordered Command log with 15 of KDE's 18 variants; close() leaves the foreground window alone, as KDE's did), plus:
- failure injection: fail_next(Op, Error) and fail_next_for(Op, WindowId, Error), oldest first, one per call; the failed call is still logged as a command and changes nothing else (none existed on KDE);
- frame offsets: set_frame_offset / set_window_frame_offset make window_rect differ from the request by a constant, as the Windows shadow border does;
- capabilities: all four on by default, set_supported switches one off and its operations return Unsupported without being logged;
- batches: begin/end are counted (open_batches) and logged as BatchBegin/BatchEnd;
- FakeBackend<X>: a platform extension logs its own commands in order with record_ext (Command::Ext(X)); the shared fake is FakeBackend<NoExt> (new/permissive/with_one_monitor), an extension uses empty/permissive_ext/one_monitor because default type parameters are not inferred.

Verified: native cargo test -p komorebi-backend: 24 unit tests and 6 doctests passed, 0 failed (the KDE fake tests were ported and 6 failure/offset/capability/batch/extension tests added); clippy --all-targets -D warnings clean; cargo fmt applied.
2026-10-31 01:37:54 -07:00
LGUG2Z f08237d402 feat(backend): the shared Backend trait, WindowId, plain-data infos and the error type
New crate crates/komorebi-backend (edition 2024, root workspace member, depends only on komorebi-layouts for Rect).

- WindowId and MonitorId: opaque u64 newtypes. KDE and macOS ids convert with from_u32/to_u32; a Windows HWND/HMONITOR goes through from_hwnd/to_hwnd, which keep the bits of the isize unchanged (isize as usize as u64), so no handle is lost whether or not it fits in 32 bits (the e2e samples stay below 2^32, which is an observation, not a guarantee).
- WindowInfo and MonitorInfo: plain data; only id, pid, rect, minimized and alive are required, the rest (title, class, exe, path, fullscreen, maximized, normal; name and serial id of a monitor) are Option (seam.md consequence 6).
- Error: WindowGone(id) (finding 9: macOS uses a failed write as its signal that a window died), Unsupported(Capability) and Platform(cause).
- Backend: only the operations of seam.md section 2.1 that at least two platforms have (5 queries, 9 commands), a Capability query for workspaces, maximize, opacity and focus-follows-mouse (their methods default to Unsupported), begin_batch/end_batch with a no-op default plus the Batch guard (finding 8), the documented set_rect contract (a request; reads after a write return what the platform defines, consequence 2 as corrected) and the thread contract (any non-main thread, no waiting for the platform's main thread: consequences 3 and 4, written as TARGET rules). Every doc comment says which platforms implement the method.

Verified: native cargo test -p komorebi-backend (2 unit tests, 3 doctests, 0 failed) and cargo clippy -p komorebi-backend --all-targets -- -D warnings clean. The Windows/KDE/macOS gates are not affected yet (new crate, nothing depends on it).
2026-10-31 01:37:54 -07:00
LGUG2Z 6da27dda3c refactor(bar-core): move the memory, date and update widgets into komorebi-bar-core
Pure move of the three widget files that are byte-identical in the two bars since the previous revision. Each bar's widgets/mod.rs re-exports them (pub use komorebi_bar_core::widgets::memory / date / update). The core takes chrono, chrono-tz, reqwest (blocking) and serde_json (now a normal dependency, it was only a dev-dependency).

Removed: 541 lines from each bar (138 + 245 + 158), 541 added once.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed; harness regeneration byte-identical for both (macOS 3,774 lines, Windows 9,091 lines). Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z b8de056b28 refactor(bar-core): the cpu and battery widgets open their tools through the platform hook
The click on the cpu widget (task manager) and on the battery widget (power settings) now calls platform().open_system_tool(...) instead of spawning cmd.exe in shared code. The Windows hook spawns the same commands as before; the macOS hook still spawns the same (broken there) cmd.exe commands, so neither platform's behaviour changes. Fixing macOS is now a change to one function of komorebi-for-mac/komorebi-bar/src/platform.rs.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed; harness regeneration byte-identical for both. Not verified: that a click still opens the tool (no screen).
2026-10-31 01:37:54 -07:00
LGUG2Z 086833af96 refactor(bar-core): add the BarPlatform hooks with the Windows and macOS implementations
komorebi_bar_core::platform holds what the widgets need from the operating system and differs between the bars: BarPlatform { open_system_tool, latest_release_api_url, calendar_icon }, the SystemTool enum (task manager, power settings, network settings, a URL) and install()/platform(), a once-set global the shell fills first thing in main() (a widget calls platform() when it is clicked or built, never before main). Each bar gets an os.rs with its implementation (main.rs re-exports the core module as crate::platform, so shared files can say crate::platform::platform()): Windows spawns exactly the commands the widgets spawn today (cmd.exe /C taskmgr.exe, cmd.exe /C start ms-settings:batterysaver, cmd.exe /C ncpa, explorer.exe <url>); macOS maps TaskManager to open -a 'Activity Monitor' and network settings to open x-apple.systempreferences:... as memory.rs and network.rs do today, and keeps the commands the shared files spawn on macOS today for the rest (cmd.exe taskmgr.exe for cpu, cmd.exe start ms-settings:batterysaver for battery, explorer.exe for a URL), which are broken there: a one-line fix per tool in os.rs, not part of this change.

Nothing calls the hooks yet: the next revisions switch the widgets over, one concern each.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors (6 bar warnings, unchanged); native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed; rustfmt --check clean on the new files and both main.rs. No widget calls the hooks yet, so no behaviour changes.
2026-10-31 01:37:54 -07:00
LGUG2Z 98f9e184a2 refactor(bar-core): move the battery and cpu widgets into komorebi-bar-core
Pure move of the two widget files that are byte-identical in the Windows and macOS bars. Each bar's widgets/mod.rs re-exports them (pub use komorebi_bar_core::widgets::battery / cpu), so crate::widgets::battery::... resolves as before; the files themselves are unchanged.

Dependencies: the core takes sysinfo from the root workspace (0.39) and starship-battery 0.11, the versions the Windows bar already used. The macOS bar therefore now gets these two widgets built against sysinfo 0.39 (its own workspace pins 0.38, still used by its other widgets until they move) and starship-battery 0.11 (was 0.10; its own dependency on the crate is removed). Both compile unchanged; behaviour of the libraries is not verified on macOS.

Not changed on purpose: the macOS bug that these two files spawn cmd.exe (taskmgr.exe, explorer.exe) on click is still there, identically; it is fixed behind the platform hook, not inside a move.

Removed: 325 lines from each bar (191 + 134), 325 added once.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors (bar warnings 6, unchanged; macOS Cargo.lock: starship-battery 0.10.3 -> 0.11.1 with its dependencies (uom, plist, nix), sysinfo 0.39.6 added next to 0.38.4); native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed; harness regeneration (S/bar2/regen.sh, which now fails when a harness does not build): macOS byte-identical (3,774 lines), Windows byte-identical (9,091 lines). Not verified: rendering, sysinfo and starship-battery behaviour on macOS.
2026-10-31 01:37:54 -07:00
LGUG2Z c05ef98d77 refactor(bar-core): the BarWidget trait moves into komorebi-bar-core
The three-line trait every widget implements is split off widgets/widget.rs (the WidgetConfig enum stays there until every widget it names has moved) and becomes komorebi_bar_core::widgets::widget::BarWidget; each bar's widget.rs re-exports it, so crate::widgets::widget::BarWidget resolves as before. The core's config module re-exports the leaf types (crate::config::LabelPrefix) so that the widgets can later move without a text edit.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed. No schema type changed. Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z d5ad916ff1 refactor(bar-core): move render.rs into komorebi-bar-core
Pure move of render.rs (RenderConfig, Grouping, GroupingConfig, GroupingStyle, RoundingConfig and the helpers), byte-identical in both bars since the three previous revisions, with the one path edit the move needs: Alignment is imported from komorebi_bar_core::alignment instead of crate::bar. Each bar's main.rs re-exports the module (pub use komorebi_bar_core::render), so crate::render::... resolves as before.

Removed: 382 lines from each bar, 382 added once.

Note: the one added line is #[allow(clippy::new_without_default)] on RenderConfig::new, which clippy now asks for because the type is public API of a library crate.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed; harness regeneration: macOS byte-identical (3,774 lines), Windows byte-identical (9,091 lines). Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z a3afb3a94b refactor(bar): GroupingConfig.transparency_alpha has one spelling in render.rs
The two render.rs differed in two places. The Windows bar documented transparency_alpha with '(default: 200)' in its text; the macOS bar documented it without and put the default into the schema (schemars extend default 200), so the macOS nix options file gets default = 200. The macOS spelling is taken for both, because a change to the macOS schema.bar.json would also change the generated nix/komorebi-bar-options.nix, which cannot be regenerated here. Windows: the description loses the '(default: 200)' text and the property gains "default": 200 (reviewed diff of schema.bar.json below, pin updated in tests/schema_oracle.rs); the one comment on RenderConfig that only Windows had ('/// Render configuration') is added to the macOS copy. The two render.rs are then byte-identical.

The schema diff is the two lines of the property: description 'Alpha value for the color transparency [[0-255]] (default: 200)' -> 'Alpha value for the color transparency [[0-255]]', and one added "default": 200. macOS schema.bar.json is untouched (its harness regeneration is byte-identical).

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core: 3 unit + 2 oracle passed, 0 failed; harness regeneration: macOS byte-identical (3,774 lines), Windows byte-identical to the updated schema.bar.json (9,091 lines, diff exactly the two lines above). Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z 3b641c04ce refactor(bar-core): move the leaf types of config.rs and their three tests into komorebi-bar-core
Pure move of the tail of config.rs, which both bars have byte-identical: Position (with its Vec2 and Pos2 conversions), LabelPrefix, DisplayFormat, the extend_enum! macro, WorkspacesDisplayFormat, MediaDisplayFormat and the three extend_* unit tests, to komorebi_bar_core::config::types. Each config.rs re-exports the module (pub use komorebi_bar_core::config::types::*), so crate::config::LabelPrefix and the others resolve as before; the Windows config.rs keeps its own pub use of KomobarTheme.

Two differences, neither visible in a schema: the macOS bar had no MediaDisplayFormat (it has no media widget), so it now has the unused type; the unit tests count as 3 in komorebi-bar-core instead of 3 in each bar, and run natively on Linux. The bars take the crate's schemars feature from their own (komorebi-bar-core/schemars).

Removed: 170 lines from the Windows config.rs and 149 from the macOS one; 174 added once (170 moved, 4 import lines).

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors (bar warnings 6, unchanged); native cargo test -p komorebi-bar-core: 3 unit tests (the moved extend_* tests) + 2 schema oracle passed, 0 failed; harness regeneration (S/bar2/regen.sh): macOS byte-identical (3,774 lines), Windows byte-identical (9,090 lines). Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z c9d03e2ff4 refactor(bar-core): move the shared statics and Alignment into komorebi-bar-core
Pure move of what every bar module reads and nothing in it depends on: the monitor and label statics of main.rs (MAX_LABEL_WIDTH, MONITOR_LEFT/TOP/RIGHT/INDEX, BAR_HEIGHT, DEFAULT_PADDING, AUTO_SELECT_FILL/TEXT_COLOUR, and the Windows WIDGET_CLICKED flag with its two functions) and the three-variant Alignment of bar.rs. Each bar re-exports them (pub use komorebi_bar_core::statics::*, pub use komorebi_bar_core::alignment::Alignment), so crate::MAX_LABEL_WIDTH and crate::bar::Alignment resolve as before.

The only difference between the trees is that the macOS bar now also has the WIDGET_CLICKED flag and its two functions; nothing in the macOS bar calls them (only the Windows systray widget does), so there is no behaviour change.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core 2 passed, 0 failed. Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z 8ad6213b04 refactor(bar-core): move selected_frame.rs and ui.rs into komorebi-bar-core
Pure move of the two files of the bar that depend on nothing else in it, byte-identical in the Windows and macOS bars (selected_frame.rs since the previous revision). Each bar keeps its paths: main.rs re-exports the modules (pub use komorebi_bar_core::selected_frame / ui), so every crate::selected_frame::... and crate::ui::... in the widgets and bar.rs resolves as before. The crate takes eframe from the workspace; the macOS bar takes the crate by path.

Removed: 111 lines (89 + 22) from each of the two bars, 111 added once.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors (bar warnings 10 -> 6, the four strokes of the previous revision); native cargo test -p komorebi-bar-core 2 passed, 0 failed; harness schema regeneration (S/bar2/regen.sh): macOS byte-identical to its schema.bar.json (3,774 lines), Windows byte-identical to the regenerated schema.bar.json (9,090 lines). Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z eaf43a2ca4 build(bar-core): add the komorebi-bar-core crate with the schema oracle test
Skeleton of the shared bar crate (D25/D26): an empty library and the oracle that every later move of bar code is held to. tests/schema_oracle.rs pins the checked-in schema.bar.json of the Windows bar (9,090 lines, FNV-1a 0x557301341968bff9) and of the macOS bar (3,774 lines, 0xc99e02949424e5d7), so any change to either file, intended or not, fails the test until the pin is updated in a reviewed revision. Once config.rs moves into the crate the test generates the schema and compares it with the file instead.

The pins are of the files as they are after the previous revision (the regenerated Windows file) and are the values the out-of-tree harness (S/bar2/regen.sh over the real sources) reproduces: macOS byte-identical, Windows byte-identical to the regenerated file.

Verified: native cargo test -p komorebi-bar-core: 2 passed, 0 failed; Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors.
2026-10-31 01:37:54 -07:00
LGUG2Z e950c8f967 chore(repo): combine step 3 with the integration line
Merge revision: wip-main (history merges, fixes, step 0, steps 1, 2, 4 and 5, flake work, seam document) and wip-step3 (komorebi-config: matching types, behaviour enums, AspectRatio/PerAnimationPrefixConfig, asc and the application configuration data, placement types, the one StaticConfig with per-platform schema views, the daemons wired to it). Conflicts between step 3's edits and step 4's restructuring of komorebic (the schema-printing arms moved into the WindowsCommands/MacosCommands/KdeCommands matches) and in the Cargo.lock files are resolved here once, instead of through 35 separate rebases.
2026-10-31 01:37:54 -07:00
LGUG2Z fb545cf7a4 test(komorebic-core): the macOS pages in docs/cli are what the command line renders
Renders the macOS command line through komorebic-core (it needs no macOS to do it) and compares every page with komorebi-for-mac/docs/cli after the page transform macOS uses (a heading, 'Usage: komorebic <name>'), and the number of pages. It found the four macOS pages that step 2 left stale (the previous revision regenerates them) and keeps all 158 in step from now on. The test returns early when the macOS tree is not in the source (the nix build of the Windows workspace).

Verified: native cargo test -p komorebic-core --test docs_cli: 1 passed.
2026-10-31 01:37:54 -07:00