Stage 3 and 4 of docs/superpowers/plans/2026-08-17-panama-cohesion.md. Add SettingsPage plus ToggleRow, SliderRow, ChoiceRow, ActionRow, and TextRow. A row names a schema key and needs nothing else: label, detail, range, and unit come from PreferenceSchema, and writes go through SystemSettings.commitPreference, which routes compositor-backed keys through apply-and-verify and local keys straight to the store. The page scaffold that was copy-pasted eleven times is now one component. Rebuild Appearance around a live preview of the real desktop, scaled by the ratio between the preview and the actual monitor so a 10px gap on a 4500px display looks as small as it is. Rebuild Desktop & Dock and Input & Shortcuts on the shared rows, replacing the read-only text that stood in for controls that were merely expensive to add. Generate the shortcut list from hyprctl binds. The page held a hand-typed nineteen entries against a real keymap of a hundred and thirteen; it could not show the rest and went stale whenever a bind changed. Every bind now carries its own description -- backfilled for the twenty-nine that lacked one -- and keybinds-contract.sh fails if any bind lacks one, since undescribed binds are dropped from the page. Make Restore defaults span every store Panama owns. Resetting only the schema store left the Home accessory arrangement customised while claiming to restore defaults, which is worse than no reset because it is silent. Done through HomePreferences' existing public aliases rather than a new API. Four defects found while building: cursor:inactive_timeout is answered by getoption as float, not int. A wrong readAs does not fail loudly; it makes every write to that key look rejected, and the user saw an error for a change that worked. schema-hypr-shape-contract.sh now checks all 23 mapped options against the running compositor. The Settings window is tiled, so implicitWidth is only a hint and rows must survive roughly 400px. SliderRow stacks its control under the label below 520px. Binding an anchor to undefined to switch layouts does not reliably release it. Both row layouts are positioned explicitly. Concurrent compositor writes are queued and merged rather than refused. The startup replay of every compositor-backed preference routinely overlaps a UI change, and refusing left the store and the compositor disagreeing. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
75 lines
2.7 KiB
QML
75 lines
2.7 KiB
QML
import Quickshell
|
|
import Quickshell.Io
|
|
import QtQuick
|
|
|
|
import qs.config
|
|
import qs.services
|
|
|
|
ShellRoot {
|
|
IpcHandler {
|
|
target: "settings-system-test"
|
|
|
|
function refresh(): void { SystemSettings.refresh(); }
|
|
|
|
// One batch, matching how the shell applies persisted policy. Three
|
|
// separate setters would be refused as overlapping writes, since each
|
|
// one is only complete after its value has been read back.
|
|
function apply(autoHdr: bool, vrr: int, directScanout: int): void {
|
|
SystemSettings.applyOptions({
|
|
autoHdr: autoHdr,
|
|
vrrPolicy: vrr,
|
|
directScanoutPolicy: directScanout
|
|
});
|
|
}
|
|
|
|
// Applies an arbitrary batch of schema keys, so the contract can cover
|
|
// every getoption answer shape -- int, bool, float, str, and the css
|
|
// box that gaps read back as -- not just the display policies.
|
|
function applyJson(payload: string): bool {
|
|
return SystemSettings.applyOptions(JSON.parse(payload));
|
|
}
|
|
|
|
// The routing entry point the settings rows use: a compositor-backed
|
|
// key must be applied and verified before it is stored, a local one is
|
|
// written directly. The contract checks both halves.
|
|
function commit(key: string, payload: string): bool {
|
|
return SystemSettings.commitPreference(key, JSON.parse(payload));
|
|
}
|
|
|
|
function stored(key: string): string {
|
|
return JSON.stringify(DesktopPreferences.get(key));
|
|
}
|
|
|
|
function seedHome(): void {
|
|
HomePreferences.favorites = [{ id: "light.contract_probe", alias: "Probe" }];
|
|
HomePreferences.initialized = true;
|
|
}
|
|
|
|
function homeState(): string {
|
|
return JSON.stringify({
|
|
count: HomePreferences.favorites.length,
|
|
initialized: HomePreferences.initialized
|
|
});
|
|
}
|
|
|
|
function restoreDefaults(): void { SystemSettings.restoreDefaults(); }
|
|
|
|
function panelAllowed(panel: string): bool {
|
|
return SystemSettings.isGnomePanelAllowed(panel);
|
|
}
|
|
|
|
function status(): string {
|
|
return JSON.stringify({
|
|
monitorName: SystemSettings.monitorName,
|
|
monitorDescription: SystemSettings.monitorDescription,
|
|
width: SystemSettings.monitorWidth,
|
|
height: SystemSettings.monitorHeight,
|
|
scale: SystemSettings.monitorScale,
|
|
format: SystemSettings.monitorFormat,
|
|
busy: SystemSettings.busy,
|
|
lastError: SystemSettings.lastError
|
|
});
|
|
}
|
|
}
|
|
}
|