From 2c7c8beb079c5fd58a2e53efd2058df050ad9f55 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Wed, 15 Jul 2026 03:58:07 +0300 Subject: feat: add floating popup panes refs #1125 --- src/app/state.rs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/app/state.rs') diff --git a/src/app/state.rs b/src/app/state.rs index c0f2c8bb..d821407b 100644 --- a/src/app/state.rs +++ b/src/app/state.rs @@ -53,6 +53,14 @@ fn pane_graphics_data_fingerprint(data: &[u8]) -> u64 { hasher.finish() } +#[derive(Clone, Debug, PartialEq, Eq)] +pub(crate) struct PopupPaneState { + pub pane_id: PaneId, + pub terminal_id: crate::terminal::TerminalId, + pub width: Option, + pub height: Option, +} + // --------------------------------------------------------------------------- // Selection autoscroll types // --------------------------------------------------------------------------- @@ -1515,6 +1523,8 @@ pub struct AppState { pub(crate) pane_graphics_streams: std::collections::HashMap, /// Monotonic marker for accepted pane graphics mutations. pub(crate) pane_graphics_revision: u64, + /// Session-modal terminal popup. This is intentionally outside workspace layouts. + pub(crate) popup_pane: Option, /// Recent plugin action/event command executions. pub(crate) plugin_command_logs: Vec, pub(crate) next_plugin_command_log_id: u64, @@ -1608,7 +1618,9 @@ impl AppState { &self, terminal_runtimes: &crate::terminal::TerminalRuntimeRegistry, ) -> bool { - self.mouse_capture || self.focused_pane_requests_mouse_capture_from(terminal_runtimes) + self.mouse_capture + || self.popup_pane.is_some() + || self.focused_pane_requests_mouse_capture_from(terminal_runtimes) } pub fn is_prefix_key(&self, key: crate::input::TerminalKey) -> bool { @@ -1874,6 +1886,7 @@ impl AppState { pane_graphics_layers: std::collections::HashMap::new(), pane_graphics_streams: std::collections::HashMap::new(), pane_graphics_revision: 0, + popup_pane: None, plugin_command_logs: Vec::new(), next_plugin_command_log_id: 1, plugin_commands_in_flight: 0, @@ -2104,6 +2117,19 @@ impl AppState { "pending agent notification", ); } + if let Some(popup) = &self.popup_pane { + assert!( + self.terminals.contains_key(&popup.terminal_id), + "popup {:?} references missing terminal {}", + popup.pane_id, + popup.terminal_id + ); + assert!( + !attached_terminal_ids.contains(&popup.terminal_id), + "popup terminal {} must not be attached to a tiled pane", + popup.terminal_id + ); + } for &pane_id in self.plugin_panes.keys() { assert_live_pane(pane_id, "plugin pane record"); } -- cgit v1.2.3