From 8f970ed5b4790935140e4148aa5c909a8963d696 Mon Sep 17 00:00:00 2001 From: Adam Jeniski Date: Tue, 3 Feb 2026 12:51:04 -0500 Subject: [PATCH] fix layout issue --- src/lazygitclj/core.clj | 68 ++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/src/lazygitclj/core.clj b/src/lazygitclj/core.clj index f9c488c..e7eba43 100644 --- a/src/lazygitclj/core.clj +++ b/src/lazygitclj/core.clj @@ -812,47 +812,39 @@ [:text {:fg :yellow :bold true} (str " " message)])) (defn main-grid-view - "Render the main lazygit-style grid layout using grid primitive." + "Render the main lazygit-style grid layout." [model width height] (let [has-message? (some? (:message model)) - narrow? (< width 70)] - (if narrow? - ;; NARROW: Single column stacked layout - [:col {:width width :height height - :heights (if has-message? - [1 3 :flex :flex :flex :flex :flex 4 1] - [3 :flex :flex :flex :flex :flex 4 1])} - (when has-message? (message-view model)) - (status-panel model) - (files-panel model) - (branches-panel model) - (commits-panel model) - (stash-panel model) - (main-view-panel model) - (command-log-panel) + narrow? (< width 70) + content (if narrow? + ;; NARROW: Single column stacked + [:col {:heights [3 :flex :flex :flex :flex :flex 4]} + (status-panel model) + (files-panel model) + (branches-panel model) + (commits-panel model) + (stash-panel model) + (main-view-panel model) + (command-log-panel)] + ;; WIDE: Two columns using row/col + [:row {:gap 1 :widths [30 :flex]} + [:col {:heights [3 :flex :flex :flex :flex]} + (status-panel model) + (files-panel model) + (branches-panel model) + (commits-panel model) + (stash-panel model)] + [:col {:heights [:flex 4]} + (main-view-panel model) + (command-log-panel)]])] + (if has-message? + [:col {:width width :height height :heights [1 :flex 1]} + (message-view model) + content (help-bar model)] - ;; WIDE: Two columns using grid - [:grid {:rows (if has-message? - [1 3 :flex :flex :flex :flex 4 1] - [3 :flex :flex :flex :flex 4 1]) - :cols [30 :flex] - :gap 1} - ;; Message row spans both columns (if present) - (when has-message? - [:area {:row 0 :col 0 :col-span 2} (message-view model)]) - ;; Left column panels - (let [row-offset (if has-message? 1 0)] - (list - [:area {:row row-offset :col 0} (status-panel model)] - [:area {:row (+ row-offset 1) :col 0} (files-panel model)] - [:area {:row (+ row-offset 2) :col 0} (branches-panel model)] - [:area {:row (+ row-offset 3) :col 0} (commits-panel model)] - [:area {:row (+ row-offset 4) :col 0} (stash-panel model)] - ;; Right column panels (spanning all rows) - [:area {:row row-offset :col 1 :row-span 5} (main-view-panel model)] - [:area {:row (+ row-offset 5) :col 1} (command-log-panel)] - ;; Help bar at bottom, spanning both columns - [:area {:row (+ row-offset 6) :col 0 :col-span 2} (help-bar model)]))]))) + [:col {:width width :height height :heights [:flex 1]} + content + (help-bar model)]))) (defn view [model {:keys [width height] :or {width 120 height 30}}] (let [background (main-grid-view model width height)]