aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins/sequence/src/state/positioning.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-02-17 15:43:28 +0100
committerGitHub <noreply@github.com>2026-02-17 15:43:28 +0100
commit4e66a0beff5e41bda1dbde521fa1d2858c46fe7b (patch)
tree380bee5eeac56bea2ebf341cccbe69615585e394 /default-plugins/sequence/src/state/positioning.rs
parentFix startup message and cache file creation (#4705) (diff)
downloadsl0ppij-4e66a0beff5e41bda1dbde521fa1d2858c46fe7b.tar.gz
sl0ppij-4e66a0beff5e41bda1dbde521fa1d2858c46fe7b.tar.xz
sl0ppij-4e66a0beff5e41bda1dbde521fa1d2858c46fe7b.zip
Revamp the sequence plugin (#4713)
* initial pipe interface * initial open_x_pane_in_new_tab plugin api implementation * fix: send CommandPaneExited for command panes opened as initial_terminals in new tabs from plugins * open panes in place of specific pane id plugin commands - initial implementation * sequence and plugin api ux * focus self when starting * combine ui and pipe paths * highlight selected pane * initial sequence removal of editing capabilities * fix: translate plugin paths in api * properly trim commands when loaded from pipe or pasted text * minor ux fixes * get ctrl c to work properly * behavior fixes * more ui fixes * fix tests * close tab and end sequence properly * default to AND * zellij sequence alias * add alias * consolidate paths * rustfmt * fix ui padding * add pr * fix: reset scrolling when resetting terminal state
Diffstat (limited to 'default-plugins/sequence/src/state/positioning.rs')
-rw-r--r--default-plugins/sequence/src/state/positioning.rs49
1 files changed, 0 insertions, 49 deletions
diff --git a/default-plugins/sequence/src/state/positioning.rs b/default-plugins/sequence/src/state/positioning.rs
deleted file mode 100644
index b724df62..00000000
--- a/default-plugins/sequence/src/state/positioning.rs
+++ /dev/null
@@ -1,49 +0,0 @@
-use zellij_tile::prelude::*;
-
-pub fn reposition_plugin_for_sequence(
- plugin_id: u32,
- total_cols: usize,
- total_rows: usize,
- total_commands: usize,
-) {
- // Width: 30% of viewport
- let width = std::cmp::max((total_cols * 30) / 100, 50);
-
- // Height: UI overhead + commands, capped at 25% of viewport
- let overhead_rows = 6;
- let height = (overhead_rows + total_commands).min((total_rows * 25) / 100);
-
- // Position: top-right with 1-space margins
- let x = total_cols.saturating_sub(width);
- let y = 1;
-
- change_floating_pane_coordinates_absolute(
- plugin_id,
- Some(x),
- Some(y),
- Some(width),
- Some(height),
- true,
- );
-}
-
-pub fn change_floating_pane_coordinates_absolute(
- own_plugin_id: u32,
- x: Option<usize>,
- y: Option<usize>,
- width: Option<usize>,
- height: Option<usize>,
- should_be_pinned: bool,
-) {
- let coordinates = FloatingPaneCoordinates::new(
- x.map(|x| x.to_string()),
- y.map(|y| y.to_string()),
- width.map(|width| width.to_string()),
- height.map(|height| height.to_string()),
- Some(should_be_pinned),
- Some(false),
- );
- if let Some(coordinates) = coordinates {
- change_floating_panes_coordinates(vec![(PaneId::Plugin(own_plugin_id), coordinates)]);
- }
-}