fix: An option left unticked stays off: it came back ticked as "new" on the next run (since 2.3.0)

This commit is contained in:
theupriser committed 2026-09-27 16:54:27 +02:00
1 parent 2dd0f3ac47
commit 32c33e4abf
6 files changed
+24 -2

No files matched your search

+2
View File
@@ -54,6 +54,8 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine
are ticked and re-applied ("update" in the plan and the app). New default are ticked and re-applied ("update" in the plan and the app). New default
options are ticked for installs whose parent (top-level: `gaming`) is on options are ticked for installs whose parent (top-level: `gaming`) is on
(`feature_new`, shown as "new"). (`feature_new`, shown as "new").
Options shown but left unticked in a confirmed run are recorded as
`off` (`feature_record_unticked`), or `feature_new` would tick them again.
Status still comes from the system; don't add ad-hoc `<id>_repair` checks Status still comes from the system; don't add ad-hoc `<id>_repair` checks
for new changes. for new changes.
- **Reversibility.** Every per-user KDE setting a component changes goes - **Reversibility.** Every per-user KDE setting a component changes goes
+2 -1
View File
@@ -7,7 +7,8 @@ one per merged pull request.
## 2.5.0 - 2026-09-27 ## 2.5.0 - 2026-09-27
- **feat: VRAM booster with NVIDIA says what to do: update, switch to the open driver (chwd command), or not supported by the card** - **fix: An option left unticked stays off: it came back ticked as "new" on the next run (since 2.3.0)**
- `2dd0f3a` **feat: VRAM booster with NVIDIA says what to do: update, switch to the open driver (chwd command), or not supported by the card**
- `57995bc` **docs: VRAM booster works with NVIDIA's open kernel modules (driver 615+); only the closed driver is greyed out** - `57995bc` **docs: VRAM booster works with NVIDIA's open kernel modules (driver 615+); only the closed driver is greyed out**
- `d57e8d8` **docs: AGENTS.md and changelog for the vidmem detection** - `d57e8d8` **docs: AGENTS.md and changelog for the vidmem detection**
- `5a34633` **feat: VRAM booster also for drivers that name their region vidmem (or numbered), NVIDIA included once its driver registers it** - `5a34633` **feat: VRAM booster also for drivers that name their region vidmem (or numbered), NVIDIA included once its driver registers it**
+2
View File
@@ -160,6 +160,7 @@ backend_apply() {
plan_changes plan_changes
backend_event plan "\"disable\":$(json_list "${TO_DISABLE[@]}"),\"enable\":$(json_list "${TO_ENABLE[@]}")" backend_event plan "\"disable\":$(json_list "${TO_DISABLE[@]}"),\"enable\":$(json_list "${TO_ENABLE[@]}")"
if [[ ${#TO_DISABLE[@]} -eq 0 && ${#TO_ENABLE[@]} -eq 0 ]]; then if [[ ${#TO_DISABLE[@]} -eq 0 && ${#TO_ENABLE[@]} -eq 0 ]]; then
feature_record_unticked
backend_event finished '"failed":[],"restart":false,"nothing":true' backend_event finished '"failed":[],"restart":false,"nothing":true'
return 0 return 0
fi fi
@@ -175,6 +176,7 @@ backend_apply() {
for c in "${TO_ENABLE[@]}"; do for c in "${TO_ENABLE[@]}"; do
if backend_run_component "$c" enable; then is_action "$c" || feature_record "$c" enable; else failed+=("$c"); fi if backend_run_component "$c" enable; then is_action "$c" || feature_record "$c" enable; else failed+=("$c"); fi
done done
feature_record_unticked
[[ " ${TO_DISABLE[*]} ${TO_ENABLE[*]} " =~ \ (gaming|single|boot|kpin)\ ]] && RESTART_FOR_LOGIN=true [[ " ${TO_DISABLE[*]} ${TO_ENABLE[*]} " =~ \ (gaming|single|boot|kpin)\ ]] && RESTART_FOR_LOGIN=true
backend_event finished "\"failed\":$(json_list "${failed[@]}"),\"restart\":$(restart_needed && echo true || echo false)" backend_event finished "\"failed\":$(json_list "${failed[@]}"),\"restart\":$(restart_needed && echo true || echo false)"
} }
+16
View File
@@ -73,6 +73,21 @@ menu_visible() {
[[ -z "${PARENT[$1]:-}" || "${WANTED[${PARENT[$1]}]:-0}" == 1 ]] [[ -z "${PARENT[$1]:-}" || "${WANTED[${PARENT[$1]}]:-0}" == 1 ]]
} }
feature_record_unticked() {
# After a run the user confirmed: options shown but left unticked that
# have no record yet count as turned off, or the next run would offer a
# default one again as "new" (feature_new) and tick it: e.g. single user
# mode unticked on a first run came back ticked when anything else
# changed. Hidden sub-options weren't a choice, so they're left alone.
local c
for c in "${COMPONENTS[@]}"; do
is_action "$c" && continue
menu_visible "$c" || continue
[[ "${WANTED[$c]:-0}" == 0 && -z "$(state_get features "$c")" ]] && state_set features "$c" off
done
return 0
}
feature_record() { feature_record() {
# feature_record <component> <enable|disable>: after a successful run. # feature_record <component> <enable|disable>: after a successful run.
if [[ "$2" == enable ]]; then state_set features "$1" "${FEATURE_VERSION[$1]:-$FEATURE_BASELINE}" if [[ "$2" == enable ]]; then state_set features "$1" "${FEATURE_VERSION[$1]:-$FEATURE_BASELINE}"
@@ -361,5 +376,6 @@ apply_changes() {
else echo; echo -e "${c_bold}Turning on: ${LABEL[$c]}${c_reset}"; fi else echo; echo -e "${c_bold}Turning on: ${LABEL[$c]}${c_reset}"; fi
if "${c}_enable"; then is_action "$c" || feature_record "$c" enable; else failed+=("$c"); fi if "${c}_enable"; then is_action "$c" || feature_record "$c" enable; else failed+=("$c"); fi
done done
feature_record_unticked
FAILED=("${failed[@]}") FAILED=("${failed[@]}")
} }
+1
View File
@@ -127,6 +127,7 @@ while true; do
plan_changes plan_changes
if [[ ${#TO_DISABLE[@]} -eq 0 && ${#TO_ENABLE[@]} -eq 0 ]]; then if [[ ${#TO_DISABLE[@]} -eq 0 && ${#TO_ENABLE[@]} -eq 0 ]]; then
feature_record_unticked
ok "Everything is already the way you want it." ok "Everything is already the way you want it."
read -rp "Press Enter to go back to the menu... " _ || break read -rp "Press Enter to go back to the menu... " _ || break
continue continue
+1 -1
View File
@@ -49,7 +49,7 @@ QtObject {
// Replaces the explanation of an option that can't be turned on here. // Replaces the explanation of an option that can't be turned on here.
readonly property var unsupported: ({ readonly property var unsupported: ({
// The body comes from the backend (item.note): it depends on the driver. // The body comes from the backend (item.note): it depends on the driver.
vram: { changes: ["Nothing until then: it can't steer video memory Linux doesn't know about"] } vram: { changes: ["Nothing until then"] }
}) })
// Per plan action: the review's chip [text, colour, background] and the // Per plan action: the review's chip [text, colour, background] and the