Tier 0: render what the services already decided, honestly

Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
Gabriel Brown
2026-08-25 00:24:30 -04:00
parent be0e55214b
commit 8b1205e4b8
38 changed files with 1474 additions and 260 deletions
@@ -54,9 +54,16 @@ SettingsPage {
readonly property string headline: {
if (Updates.checking)
return "Checking every source…";
// "nothing security-critical" is a measurement, not a default. When the
// advisory query did not answer, the page says so instead of saying the
// reassuring thing it would otherwise have said.
const security = Updates.securityCount > 0
? Updates.securityCount + " carrying a security advisory"
: (Updates.total > 0 ? "nothing security-critical" : "");
: (Updates.total > 0
? (Updates.securityKnown
? "nothing security-critical"
: "security advisories could not be read")
: "");
return root.joined([
Updates.summary(), security,
Updates.lastCheckedText().replace("Checked", "checked")
@@ -72,12 +79,17 @@ SettingsPage {
function toggleChangelog(source: string, name: string): void {
const key = source + ":" + name;
root.expandedPackage = root.expandedPackage === key ? "" : key;
const opening = root.expandedPackage !== key;
root.expandedPackage = opening ? key : "";
// The fetch starts here, on the press, not as a side effect of the
// text rendering -- see Updates.changelogFor's comment for the
// binding loop that taught us the difference.
if (opening)
Updates.requestChangelog(source, name);
}
// Asking for a changelog is what starts fetching one -- the page requests
// it by rendering it, and Updates keeps the answer for the life of the
// shell. Null means the fetch is still out.
// Pure read: Updates keeps the answer for the life of the shell, and
// null means the fetch is still out.
function changelogText(source: string, name: string): string {
const record = Updates.changelogFor(source, name);
if (record === null || record === undefined)
@@ -140,7 +152,12 @@ SettingsPage {
SettingsCard {
title: "System packages"
subtitle: Updates.dnf?.available === false
// The failed case comes before the empty one: dnf reporting nothing and
// dnf being unable to report are the same empty list, and only one of
// them means there is nothing waiting.
subtitle: Updates.sourceError("dnf") !== ""
? Updates.sourceError("dnf")
: Updates.dnf?.available === false
? "dnf is not available on this machine."
: (root.packages.length === 0
? "Nothing waiting."
@@ -269,15 +286,25 @@ SettingsPage {
SettingsCard {
title: "Applications & firmware"
// A check that failed is not a machine that is current. "Current" is
// only ever said about a list that was actually read.
TextRow {
visible: Updates.flatpak?.available === false
visible: Updates.sourceError("flatpak") !== ""
label: "Flatpak"
detail: Updates.sourceError("flatpak")
value: "Not checked"
}
TextRow {
visible: Updates.sourceError("flatpak") === "" && Updates.flatpak?.available === false
label: "Flatpak"
detail: "Flatpak is not installed."
value: "Unavailable"
}
TextRow {
visible: Updates.flatpak?.available !== false && root.applications.length === 0
visible: Updates.sourceError("flatpak") === ""
&& Updates.flatpak?.available !== false && root.applications.length === 0
label: "Flatpak"
detail: "Everything current — each application gets its own row when an update appears"
value: "Current"
@@ -350,7 +377,15 @@ SettingsPage {
}
TextRow {
visible: Updates.firmware?.available === false
visible: Updates.sourceError("firmware") !== ""
label: "Firmware"
detail: Updates.sourceError("firmware")
value: "Not checked"
divider: false
}
TextRow {
visible: Updates.sourceError("firmware") === "" && Updates.firmware?.available === false
label: "Firmware"
detail: "Firmware updating is not available on this machine."
value: "Unavailable"
@@ -358,7 +393,8 @@ SettingsPage {
}
TextRow {
visible: Updates.firmware?.available !== false && root.firmwareDevices.length === 0
visible: Updates.sourceError("firmware") === ""
&& Updates.firmware?.available !== false && root.firmwareDevices.length === 0
label: "Firmware"
detail: "No firmware updates are offered for this hardware"
value: "Current"