From ecb7f4f2c536483b4a42e823c9cf2d289392088a Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Thu, 21 May 2026 02:15:59 +0800 Subject: [PATCH] fix: add 3-way horizontal split variant and fix file manager overflow in split view (#796) Adds a "3-Way (H)" layout option (2 top + 1 bottom) alongside the existing "3-Way (V)" (1 left + 2 right). Fixes file manager content overflowing its split pane by adding min-h-0 to nested flex containers that were missing it. --- src/types/ui-types.ts | 1 + src/ui/features/file-manager/FileManager.tsx | 4 +-- src/ui/lib/theme.ts | 5 ++- src/ui/shell/SplitView.tsx | 32 ++++++++++++++++++++ src/ui/sidebar/SplitScreenPanel.tsx | 9 ++++++ 5 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/types/ui-types.ts b/src/types/ui-types.ts index 8e0fba68..62c2bbd6 100644 --- a/src/types/ui-types.ts +++ b/src/types/ui-types.ts @@ -272,6 +272,7 @@ export type SplitMode = | "none" | "2-way" | "3-way" + | "3-way-horizontal" | "4-way" | "5-way" | "6-way"; diff --git a/src/ui/features/file-manager/FileManager.tsx b/src/ui/features/file-manager/FileManager.tsx index a16a1e2c..8f799b2f 100644 --- a/src/ui/features/file-manager/FileManager.tsx +++ b/src/ui/features/file-manager/FileManager.tsx @@ -2551,7 +2551,7 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) { return (
-
+
= { none: 0, "2-way": 2, "3-way": 3, + "3-way-horizontal": 3, "4-way": 4, "5-way": 5, "6-way": 6, @@ -117,6 +119,7 @@ export const PANE_LAYOUTS: Record = { none: "", "2-way": "grid-cols-2 grid-rows-1", "3-way": "grid-cols-2 grid-rows-2", + "3-way-horizontal": "grid-cols-2 grid-rows-2", "4-way": "grid-cols-2 grid-rows-2", "5-way": "grid-cols-3 grid-rows-2", "6-way": "grid-cols-3 grid-rows-2", diff --git a/src/ui/shell/SplitView.tsx b/src/ui/shell/SplitView.tsx index 30d614e8..03849ef3 100644 --- a/src/ui/shell/SplitView.tsx +++ b/src/ui/shell/SplitView.tsx @@ -19,6 +19,8 @@ function defaultSizes(mode: SplitMode): { return { rowSizes: [100], rowColSizes: [[50, 50]] }; case "3-way": return { rowSizes: [50, 50], rowColSizes: [[50, 50], [100]] }; + case "3-way-horizontal": + return { rowSizes: [50, 50], rowColSizes: [[50, 50], [100]] }; case "4-way": return { rowSizes: [50, 50], @@ -444,6 +446,36 @@ export function SplitView({
)} + {splitMode === "3-way-horizontal" && ( +
+
+
+ {pane(0)} +
+ onColDivider(e, 0, 0)} + onTouchStart={(e) => onColDividerTouch(e, 0, 0)} + /> +
+ {pane(1)} +
+
+ onRowDivider(e, 0)} + onTouchStart={(e) => onRowDividerTouch(e, 0)} + /> +
+ {pane(2)} +
+
+ )} + {splitMode === "4-way" && (
diff --git a/src/ui/sidebar/SplitScreenPanel.tsx b/src/ui/sidebar/SplitScreenPanel.tsx index 115f367c..3c6ce838 100644 --- a/src/ui/sidebar/SplitScreenPanel.tsx +++ b/src/ui/sidebar/SplitScreenPanel.tsx @@ -24,6 +24,15 @@ const LAYOUT_PREVIEWS: Record = {
), + "3-way-horizontal": ( +
+
+
+
+
+
+
+ ), "4-way": (