diff options
| author | Aram Drevekenin <aram@poor.dev> | 2025-12-23 13:41:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-23 13:41:56 +0100 |
| commit | 3fe48a972c55537502128779116d38d8f8aedb7e (patch) | |
| tree | 350386442db2a46e1d8ba3d9d4dd0c7d53b34c13 /zellij-utils/assets | |
| parent | Read only web tokens (#4551) (diff) | |
| download | sl0ppij-3fe48a972c55537502128779116d38d8f8aedb7e.tar.gz sl0ppij-3fe48a972c55537502128779116d38d8f8aedb7e.tar.xz sl0ppij-3fe48a972c55537502128779116d38d8f8aedb7e.zip | |
Feature: allow overriding a layout for a currently running tab (change layout at runtime) (#4566)
* add tests for LayoutApplier
* initial untested implementation of override functions
* add override-layout cli action with stub in screen
* filter run instructions to ignore
* implement override-layout roundtrip through plugin and pty threads
* initial full-cycle working override implementation
* fix some bugs (eg. actually start new terminals)
* fix some bugs with focus after override
* fix floating pane matching bug in layout applier
* formatting
* use first tab, error on more than 1 tab
* fix some floating_panes ordering and shell issues
* get new tab name to work
* respect swap layouts
* allow specifying tab properties on main layout node if we just have one tab
* add tests for new override methods
* start work on retaining panes, hard-coded things, kind of working but broken in many places
* fixed most tiled pane override bugs
* reset viewport before reapplying
* revert constraint system changes
* retain-existing-terminal-panes flag
* add retain terminal panes tests
* add retain plugin panes flag
* add keybind
* add retain plugin panes tests
* add override-layout e2e test
* refactor: layout_applier
* style: rustfmt
* some cleanups
* fix cli flags
* no crashy
* formatting and artifacts
* moar cleanups
* fix: respect expanded in stack when overriding
* docs(changelog): add PR
Diffstat (limited to 'zellij-utils/assets')
14 files changed, 45 insertions, 2 deletions
diff --git a/zellij-utils/assets/plugins/about.wasm b/zellij-utils/assets/plugins/about.wasm Binary files differindex ae99b4a1..812659bc 100755 --- a/zellij-utils/assets/plugins/about.wasm +++ b/zellij-utils/assets/plugins/about.wasm diff --git a/zellij-utils/assets/plugins/compact-bar.wasm b/zellij-utils/assets/plugins/compact-bar.wasm Binary files differindex 0d6ab290..75f94c4b 100755 --- a/zellij-utils/assets/plugins/compact-bar.wasm +++ b/zellij-utils/assets/plugins/compact-bar.wasm diff --git a/zellij-utils/assets/plugins/configuration.wasm b/zellij-utils/assets/plugins/configuration.wasm Binary files differindex b448d343..ffa97232 100755 --- a/zellij-utils/assets/plugins/configuration.wasm +++ b/zellij-utils/assets/plugins/configuration.wasm diff --git a/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm b/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm Binary files differindex 407f41f1..cd74ed1d 100755 --- a/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm +++ b/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm diff --git a/zellij-utils/assets/plugins/multiple-select.wasm b/zellij-utils/assets/plugins/multiple-select.wasm Binary files differindex 77f0310b..4412b8df 100755 --- a/zellij-utils/assets/plugins/multiple-select.wasm +++ b/zellij-utils/assets/plugins/multiple-select.wasm diff --git a/zellij-utils/assets/plugins/plugin-manager.wasm b/zellij-utils/assets/plugins/plugin-manager.wasm Binary files differindex 5c9fb461..cb8e2239 100755 --- a/zellij-utils/assets/plugins/plugin-manager.wasm +++ b/zellij-utils/assets/plugins/plugin-manager.wasm diff --git a/zellij-utils/assets/plugins/sequence.wasm b/zellij-utils/assets/plugins/sequence.wasm Binary files differindex 0a982532..d6286cb0 100755 --- a/zellij-utils/assets/plugins/sequence.wasm +++ b/zellij-utils/assets/plugins/sequence.wasm diff --git a/zellij-utils/assets/plugins/session-manager.wasm b/zellij-utils/assets/plugins/session-manager.wasm Binary files differindex 0a8460d0..ff97eb14 100755 --- a/zellij-utils/assets/plugins/session-manager.wasm +++ b/zellij-utils/assets/plugins/session-manager.wasm diff --git a/zellij-utils/assets/plugins/share.wasm b/zellij-utils/assets/plugins/share.wasm Binary files differindex 360e55a2..ed580f3f 100755 --- a/zellij-utils/assets/plugins/share.wasm +++ b/zellij-utils/assets/plugins/share.wasm diff --git a/zellij-utils/assets/plugins/status-bar.wasm b/zellij-utils/assets/plugins/status-bar.wasm Binary files differindex ac1b076a..98e8e647 100755 --- a/zellij-utils/assets/plugins/status-bar.wasm +++ b/zellij-utils/assets/plugins/status-bar.wasm diff --git a/zellij-utils/assets/plugins/strider.wasm b/zellij-utils/assets/plugins/strider.wasm Binary files differindex ec6de885..c33e5e2f 100755 --- a/zellij-utils/assets/plugins/strider.wasm +++ b/zellij-utils/assets/plugins/strider.wasm diff --git a/zellij-utils/assets/plugins/tab-bar.wasm b/zellij-utils/assets/plugins/tab-bar.wasm Binary files differindex 4a31b561..609fa718 100755 --- a/zellij-utils/assets/plugins/tab-bar.wasm +++ b/zellij-utils/assets/plugins/tab-bar.wasm diff --git a/zellij-utils/assets/prost/api.action.rs b/zellij-utils/assets/prost/api.action.rs index 46435021..ccf96860 100644 --- a/zellij-utils/assets/prost/api.action.rs +++ b/zellij-utils/assets/prost/api.action.rs @@ -257,10 +257,28 @@ pub struct NewTabPayload { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct OverrideLayoutPayload { + #[prost(message, optional, tag="1")] + pub tiled_layout: ::core::option::Option<TiledPaneLayout>, + #[prost(message, repeated, tag="2")] + pub floating_layouts: ::prost::alloc::vec::Vec<FloatingPaneLayout>, + #[prost(message, repeated, tag="3")] + pub swap_tiled_layouts: ::prost::alloc::vec::Vec<SwapTiledLayout>, + #[prost(message, repeated, tag="4")] + pub swap_floating_layouts: ::prost::alloc::vec::Vec<SwapFloatingLayout>, + #[prost(string, optional, tag="5")] + pub tab_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(bool, tag="10")] + pub retain_existing_terminal_panes: bool, + #[prost(bool, tag="11")] + pub retain_existing_plugin_panes: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Action { #[prost(enumeration="ActionName", tag="1")] pub name: i32, - #[prost(oneof="action::OptionalPayload", tags="2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52")] + #[prost(oneof="action::OptionalPayload", tags="2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53")] pub optional_payload: ::core::option::Option<action::OptionalPayload>, } /// Nested message and enum types in `Action`. @@ -364,6 +382,8 @@ pub mod action { NewTabPayload(super::NewTabPayload), #[prost(message, tag="52")] NewInPlacePanePayload(super::NewInPlacePanePayload), + #[prost(message, tag="53")] + OverrideLayoutPayload(super::OverrideLayoutPayload), } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -994,6 +1014,7 @@ pub enum ActionName { SwitchSession = 90, NewBlockingPane = 91, NewInPlacePane = 92, + OverrideLayout = 93, } impl ActionName { /// String value of the enum field names used in the ProtoBuf definition. @@ -1092,6 +1113,7 @@ impl ActionName { ActionName::SwitchSession => "SwitchSession", ActionName::NewBlockingPane => "NewBlockingPane", ActionName::NewInPlacePane => "NewInPlacePane", + ActionName::OverrideLayout => "OverrideLayout", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1187,6 +1209,7 @@ impl ActionName { "SwitchSession" => Some(Self::SwitchSession), "NewBlockingPane" => Some(Self::NewBlockingPane), "NewInPlacePane" => Some(Self::NewInPlacePane), + "OverrideLayout" => Some(Self::OverrideLayout), _ => None, } } diff --git a/zellij-utils/assets/prost_ipc/client_server_contract.rs b/zellij-utils/assets/prost_ipc/client_server_contract.rs index 32031dba..b0a9be5b 100644 --- a/zellij-utils/assets/prost_ipc/client_server_contract.rs +++ b/zellij-utils/assets/prost_ipc/client_server_contract.rs @@ -119,7 +119,7 @@ pub struct RgbColor { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Action { - #[prost(oneof="action::ActionType", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93")] + #[prost(oneof="action::ActionType", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94")] pub action_type: ::core::option::Option<action::ActionType>, } /// Nested message and enum types in `Action`. @@ -313,6 +313,8 @@ pub mod action { SwitchSession(super::SwitchSessionAction), #[prost(message, tag="93")] NewBlockingPane(super::NewBlockingPaneAction), + #[prost(message, tag="94")] + OverrideLayout(super::OverrideLayoutAction), } } // Action message definitions (all 92 variants) @@ -464,6 +466,24 @@ pub struct NextSwapLayoutAction { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct OverrideLayoutAction { + #[prost(message, optional, tag="1")] + pub tiled_layout: ::core::option::Option<TiledPaneLayout>, + #[prost(message, repeated, tag="2")] + pub floating_layouts: ::prost::alloc::vec::Vec<FloatingPaneLayout>, + #[prost(message, repeated, tag="3")] + pub swap_tiled_layouts: ::prost::alloc::vec::Vec<SwapTiledLayout>, + #[prost(message, repeated, tag="4")] + pub swap_floating_layouts: ::prost::alloc::vec::Vec<SwapFloatingLayout>, + #[prost(string, optional, tag="5")] + pub tab_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(bool, tag="6")] + pub retain_existing_terminal_panes: bool, + #[prost(bool, tag="7")] + pub retain_existing_plugin_panes: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTabNamesAction { } #[allow(clippy::derive_partial_eq_without_eq)] |
