summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/layout
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-30 14:04:48 -0500
committeradamdottv <[email protected]>2025-06-30 14:04:56 -0500
commit5a107b275ce784405d7ff68e193499e8822fe90d (patch)
tree0b827be922641c6b95631c47758c3a6aed373716 /packages/tui/internal/layout
parentdd5736fe5fc463a52d5a82bf513fbcb6b8ae08fd (diff)
downloadopencode-5a107b275ce784405d7ff68e193499e8822fe90d.tar.gz
opencode-5a107b275ce784405d7ff68e193499e8822fe90d.zip
fix(tui): layout issues
Diffstat (limited to 'packages/tui/internal/layout')
-rw-r--r--packages/tui/internal/layout/flex.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/packages/tui/internal/layout/flex.go b/packages/tui/internal/layout/flex.go
index f164a03dc..c7d9ee1bc 100644
--- a/packages/tui/internal/layout/flex.go
+++ b/packages/tui/internal/layout/flex.go
@@ -73,10 +73,7 @@ func Render(opts FlexOptions, items ...FlexItem) string {
}
// Calculate available space for grow items
- availableSpace := mainAxisSize - totalFixedSize
- if availableSpace < 0 {
- availableSpace = 0
- }
+ availableSpace := max(mainAxisSize-totalFixedSize, 0)
// Calculate size for each grow item
growItemSize := 0
@@ -164,10 +161,7 @@ func Render(opts FlexOptions, items ...FlexItem) string {
}
// Apply justification
- remainingSpace := mainAxisSize - totalActualSize
- if remainingSpace < 0 {
- remainingSpace = 0
- }
+ remainingSpace := max(mainAxisSize-totalActualSize, 0)
// Calculate spacing based on justification
var spaceBefore, spaceBetween, spaceAfter int