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
58 lines
2.1 KiB
Bash
Executable File
58 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Every schema entry with a `hypr` block declares `readAs`: which JSON field
|
|
# `hyprctl getoption` answers with for that option. Verification compares
|
|
# against that field, so a wrong declaration does not fail loudly -- it makes
|
|
# every write to that setting look rejected, and the user sees "Hyprland did not
|
|
# apply ..." for a change that actually worked.
|
|
#
|
|
# cursor:inactive_timeout shipped as "int" and is answered as "float", which is
|
|
# exactly that failure. This contract asks the compositor for the real shape of
|
|
# every mapped option so the next one cannot reach a release.
|
|
|
|
set -euo pipefail
|
|
|
|
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
schema="$repo_dir/config/dot/quickshell/config/PreferenceSchema.qml"
|
|
|
|
fail() {
|
|
printf 'schema hypr shape contract: %s\n' "$1" >&2
|
|
exit 1
|
|
}
|
|
|
|
[[ -r "$schema" ]] || fail "cannot read $schema"
|
|
|
|
mismatches=0
|
|
checked=0
|
|
|
|
while IFS='|' read -r option declared; do
|
|
[[ -n "$option" ]] || continue
|
|
checked=$((checked + 1))
|
|
|
|
answer="$(hyprctl -j getoption "$option" 2>/dev/null)" \
|
|
|| fail "hyprctl could not read $option"
|
|
|
|
# An option Hyprland does not know answers without any value field at all.
|
|
actual=""
|
|
for field in int bool float str css; do
|
|
if jq -e --arg f "$field" 'has($f)' <<<"$answer" >/dev/null 2>&1; then
|
|
actual="$field"
|
|
break
|
|
fi
|
|
done
|
|
|
|
[[ -n "$actual" ]] || fail "$option is not a known Hyprland option (answered: $answer)"
|
|
|
|
if [[ "$actual" != "$declared" ]]; then
|
|
printf 'schema hypr shape contract: %s declares readAs "%s" but answers with "%s"\n' \
|
|
"$option" "$declared" "$actual" >&2
|
|
mismatches=$((mismatches + 1))
|
|
fi
|
|
done < <(grep -oE 'option: "[^"]+", readAs: "[a-z]+"' "$schema" \
|
|
| sed -E 's/option: "([^"]+)", readAs: "([a-z]+)"/\1|\2/')
|
|
|
|
[[ "$checked" -gt 0 ]] || fail 'no hypr-mapped schema entries were found to check'
|
|
[[ "$mismatches" -eq 0 ]] || fail "$mismatches option(s) declare the wrong answer shape"
|
|
|
|
printf 'schema hypr shape contract: PASS (%d mapped options)\n' "$checked"
|