From dec1340082c10b2a10731a6bfaad331971a8c600 Mon Sep 17 00:00:00 2001 From: Joe Tretter Date: Wed, 13 May 2026 17:40:48 -0500 Subject: [PATCH] Remove empty terminal black areas - Hide the terminal output viewport when there are no output lines on a newly loaded level. - Reduce the minimum output history height so short output does not create a large empty black panel. - Use the pane surface color for the app background so normal spacing between cards is not black. --- app/build.gradle.kts | 4 +- .../tretter/githugandroid/GitHugTheme.kt | 4 +- .../tretter/githugandroid/Terminal.kt | 52 +++++++++++-------- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8fd8fdf..ae62177 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -19,8 +19,8 @@ android { applicationId = "solutions.tretter.githugandroid" minSdk = 26 targetSdk = 35 - versionCode = 140 - versionName = "0.1.139" + versionCode = 141 + versionName = "0.1.140" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/solutions/tretter/githugandroid/GitHugTheme.kt b/app/src/main/java/solutions/tretter/githugandroid/GitHugTheme.kt index 3501c90..d58841c 100644 --- a/app/src/main/java/solutions/tretter/githugandroid/GitHugTheme.kt +++ b/app/src/main/java/solutions/tretter/githugandroid/GitHugTheme.kt @@ -3,10 +3,10 @@ package solutions.tretter.githugandroid import androidx.compose.material3.darkColorScheme import androidx.compose.ui.graphics.Color -val AppBackground = Color(0xFF000000) val PanelPrimary = Color(0xFF121212) val PanelSecondary = Color(0xFF1E1E1E) val PanelTertiary = Color(0xFF262626) +val AppBackground = PanelSecondary val TerminalBackground = Color(0xFF050505) val TextPrimary = Color(0xFFFFFFFF) val TextSecondary = Color(0xFFE6E6E6) @@ -26,4 +26,4 @@ val GitHugColorScheme = darkColorScheme( surfaceVariant = PanelSecondary, onSurfaceVariant = TextSecondary, outline = TextMuted, -) \ No newline at end of file +) diff --git a/app/src/main/java/solutions/tretter/githugandroid/Terminal.kt b/app/src/main/java/solutions/tretter/githugandroid/Terminal.kt index 35fa6c9..dd62b4a 100644 --- a/app/src/main/java/solutions/tretter/githugandroid/Terminal.kt +++ b/app/src/main/java/solutions/tretter/githugandroid/Terminal.kt @@ -82,7 +82,11 @@ fun TerminalPane( val reservedControlsHeight = 86.dp val maxOutputHeight = (terminalPaneMaxHeight - reservedControlsHeight).coerceAtLeast(120.dp) val outputLineHeight = 20.dp - val desiredOutputHeight = (output.size.coerceAtLeast(6) * outputLineHeight.value).dp.coerceAtMost(maxOutputHeight) + val hasOutput = output.isNotEmpty() + val desiredOutputHeight = (output.size.coerceAtLeast(1) * outputLineHeight.value) + .dp + .coerceAtLeast(48.dp) + .coerceAtMost(maxOutputHeight) LaunchedEffect(inputFieldVersion) { outputHorizontalScroll.scrollTo(0) @@ -120,28 +124,30 @@ fun TerminalPane( .widthIn(min = terminalMinWidth), verticalArrangement = Arrangement.spacedBy(8.dp), ) { - Box( - modifier = Modifier - .heightIn(min = 200.dp, max = maxOutputHeight) - .height(desiredOutputHeight) - .fillMaxWidth() - .background(PanelPrimary, RoundedCornerShape(10.dp)) - .padding(8.dp) - .horizontalScroll(outputHorizontalScroll) - .verticalScroll(outputVerticalScroll), - ) { - SelectionContainer { - Column( - modifier = Modifier.widthIn(min = terminalMinWidth), - verticalArrangement = Arrangement.spacedBy(4.dp), - ) { - output.forEach { line -> - Text( - text = line, - color = if (line.startsWith("✔") || line.startsWith("🏁")) Success else TextSecondary, - fontFamily = FontFamily.Monospace, - softWrap = false, - ) + if (hasOutput) { + Box( + modifier = Modifier + .heightIn(max = maxOutputHeight) + .height(desiredOutputHeight) + .fillMaxWidth() + .background(PanelPrimary, RoundedCornerShape(10.dp)) + .padding(8.dp) + .horizontalScroll(outputHorizontalScroll) + .verticalScroll(outputVerticalScroll), + ) { + SelectionContainer { + Column( + modifier = Modifier.widthIn(min = terminalMinWidth), + verticalArrangement = Arrangement.spacedBy(4.dp), + ) { + output.forEach { line -> + Text( + text = line, + color = if (line.startsWith("✔") || line.startsWith("🏁")) Success else TextSecondary, + fontFamily = FontFamily.Monospace, + softWrap = false, + ) + } } } }