Close the sweep's last blind spot, and stop shortcuts silently colliding
gapsIn and gapsOut were the only two compositor settings the write sweep had never verified: Hyprland answers for them in CSS shorthand, "5 5 5 5", and the sweep had no way to compare that. The preference behind each is a single int that Hyprland expands to four sides, so a uniform reading compares exactly. A non-uniform one is not something the preference can express, and is skipped rather than collapsed to a number it never wrote. 63 of 63 verified live now, none skipped. Wallpaper thumbnails are cached. The report that five of them sat at "Loading…" was a screenshot taken 1.1 seconds after the page opened -- decoding one of these at tile size takes between 1.2 and 2.6 seconds and about ten start at once, which the code already said. Measuring it did turn up something real though: without a cache, scrolling back up pays that decode again for every tile. The tradeoff is a wallpaper replaced in place showing a stale thumbnail until restart, which is worth it for a directory of files that are added rather than edited. A chord already in use is now named rather than taken: "Super+Q is already Terminal". Two actions on one chord means whichever Hyprland reads last wins, which is not a thing to find out later by pressing it. Rebinding a shortcut to the chord it already holds is correctly not a conflict. Also: Open Appearance lands on the Windows tab now that the page has tabs, Storage points at reclaimable container space, and a dock row shows its desktop id only when two pinned applications share a name -- it is developer text, and repeating it under fifteen recognisable names made the list harder to scan. Written down because it cost the shell: QML has no default parameter values, and `function openSettings(page: string, section: string = "")` fails the entire configuration rather than the one function -- so the bar and dock went with it, and 43 contracts failed at once pointing at the same line. qmllint --bare passes that, which is why the usual check before touching the running shell did not catch it. openSettingsSection exists as a separate function for that reason. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
@@ -30,7 +30,14 @@ SCHEMA = "config/dot/quickshell/config/PreferenceSchema.qml"
|
||||
# Read-back shapes this sweep knows how to compare. A gradient or a vec2 has no
|
||||
# single scalar to diff, and guessing one would produce false failures; those
|
||||
# are reported as skipped rather than quietly counted as verified.
|
||||
COMPARABLE = {"bool", "int", "float", "str"}
|
||||
#
|
||||
# "css" is the CSS-shorthand shape Hyprland uses for gaps: "5 5 5 5". The
|
||||
# preference behind it is a single int that Hyprland expands to four sides, so
|
||||
# a uniform reading compares exactly. A non-uniform one is not something the
|
||||
# preference can express at all, and is skipped rather than collapsed to a
|
||||
# number that would be wrong -- these two settings were the only compositor
|
||||
# settings the sweep had never verified.
|
||||
COMPARABLE = {"bool", "int", "float", "str", "css"}
|
||||
|
||||
# Settings whose value this must not choose freely.
|
||||
#
|
||||
@@ -127,12 +134,33 @@ def read_option(entry: dict):
|
||||
payload = json.loads(result.stdout)
|
||||
except json.JSONDecodeError:
|
||||
return None
|
||||
field = {"bool": "bool", "int": "int", "float": "float", "str": "str"}.get(entry["readAs"])
|
||||
field = {"bool": "bool", "int": "int", "float": "float",
|
||||
"str": "str", "css": "css"}.get(entry["readAs"])
|
||||
if field is None or field not in payload:
|
||||
return None
|
||||
if entry["readAs"] == "css":
|
||||
return css_scalar(payload[field])
|
||||
return payload[field]
|
||||
|
||||
|
||||
def css_scalar(text):
|
||||
"""The single number a CSS shorthand stands for, or None if it is not one.
|
||||
|
||||
Hyprland answers "5 5 5 5" for a gap of five. The preference is one int, so
|
||||
four equal sides read back exactly; four different ones mean something this
|
||||
setting cannot have produced, and returning any one of them would report a
|
||||
write as verified against a value it never wrote.
|
||||
"""
|
||||
parts = str(text or "").split()
|
||||
if not parts:
|
||||
return None
|
||||
try:
|
||||
numbers = [int(part) for part in parts]
|
||||
except ValueError:
|
||||
return None
|
||||
return numbers[0] if len(set(numbers)) == 1 else None
|
||||
|
||||
|
||||
def stored_from_option(entry: dict, raw):
|
||||
"""The value a preference would hold for this compositor reading."""
|
||||
if entry["readAs"] == "bool":
|
||||
|
||||
Reference in New Issue
Block a user