From 32c33e4abfc8ecf4689a80882c8e3313434b7ce8 Mon Sep 17 00:00:00 2001 From: rickpeters Date: Sun, 27 Sep 2026 16:54:27 +0200 Subject: [PATCH] fix: An option left unticked stays off: it came back ticked as "new" on the next run (since 2.3.0) --- AGENTS.md | 2 ++ CHANGELOG.md | 3 ++- lib/backend.sh | 2 ++ lib/menu.sh | 16 ++++++++++++++++ steamify.sh | 1 + ui/qml/Texts.qml | 2 +- 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 7e13fb5..5c7b7a8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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 options are ticked for installs whose parent (top-level: `gaming`) is on (`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 `_repair` checks for new changes. - **Reversibility.** Every per-user KDE setting a component changes goes diff --git a/CHANGELOG.md b/CHANGELOG.md index 00b8e58..9adbec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ one per merged pull request. ## 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** - `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** diff --git a/lib/backend.sh b/lib/backend.sh index 37af7fe..05be3c1 100644 --- a/lib/backend.sh +++ b/lib/backend.sh @@ -160,6 +160,7 @@ backend_apply() { plan_changes backend_event plan "\"disable\":$(json_list "${TO_DISABLE[@]}"),\"enable\":$(json_list "${TO_ENABLE[@]}")" if [[ ${#TO_DISABLE[@]} -eq 0 && ${#TO_ENABLE[@]} -eq 0 ]]; then + feature_record_unticked backend_event finished '"failed":[],"restart":false,"nothing":true' return 0 fi @@ -175,6 +176,7 @@ backend_apply() { for c in "${TO_ENABLE[@]}"; do if backend_run_component "$c" enable; then is_action "$c" || feature_record "$c" enable; else failed+=("$c"); fi done + feature_record_unticked [[ " ${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)" } diff --git a/lib/menu.sh b/lib/menu.sh index 0a235be..21ebef5 100644 --- a/lib/menu.sh +++ b/lib/menu.sh @@ -73,6 +73,21 @@ menu_visible() { [[ -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 : after a successful run. 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 if "${c}_enable"; then is_action "$c" || feature_record "$c" enable; else failed+=("$c"); fi done + feature_record_unticked FAILED=("${failed[@]}") } diff --git a/steamify.sh b/steamify.sh index 995c023..e7e1310 100755 --- a/steamify.sh +++ b/steamify.sh @@ -127,6 +127,7 @@ while true; do plan_changes if [[ ${#TO_DISABLE[@]} -eq 0 && ${#TO_ENABLE[@]} -eq 0 ]]; then + feature_record_unticked ok "Everything is already the way you want it." read -rp "Press Enter to go back to the menu... " _ || break continue diff --git a/ui/qml/Texts.qml b/ui/qml/Texts.qml index e0f2005..fc6e536 100644 --- a/ui/qml/Texts.qml +++ b/ui/qml/Texts.qml @@ -49,7 +49,7 @@ QtObject { // Replaces the explanation of an option that can't be turned on here. readonly property var unsupported: ({ // 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