From bc962167b7e9c44cbb9a116dc23b1e8440d7b63d Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Wed, 28 Oct 2026 13:16:48 -0700 Subject: [PATCH] chore(deps): bump komorebi-layouts for the scrolling model komorebi-layouts now carries the platform-free half of the Scrolling layout: the model of a strip of columns, re-exported as komorebi_layouts::scrolling::model, and what a host needs around it, which is the layout options for the model, the placement of containers in a work area, resizing a column or a tile, and the hand-over of column records between workspaces. The center_focused_column layout option of the Scrolling layout is one of Never, Always and OnOverflow there, and a boolean is still read as true for Always and false for Never. The two places here that said true say Always, and the schema and the options for nix say so. This is the revision of the feature/moar-scrolling branch of komorebi that has them. It is pinned by revision until the branch is merged, and komorebi-themes moves with it so that the repository is fetched once. komorebi-scrolling has no license field, so deny.toml clarifies it as it does the other crates of that repository. --- Cargo.lock | 10 ++++++++-- Cargo.toml | 4 ++-- deny.toml | 5 +++++ komorebi/src/core/mod.rs | 1 + komorebi/src/workspace.rs | 4 ++-- nix/komorebi-options.nix | 4 ++-- schema.json | 38 +++++++++++++++++++++++++++++++++----- 7 files changed, 53 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9260377f..0375efc4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3247,10 +3247,11 @@ dependencies = [ [[package]] name = "komorebi-layouts" version = "0.1.42" -source = "git+https://github.com/LGUG2Z/komorebi?rev=f08aa55511d77ca56ab0e789efabeb0a237a463e#f08aa55511d77ca56ab0e789efabeb0a237a463e" +source = "git+https://github.com/LGUG2Z/komorebi?rev=c6a780c6ceb696951765e7d1831bb8e5a8815d86#c6a780c6ceb696951765e7d1831bb8e5a8815d86" dependencies = [ "clap", "color-eyre", + "komorebi-scrolling", "objc2-core-foundation", "schemars 1.2.3", "serde", @@ -3260,10 +3261,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "komorebi-scrolling" +version = "0.1.42" +source = "git+https://github.com/LGUG2Z/komorebi?rev=c6a780c6ceb696951765e7d1831bb8e5a8815d86#c6a780c6ceb696951765e7d1831bb8e5a8815d86" + [[package]] name = "komorebi-themes" version = "0.1.42" -source = "git+https://github.com/LGUG2Z/komorebi?rev=f08aa55511d77ca56ab0e789efabeb0a237a463e#f08aa55511d77ca56ab0e789efabeb0a237a463e" +source = "git+https://github.com/LGUG2Z/komorebi?rev=c6a780c6ceb696951765e7d1831bb8e5a8815d86#c6a780c6ceb696951765e7d1831bb8e5a8815d86" dependencies = [ "base16-egui-themes", "catppuccin-egui", diff --git a/Cargo.toml b/Cargo.toml index 3a414ca2..995f4b88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,8 +13,8 @@ members = [ version = "0.1.0" [workspace.dependencies] -komorebi-themes = { git = "https://github.com/LGUG2Z/komorebi", rev = "f08aa55511d77ca56ab0e789efabeb0a237a463e" } -komorebi-layouts = { git = "https://github.com/LGUG2Z/komorebi", rev = "f08aa55511d77ca56ab0e789efabeb0a237a463e", features = [ +komorebi-themes = { git = "https://github.com/LGUG2Z/komorebi", rev = "c6a780c6ceb696951765e7d1831bb8e5a8815d86" } +komorebi-layouts = { git = "https://github.com/LGUG2Z/komorebi", rev = "c6a780c6ceb696951765e7d1831bb8e5a8815d86", features = [ "darwin", "schemars", ] } diff --git a/deny.toml b/deny.toml index cbf4a412..c4f7d090 100644 --- a/deny.toml +++ b/deny.toml @@ -53,6 +53,11 @@ crate = "komorebi-client" expression = "LicenseRef-Komorebi-2.0" license-files = [] +[[licenses.clarify]] +crate = "komorebi-scrolling" +expression = "LicenseRef-Komorebi-2.0" +license-files = [] + [[licenses.clarify]] crate = "komorebi-layouts" expression = "LicenseRef-Komorebi-2.0" diff --git a/komorebi/src/core/mod.rs b/komorebi/src/core/mod.rs index ecea9d70..c34724d4 100644 --- a/komorebi/src/core/mod.rs +++ b/komorebi/src/core/mod.rs @@ -31,6 +31,7 @@ pub use komorebi_layouts::OperationDirection; pub use komorebi_layouts::Rect; pub use komorebi_layouts::ScrollingLayoutOptions; pub use komorebi_layouts::Sizing; +pub use komorebi_layouts::scrolling::ScrollingCentering; pub use komorebi_layouts::validate_ratios; // Keep local modules that aren't in komorebi-layouts diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 644e691d..b5e3e3e9 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -2996,7 +2996,7 @@ mod tests { layout_options: Some(LayoutOptions { scrolling: Some(ScrollingLayoutOptions { columns: 2, - center_focused_column: Some(true), + center_focused_column: Some(crate::core::ScrollingCentering::Always), }), grid: None, column_ratios: None, @@ -3011,7 +3011,7 @@ mod tests { .layout_options .and_then(|o| o.scrolling) .and_then(|s| s.center_focused_column), - Some(true) + Some(crate::core::ScrollingCentering::Always) ); } diff --git a/nix/komorebi-options.nix b/nix/komorebi-options.nix index 243c853f..9608530d 100644 --- a/nix/komorebi-options.nix +++ b/nix/komorebi-options.nix @@ -211,9 +211,9 @@ let lib.types.submodule { options = { center_focused_column = lib.mkOption { - type = (lib.types.nullOr lib.types.bool); + type = lib.types.anything; default = null; - description = "With an odd number of visible columns, keep the focused window column centered"; + description = "When to centre the focused column: `Never` (the default), `Always`, or `OnOverflow`, which\nis when it does not fit on the screen together with the column that focus came from. A\nboolean is also accepted, where `true` is `Always` and `false` is `Never`"; }; columns = lib.mkOption { type = lib.types.int; diff --git a/schema.json b/schema.json index ca58137d..921c30c5 100644 --- a/schema.json +++ b/schema.json @@ -3395,16 +3395,44 @@ "b" ] }, + "ScrollingCentering": { + "description": "When the Scrolling layout centres the focused column\n\nA boolean is also accepted when reading, for the layout option that used to be one: `true` is\n`Always` and `false` is `Never`.", + "oneOf": [ + { + "description": "Scroll just far enough to bring the focused column into view, and no further", + "type": "string", + "const": "Never" + }, + { + "description": "Keep the focused column in the middle of the screen", + "type": "string", + "const": "Always" + }, + { + "description": "Centre the focused column when it does not fit on the screen together with the column that\nfocus came from", + "type": "string", + "const": "OnOverflow" + } + ] + }, "ScrollingLayoutOptions": { "description": "Options for the Scrolling layout", "type": "object", "properties": { "center_focused_column": { - "description": "With an odd number of visible columns, keep the focused window column centered", - "type": [ - "boolean", - "null" - ] + "description": "When to centre the focused column: `Never` (the default), `Always`, or `OnOverflow`, which\nis when it does not fit on the screen together with the column that focus came from. A\nboolean is also accepted, where `true` is `Always` and `false` is `Never`", + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/$defs/ScrollingCentering" + }, + { + "type": "null" + } + ], + "default": null }, "columns": { "description": "Desired number of visible columns (default: 3)",