android: complete the status-palette port onto main's tree

The recovered commit gave every status one colour, but it predates main's split of the run
view and main's own cyan 'waiting' colour. Resolution: keep main's Waiting, keep the run
view's own file (main already has RunSummaryTab), and carry the parts that were genuinely
missing - RunState.Blocked and RunState.Skipped with their words, glyphs and one colour
each - so the palette and the enum agree.
This commit is contained in:
2026-10-18 00:03:29 +01:00
parent 8411d47b29
commit 87856eaaf0
2 changed files with 13 additions and 6 deletions
@@ -10,6 +10,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.DirectionsRun
import androidx.compose.material.icons.automirrored.filled.HelpOutline
import androidx.compose.material.icons.filled.Block
import androidx.compose.material.icons.filled.Bolt
import androidx.compose.material.icons.filled.Cancel
import androidx.compose.material.icons.filled.CheckCircle
@@ -17,6 +18,7 @@ import androidx.compose.material.icons.filled.Error
import androidx.compose.material.icons.filled.FrontHand
import androidx.compose.material.icons.filled.PauseCircle
import androidx.compose.material.icons.filled.Schedule
import androidx.compose.material.icons.filled.SkipNext
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -48,6 +50,8 @@ enum class RunState(val label: String) {
Failed("failed"),
Canceled("canceled"),
Interrupted("interrupted"),
Blocked("blocked"),
Skipped("skipped"),
Active("active"),
Unknown("unknown"),
}
@@ -67,6 +71,8 @@ fun runStateOf(status: String): RunState = when (status.trim().lowercase()) {
"failed", "error" -> RunState.Failed
"canceled", "cancelled" -> RunState.Canceled
"interrupted" -> RunState.Interrupted
"blocked" -> RunState.Blocked
"skipped" -> RunState.Skipped
else -> RunState.Unknown
}
@@ -86,6 +92,8 @@ fun runStateIcon(state: RunState): ImageVector = when (state) {
RunState.Failed -> Icons.Default.Error
RunState.Canceled -> Icons.Default.Cancel
RunState.Interrupted -> Icons.Default.PauseCircle
RunState.Blocked -> Icons.Default.Block
RunState.Skipped -> Icons.Default.SkipNext
RunState.Active -> Icons.Default.Bolt
RunState.Unknown -> Icons.AutoMirrored.Filled.HelpOutline
}
@@ -60,12 +60,12 @@ internal object RunStatusPalette {
Entry(Color(0xFF9AA6A2), "neutral grey: waiting, clearly not the in-progress blue")
/**
* Parked on a person: violet, distinct from the in-progress blue, the queued
* grey and the amber operator-stop, so a run needing a decision is unmistakable.
* Parked on a person (a human decision): distinct from the in-progress blue, the
* queued grey and the amber operator-stop, so a run needing a decision is
* unmistakable. Blocked and skipped are stage outcomes rather than run states:
* a stage that could not proceed is orange, and one deliberately not run is a
* quiet grey-blue - neither is a failure.
*/
private val Waiting =
Entry(Color(0xFFC0A3F5), "violet: parked for the operator's decision; not running, not a stop")
/** Blocked: a stage that could not proceed — a warm amber/orange, never failure red. */
private val Blocked =
Entry(Color(0xFFF0A35E), "orange: a blocked stage could not proceed; not the failure red")
@@ -90,7 +90,6 @@ internal object RunStatusPalette {
RunState.Interrupted -> Interrupted
RunState.Canceled -> Canceled
RunState.Queued -> Queued
RunState.Waiting -> Waiting
RunState.Blocked -> Blocked
RunState.Skipped -> Skipped
RunState.Unknown -> Unknown