Fold thirty-one settings pages into fifteen categories with tabs
The sidebar was a flat scan of thirty-one rows; now it reads like a settings app. Multi-subject categories (Input, Network & Sharing, Applications, Users & Accounts, Privacy & Security, System) carry an Appearance-style tab strip above the page, drawn by the shell so the leaf pages themselves are untouched. The taxonomy lives in one new file, services/SettingsRoutes.qml; the sidebar, the strip, route validation, search breadcrumbs, and both generators derive from it. ShellState.settingsPage still holds leaf ids, so every deep link, IPC call, and search result keeps working — and now lands on the exact tab. Dictation moves out of Sound onto its own page under Input, with a handoff back to Sound for the microphone. The strip scrolls when System's nine tabs outgrow a tiled window. All 161 contracts pass. Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -2,19 +2,24 @@
|
||||
|
||||
# Every "open the settings for this" jump must land somewhere real.
|
||||
#
|
||||
# ShellState.openSettings() validates its argument against an allow-list and
|
||||
# falls back to Home for anything unknown. That fallback is sensible and it is
|
||||
# also completely silent: a typo, or a page renamed later, turns a right-click
|
||||
# into "opens Settings on the wrong page" with nothing logged and no error.
|
||||
# ShellState.openSettings() hands its argument to SettingsRoutes.resolve(),
|
||||
# which falls back to Home for anything it does not recognise. That fallback is
|
||||
# sensible and it is also completely silent: a typo, or a page renamed later,
|
||||
# turns a right-click into "opens Settings on the wrong page" with nothing
|
||||
# logged and no error.
|
||||
#
|
||||
# Before this, exactly four places in the entire shell could reach Settings, so
|
||||
# the risk was small. The bar now offers a jump on every widget, which makes the
|
||||
# fallback worth guarding.
|
||||
#
|
||||
# A jump may name either a leaf ("firewall") or a category ("network"), since
|
||||
# resolve() opens a category at its first available tab. Anything else is a
|
||||
# typo, and SettingsRoutes.qml is the only place that knows which is which.
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
shell_state="$repo_dir/config/dot/quickshell/services/ShellState.qml"
|
||||
routes="$repo_dir/config/dot/quickshell/services/SettingsRoutes.qml"
|
||||
modules="$repo_dir/config/dot/quickshell/modules"
|
||||
dock_menu="$modules/dock/DockContextMenu.qml"
|
||||
notification_card="$modules/notifications/NotificationCard.qml"
|
||||
@@ -25,8 +30,12 @@ fail() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
allowed_line="$(grep -m1 'const allowed = \[' "$shell_state")" \
|
||||
|| fail 'could not find the allow-list in ShellState'
|
||||
[[ -r "$routes" ]] || fail "cannot read $routes"
|
||||
|
||||
# Every id SettingsRoutes recognises: the categories (which carry an icon) and
|
||||
# the tabs inside them (which do not).
|
||||
known="$(grep -oE '\{ page: "[a-z-]+"' "$routes" | sed 's/.*"\(.*\)"/\1/' | sort -u)"
|
||||
[[ -n "$known" ]] || fail 'no pages found in SettingsRoutes -- this contract is not reading it correctly'
|
||||
|
||||
jumps="$(grep -rhoE 'openSettings\("[a-z-]+"\)' "$modules" 2>/dev/null \
|
||||
| sed 's/openSettings("//; s/")//' | sort -u)"
|
||||
@@ -35,8 +44,8 @@ jumps="$(grep -rhoE 'openSettings\("[a-z-]+"\)' "$modules" 2>/dev/null \
|
||||
count=0
|
||||
while read -r page; do
|
||||
[[ -n "$page" ]] || continue
|
||||
grep -qF "\"$page\"" <<<"$allowed_line" \
|
||||
|| fail "a jump opens \"$page\", which ShellState does not allow -- openSettings falls back to Home silently, so this reads as a right-click that goes to the wrong page"
|
||||
grep -qx "$page" <<<"$known" \
|
||||
|| fail "a jump opens \"$page\", which is neither a leaf nor a category in SettingsRoutes -- resolve() falls back to Home silently, so this reads as a right-click that goes to the wrong page"
|
||||
count=$((count + 1))
|
||||
done <<<"$jumps"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user