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
@@ -4,10 +4,16 @@
// PrivacyLiveTile {
// glyph: "\u{F0100}"
// label: "Camera"
// measured: PrivacyState.initialized
// active: PrivacyState.cameraActive
// app: PrivacyState.cameraApp
// }
//
// Three states, not two. `active` is false both when nothing is using the
// camera and when nobody has looked -- PrivacyState's probe is pw-dump, which
// is absent on a machine without PipeWire's tools and leaves every flag at its
// default false -- so `measured` says which of the two "Idle" would have meant.
//
// Deliberately still. An indicator that pulses or fades is reporting the same
// fact over and over at sixty frames a second, and this one sits on a settings
// page that may be open for a long time -- the border and the warn-toned line
@@ -22,14 +28,25 @@ Rectangle {
property string glyph: ""
property string label: ""
property bool active: false
// Whether anything has actually been read. False until the first probe
// lands, and false forever if the probe cannot run at all.
property bool measured: false
// The application name PipeWire reported, which is often empty even while
// a stream is plainly running.
property string app: ""
// Not `state`: Item already owns that name.
readonly property string useLine: root.active
? "In use by " + (root.app !== "" ? root.app : "an application")
: "Idle"
readonly property string useLine: {
if (root.active)
return "In use by " + (root.app !== "" ? root.app : "an application");
return root.measured ? "Idle" : "Not measured";
}
// The neutral third state is neutral in the colour too: warn means in use,
// dim means idle, and "not measured" must not read as either.
readonly property color toneColor: root.active
? Theme.warn
: (root.measured ? Theme.fgDim : Theme.fgMuted)
implicitHeight: 56
radius: Theme.cardRadius
@@ -46,7 +63,7 @@ Rectangle {
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: root.glyph
color: root.active ? Theme.warn : Theme.fgDim
color: root.toneColor
font.family: Theme.fontMono
font.pixelSize: 17
}
@@ -72,7 +89,7 @@ Rectangle {
Text {
width: parent.width
text: root.useLine
color: root.active ? Theme.warn : Theme.fgDim
color: root.toneColor
font.family: Theme.fontFamily
font.pixelSize: Math.max(9, Theme.fontSizeSmall - 1)
elide: Text.ElideRight