Fix Phone controls runtime accessibility

This commit is contained in:
Gabriel Brown
2026-08-17 19:01:42 -04:00
parent fbf729b25c
commit 3213a0989a
5 changed files with 204 additions and 9 deletions
@@ -0,0 +1,59 @@
import Quickshell
import Quickshell.Io
import QtQuick
import qs.modules.quicksettings
import qs.services
// Component-only diagnostic surface. The contract replaces the two services in
// its copied configuration with fixture singletons before this file is run.
ShellRoot {
PhoneControls {
id: phoneControls
width: 408
}
IpcHandler {
target: "phone-controls-test"
function fixture(name: string): void {
KdeConnect.available = false;
KdeConnect.transferActive = false;
KdeConnect.lastError = "";
if (name === "offline") {
KdeConnect.devices = [{
id: "fixture-phone",
name: "Fixture iPhone",
type: "phone",
paired: true,
reachable: false,
actions: []
}];
} else if (name === "transfer") {
KdeConnect.available = true;
KdeConnect.transferActive = true;
KdeConnect.devices = [{
id: "fixture-phone",
name: "Fixture iPhone",
type: "phone",
paired: true,
reachable: true,
actions: ["share", "clipboard", "ring"]
}];
}
}
function status(): string {
return JSON.stringify({
actions: phoneControls.actionModels.map(action => ({
id: action.id,
enabled: phoneControls.actionEnabled(action.id)
})),
bluebubblesAvailable: SystemSettings.bluebubblesAvailable,
appLaunches: SystemSettings.launchCount,
phoneActions: KdeConnect.actionCount
});
}
}
}