feat(layout): add tabbed window groups and scrolling columns

This commit is contained in:
Samuel Onoja committed 2026-10-12 23:26:00 +01:00
1 parent 7d58eeb65d
commit bfa78f62f2
27 files changed
+1480 -47

No files matched your search

+17 -2
View File
@@ -70,9 +70,19 @@ pub enum Command {
CycleColumnWidth,
/// Center the focused column.
CenterColumn,
/// Pull a window into the focused column.
/// Toggle the focused scrolling column between stacked windows and tabs.
ToggleColumnTabbed,
/// Join the focused window to the adjacent tab group.
JoinTab { direction: Direction },
/// Split the focused tab out beside its group.
LeaveTab,
/// Focus the next tab in the group.
NextTab,
/// Focus the previous tab in the group.
PreviousTab,
/// Join a neighboring column or tree tab group.
Consume,
/// Move a window out of the focused column.
/// Leave the focused column or tree tab group.
Expel,
/// Close the focused window.
Close,
@@ -244,6 +254,11 @@ impl Command {
Self::ToggleKeybindingGuide => ("toggle-keybinding-guide", json!({})),
Self::CycleColumnWidth => ("cycle-column-width", json!({})),
Self::CenterColumn => ("center-column", json!({})),
Self::ToggleColumnTabbed => ("toggle-column-tabbed", json!({})),
Self::JoinTab { direction } => ("join-tab", json!({"direction": value_name(direction)})),
Self::LeaveTab => ("leave-tab", json!({})),
Self::NextTab => ("next-tab", json!({})),
Self::PreviousTab => ("previous-tab", json!({})),
Self::Consume => ("consume", json!({})),
Self::Expel => ("expel", json!({})),
Self::Close => ("close", json!({})),
+16
View File
@@ -365,6 +365,22 @@ mod tests {
assert!(parse_args(["output-profile".into()]).is_err());
}
#[test]
fn tab_commands_validate_directions_and_reject_extra_arguments() {
for direction in ["left", "right", "up", "down"] {
assert_eq!(
parse_args(["join-tab".into(), direction.into()]).unwrap(),
("join-tab".into(), json!({"direction": direction}))
);
}
assert!(parse_args(["join-tab".into()]).is_err());
assert!(parse_args(["join-tab".into(), "diagonal".into()]).is_err());
for action in ["toggle-column-tabbed", "leave-tab", "next-tab", "previous-tab"] {
assert_eq!(parse_args([action.into()]).unwrap(), (action.into(), json!({})));
assert!(parse_args([action.into(), "extra".into()]).is_err());
}
}
#[test]
fn rejects_unknown_or_missing_arguments() {
assert_eq!(parse_args(["exit".to_owned()]).unwrap(), ("exit".to_owned(), json!({})));