fix layout issue

This commit is contained in:
2026-02-03 12:51:04 -05:00
parent 0702d27166
commit 8f970ed5b4
+24 -32
View File
@@ -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))
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)
(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)]