Tier 0: render what the services already decided, honestly
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -27,6 +27,61 @@ Singleton {
|
||||
property bool postRepairScanPending: false
|
||||
|
||||
readonly property bool actionable: root.status === "warning" || root.status === "error"
|
||||
|
||||
// ── The one health verdict ──────────────────────────────────────────────
|
||||
//
|
||||
// The Health page's hero and the Settings sidebar's footer each used to
|
||||
// work this out themselves, and they disagreed about the order of the
|
||||
// first two questions: the hero asked "is the diagnostic unavailable?"
|
||||
// first, the footer asked "have we got any checks?" first. A snapshot
|
||||
// rejected AFTER a good one satisfies both -- checks are still there,
|
||||
// diagnosticUnavailable is true -- so the same desktop was a red "Health
|
||||
// check unavailable" in the hero and a green "Desktop is healthy" in the
|
||||
// footer, at the same time, six inches apart.
|
||||
//
|
||||
// Unavailable comes first because it is the only state that says the other
|
||||
// four are not known to be true. Everything after it describes checks that
|
||||
// actually ran.
|
||||
readonly property string headlineState: {
|
||||
if (root.diagnosticUnavailable)
|
||||
return "unavailable";
|
||||
if (root.checks.length === 0)
|
||||
return "checking";
|
||||
if (root.status === "error")
|
||||
return "error";
|
||||
if (root.status === "warning")
|
||||
return "warning";
|
||||
return "healthy";
|
||||
}
|
||||
|
||||
// Rendered verbatim by both surfaces. The words match the ones
|
||||
// HealthCheckRow puts on an individual check, so "Needs attention" means
|
||||
// the same thing wherever it appears.
|
||||
readonly property string headline: {
|
||||
switch (root.headlineState) {
|
||||
case "unavailable": return "Health check unavailable";
|
||||
case "checking": return "Checking the desktop";
|
||||
case "error": return "Action required";
|
||||
case "warning": return "Needs attention";
|
||||
default: return "Desktop is healthy";
|
||||
}
|
||||
}
|
||||
|
||||
// "danger" | "warn" | "muted" | "ok". Named rather than a colour: Theme is
|
||||
// a UI concern and this is a service.
|
||||
readonly property string tone: {
|
||||
switch (root.headlineState) {
|
||||
case "unavailable":
|
||||
case "error": return "danger";
|
||||
case "warning": return "warn";
|
||||
case "checking": return "muted";
|
||||
default: return "ok";
|
||||
}
|
||||
}
|
||||
|
||||
// How many checks the headline is about. Zero unless something is wrong,
|
||||
// and shared for the same reason the headline is.
|
||||
readonly property int observationCount: root.summary.warnings + root.summary.errors
|
||||
readonly property bool busy: scanProcess.running || repairProcess.running
|
||||
|| singleCheckProcess.running || root.postRepairScanPending
|
||||
readonly property string helperPath: Quickshell.env("PANAMA_HEALTH_HELPER")
|
||||
@@ -569,6 +624,9 @@ Singleton {
|
||||
summary: root.summary,
|
||||
busy: root.busy,
|
||||
diagnosticUnavailable: root.diagnosticUnavailable,
|
||||
headlineState: root.headlineState,
|
||||
headline: root.headline,
|
||||
tone: root.tone,
|
||||
queuedRefresh: root.queuedRefresh,
|
||||
generation: root.generation,
|
||||
acceptedGeneration: root.acceptedGeneration,
|
||||
|
||||
Reference in New Issue
Block a user