Lead Appearance with light and dark, and stop pages listing whole datasets
Appearance was six cards deep and Light/Dark was the third of them, below the wallpaper grid and the entire lock screen -- so the control reached most often was the last one you got to. It is five tabs now, Theme first. The mock showed four; the page turned out to have eleven cards, so Titlebars and Windows became Windows, and Clock and vitals became Shell, rather than pretending four would hold them. Region, Date & Time and Displays each rendered a complete dataset as rows: every installed locale, the whole tz database, every mode the monitor advertises. The chooser was never the problem -- SearchPicker already existed and worked. It was simply rendered always-expanded, so the one line saying what is currently set sat under hundreds that were not. PickerRow collapses each behind its current value and closes again once something is picked. The avatar never appeared to change because accountsservice writes every picture to the same path, leaving the URL byte-identical while Qt served its cached image. cache:false was already set and could not have helped: an unchanged source is never re-read at all. avatarUrl now carries a revision fragment, bumped only when a write actually succeeds. Pictures are cropped before they are set, in the picture's own pixel coordinates so the result does not depend on the size it happened to be displayed at, and written out at 512x512 through GdkPixbuf -- already a dependency here, so nothing new is required. Snapshots listed nothing. The timeline and its Delete buttons existed the whole time, behind a row labelled "Browse...", a word that promises a file browser. The three most recent points are shown inline now, with the rest one press away. qmldir-registration-contract exists because an unregistered component is not a quiet problem: Quickshell fails the entire configuration on it, so the settings window dies and the bar and dock go with it. That happened twice while writing this, both times on a machine somebody was using. It is pure file inspection, so it runs before a change ever reaches the running shell. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
+54
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Every QML component in a module directory must be listed in that directory's
|
||||
# qmldir.
|
||||
#
|
||||
# An unregistered component is not a quiet problem. Quickshell fails the whole
|
||||
# configuration with "X is not a type" -- so the settings window dies, and with
|
||||
# it the bar, the dock and the rest of the shell. It has happened twice: once
|
||||
# adding ContainersPage, once adding PickerRow and SettingsTabs. Both times the
|
||||
# file was written, the live shell hot-reloaded, and the desktop went down while
|
||||
# somebody was using it.
|
||||
#
|
||||
# The failure is trivial to prevent and expensive to discover, which is exactly
|
||||
# what a contract is for. This one is pure file inspection: no shell is started,
|
||||
# so it can be run before the change ever reaches the running desktop.
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
shell_dir="$repo_dir/config/dot/quickshell"
|
||||
|
||||
fail() {
|
||||
printf 'qmldir registration contract: %s\n' "$1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ -d "$shell_dir" ]] || fail "missing $shell_dir"
|
||||
|
||||
checked=0
|
||||
missing=()
|
||||
|
||||
while IFS= read -r qmldir; do
|
||||
directory="$(dirname "$qmldir")"
|
||||
for component in "$directory"/*.qml; do
|
||||
[[ -e "$component" ]] || continue
|
||||
name="$(basename "$component" .qml)"
|
||||
checked=$((checked + 1))
|
||||
# A singleton declares itself with `singleton NAME`; everything else is
|
||||
# `NAME VERSION FILE`. Either form counts as registered.
|
||||
grep -qE "^(singleton +)?${name}( |$)" "$qmldir" \
|
||||
|| missing+=("${directory#"$repo_dir"/}/$name.qml")
|
||||
done
|
||||
done < <(find "$shell_dir" -name qmldir)
|
||||
|
||||
if (( ${#missing[@]} > 0 )); then
|
||||
printf 'qmldir registration contract: %d component(s) are not registered:\n' "${#missing[@]}" >&2
|
||||
printf ' %s\n' "${missing[@]}" >&2
|
||||
printf 'Quickshell fails the entire configuration on these, taking the shell down with it.\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
(( checked > 0 )) || fail 'no components were checked, so this proves nothing'
|
||||
|
||||
printf 'qmldir registration contract: ok (%d components registered)\n' "$checked"
|
||||
Reference in New Issue
Block a user