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.
This commit is contained in:
Joe Tretter
2026-05-13 17:40:48 -05:00
parent 0fb73f869c
commit dec1340082
3 changed files with 33 additions and 27 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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,
)
}
}
}
}