Preserve reviewed incomplete-diff labels before controlled UI acceptance

This commit is contained in:
2026-10-19 00:01:44 +01:00
parent 94b22732dd
commit a724303474
3 changed files with 78 additions and 3 deletions
@@ -247,6 +247,7 @@ internal data class RunChanges(
val partial: Boolean,
val unavailable: Boolean,
val pending: Boolean,
val missingCaptures: Int,
val skipped: Int,
val omitted: Int,
val diagnostic: String,
@@ -273,6 +274,7 @@ internal fun runChanges(steps: List<RunStep>): RunChanges {
var stepsPending = 0
var partial = false
var unavailable = false
var missingCaptures = 0
var skipped = 0
var omitted = 0
val diagnostics = LinkedHashSet<String>()
@@ -281,6 +283,7 @@ internal fun runChanges(steps: List<RunStep>): RunChanges {
val changes = step.fileChanges
if (changes == null) {
if (step.status == "running" || step.status == "waiting") stepsPending++
else missingCaptures++
continue
}
stepsWithChanges++
@@ -338,6 +341,7 @@ internal fun runChanges(steps: List<RunStep>): RunChanges {
partial = totalPartial,
unavailable = unavailable,
pending = pending,
missingCaptures = missingCaptures,
skipped = skipped,
omitted = omitted,
diagnostic = diagnostics.joinToString(" "),
@@ -356,7 +360,9 @@ internal fun runChangesHeader(changes: RunChanges): String {
if (changes.isEmpty) {
return when {
changes.pending -> "Changes · capture pending"
changes.partial -> "Changes · partial capture"
changes.stepsWithChanges == 0 -> "Changes · not recorded for this run"
changes.missingCaptures > 0 -> "Changes · capture incomplete"
else -> "Changes · no changes observed"
}
}
@@ -366,7 +372,11 @@ internal fun runChangesHeader(changes: RunChanges): String {
} else {
"${changes.fileCount} ${if (changes.fileCount == 1) "file" else "files"} changed · $stat"
}
return if (changes.partial) "$label · partial capture" else label
return when {
changes.partial -> "$label · partial capture"
changes.missingCaptures > 0 -> "$label · capture incomplete"
else -> label
}
}
/**
@@ -378,7 +388,6 @@ internal fun runChangesNote(changes: RunChanges): String = when {
changes.unavailable -> changes.diagnostic.ifBlank {
"The workspace snapshot could not be compared; the changes below may be incomplete."
}
changes.isEmpty -> ""
else -> buildString {
if (changes.partial) {
append("Partial capture: some changes may be missing.")
@@ -390,6 +399,12 @@ internal fun runChangesNote(changes: RunChanges): String = when {
if (caveats.isNotEmpty()) append(" (" + caveats.joinToString(", ") + ")")
if (changes.diagnostic.isNotBlank()) append(" ${changes.diagnostic}")
}
if (changes.missingCaptures > 0) {
if (isNotEmpty()) append(" ")
append("Missing capture: ${changes.missingCaptures} ")
append(if (changes.missingCaptures == 1) "stage did" else "stages did")
append(" not record changes.")
}
}.trim()
}