diff options
| author | Aram Drevekenin <aram@poor.dev> | 2026-02-25 09:48:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-25 09:48:47 +0100 |
| commit | 6e0dd8e51cae440c1453c983740abc6869c46029 (patch) | |
| tree | 7b7a4aaef1fc5df6ad7c56e572aad50f19858f46 /zellij-utils/src | |
| parent | fix: respect user's cursor choice in web client even when terminal overrides ... (diff) | |
| download | sl0ppij-6e0dd8e51cae440c1453c983740abc6869c46029.tar.gz sl0ppij-6e0dd8e51cae440c1453c983740abc6869c46029.tar.xz sl0ppij-6e0dd8e51cae440c1453c983740abc6869c46029.zip | |
Atomic show hide floating panes (#4764)
* atomic show/hide floating panes (cli, plugin API, keybinding)
* rustfmt
* add pr
Diffstat (limited to 'zellij-utils/src')
| -rw-r--r-- | zellij-utils/src/cli.rs | 14 | ||||
| -rw-r--r-- | zellij-utils/src/client_server_contract/common_types.proto | 8 | ||||
| -rw-r--r-- | zellij-utils/src/data.rs | 6 | ||||
| -rw-r--r-- | zellij-utils/src/input/actions.rs | 14 | ||||
| -rw-r--r-- | zellij-utils/src/ipc/protobuf_conversion.rs | 47 | ||||
| -rw-r--r-- | zellij-utils/src/kdl/mod.rs | 30 | ||||
| -rw-r--r-- | zellij-utils/src/plugin_api/action.proto | 12 | ||||
| -rw-r--r-- | zellij-utils/src/plugin_api/action.rs | 37 | ||||
| -rw-r--r-- | zellij-utils/src/plugin_api/plugin_command.proto | 26 | ||||
| -rw-r--r-- | zellij-utils/src/plugin_api/plugin_command.rs | 62 |
10 files changed, 231 insertions, 25 deletions
diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs index 7b64e147..f8bf79ac 100644 --- a/zellij-utils/src/cli.rs +++ b/zellij-utils/src/cli.rs @@ -905,6 +905,20 @@ pub enum CliAction { TogglePaneEmbedOrFloating, /// Toggle the visibility of all floating panes in the current Tab, open one if none exist ToggleFloatingPanes, + /// Show all floating panes in the specified tab (or active tab if tab_id is not provided). + /// + /// Returns exit code 0 if state was changed, 2 if already visible, 1 if tab not found. + ShowFloatingPanes { + #[clap(short, long, value_parser)] + tab_id: Option<usize>, + }, + /// Hide all floating panes in the specified tab (or active tab if tab_id is not provided). + /// + /// Returns exit code 0 if state was changed, 2 if already hidden, 1 if tab not found. + HideFloatingPanes { + #[clap(short, long, value_parser)] + tab_id: Option<usize>, + }, /// Close the focused pane. ClosePane, /// Renames the focused pane diff --git a/zellij-utils/src/client_server_contract/common_types.proto b/zellij-utils/src/client_server_contract/common_types.proto index 3a9e854b..46f1b812 100644 --- a/zellij-utils/src/client_server_contract/common_types.proto +++ b/zellij-utils/src/client_server_contract/common_types.proto @@ -241,6 +241,8 @@ message Action { RenameTabByIdAction rename_tab_by_id = 103; ListTabsAction list_tabs = 104; CurrentTabInfoAction current_tab_info = 105; + ShowFloatingPanesAction show_floating_panes = 106; + HideFloatingPanesAction hide_floating_panes = 107; } } @@ -269,6 +271,12 @@ message TogglePaneFramesAction {} message ToggleActiveSyncTabAction {} message TogglePaneEmbedOrFloatingAction {} message ToggleFloatingPanesAction {} +message ShowFloatingPanesAction { + optional uint32 tab_id = 1; +} +message HideFloatingPanesAction { + optional uint32 tab_id = 1; +} message CloseFocusAction {} message UndoRenamePaneAction {} message NoOpAction {} diff --git a/zellij-utils/src/data.rs b/zellij-utils/src/data.rs index 675cbcfe..74dfdfe7 100644 --- a/zellij-utils/src/data.rs +++ b/zellij-utils/src/data.rs @@ -3461,6 +3461,12 @@ pub enum PluginCommand { OpenCommandPaneInPlaceOfPaneId(PaneId, CommandToRun, bool, Context), // bool = close_replaced_pane OpenTerminalPaneInPlaceOfPaneId(PaneId, FileToOpen, bool), OpenEditPaneInPlaceOfPaneId(PaneId, FileToOpen, bool, Context), + HideFloatingPanes { + tab_id: Option<usize>, + }, + ShowFloatingPanes { + tab_id: Option<usize>, + }, } // Response type for plugin API methods that open a pane in a new tab diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs index 025b0535..2841ea53 100644 --- a/zellij-utils/src/input/actions.rs +++ b/zellij-utils/src/input/actions.rs @@ -273,6 +273,14 @@ pub enum Action { TogglePaneEmbedOrFloating, /// Toggle the visibility of all floating panes (if any) in the current Tab ToggleFloatingPanes, + /// Show all floating panes in the specified tab (or active tab if tab_id is None) + ShowFloatingPanes { + tab_id: Option<usize>, + }, + /// Hide all floating panes in the specified tab (or active tab if tab_id is None) + HideFloatingPanes { + tab_id: Option<usize>, + }, /// Close the focus pane. CloseFocus, PaneNameInput { @@ -941,6 +949,12 @@ impl Action { CliAction::SwitchMode { input_mode } => Ok(vec![Action::SwitchToMode { input_mode }]), CliAction::TogglePaneEmbedOrFloating => Ok(vec![Action::TogglePaneEmbedOrFloating]), CliAction::ToggleFloatingPanes => Ok(vec![Action::ToggleFloatingPanes]), + CliAction::ShowFloatingPanes { tab_id } => { + Ok(vec![Action::ShowFloatingPanes { tab_id }]) + }, + CliAction::HideFloatingPanes { tab_id } => { + Ok(vec![Action::HideFloatingPanes { tab_id }]) + }, CliAction::ClosePane => Ok(vec![Action::CloseFocus]), CliAction::RenamePane { name } => Ok(vec