fix(menu): route every cancel branch through back_to for direct-keybinding consistency
Audit of all show_*_menu functions after the theme/background fix found 11 more cancel branches that called their parent directly instead of back_to. None are reachable from current keybindings (today's direct invocations target submenus that already use back_to), so the bug is latent — but any future `nomarchy-menu <area>` keybinding into one of these would bounce the user into the parent on Esc instead of exiting cleanly, the exact bug that prompted the previous commit's fix to show_theme_menu / show_background_menu. Mechanical sweep: *) show_main_menu ;; -> *) back_to show_main_menu ;; (5 sites) *) show_setup_menu ;; -> *) back_to show_setup_menu ;; (3 sites) *) show_update_menu ;; -> *) back_to show_update_menu ;; (3 sites) Behavior under nested navigation (BACK_TO_EXIT=false) is unchanged: back_to falls through to calling the parent function by name. Only direct-invocation cancel paths gain the correct exit-0 behavior. Action branches and go_to_menu's dispatch table intentionally still use direct calls — those are forward navigation, not cancel. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,7 @@ show_learn_menu() {
|
|||||||
*Arch*) nomarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;;
|
*Arch*) nomarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;;
|
||||||
*Bash*) nomarchy-launch-webapp "https://devhints.io/bash" ;;
|
*Bash*) nomarchy-launch-webapp "https://devhints.io/bash" ;;
|
||||||
*Neovim*) nomarchy-launch-webapp "https://www.lazyvim.org/keymaps" ;;
|
*Neovim*) nomarchy-launch-webapp "https://www.lazyvim.org/keymaps" ;;
|
||||||
*) show_main_menu ;;
|
*) back_to show_main_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ show_trigger_menu() {
|
|||||||
*Share*) show_share_menu ;;
|
*Share*) show_share_menu ;;
|
||||||
*Toggle*) show_toggle_menu ;;
|
*Toggle*) show_toggle_menu ;;
|
||||||
*Hardware*) show_hardware_menu ;;
|
*Hardware*) show_hardware_menu ;;
|
||||||
*) show_main_menu ;;
|
*) back_to show_main_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ show_style_menu() {
|
|||||||
*Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
|
*Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
|
||||||
*Screensaver*) open_in_editor ~/.config/nomarchy/branding/screensaver.txt ;;
|
*Screensaver*) open_in_editor ~/.config/nomarchy/branding/screensaver.txt ;;
|
||||||
*About*) open_in_editor ~/.config/nomarchy/branding/about.txt ;;
|
*About*) open_in_editor ~/.config/nomarchy/branding/about.txt ;;
|
||||||
*) show_main_menu ;;
|
*) back_to show_main_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ show_setup_menu() {
|
|||||||
*DNS*) present_terminal nomarchy-setup-dns ;;
|
*DNS*) present_terminal nomarchy-setup-dns ;;
|
||||||
*Security*) show_setup_security_menu ;;
|
*Security*) show_setup_security_menu ;;
|
||||||
*Config*) show_setup_config_menu ;;
|
*Config*) show_setup_config_menu ;;
|
||||||
*) show_main_menu ;;
|
*) back_to show_main_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ show_setup_security_menu() {
|
|||||||
case $(menu "Setup" " Fingerprint\n Fido2") in
|
case $(menu "Setup" " Fingerprint\n Fido2") in
|
||||||
*Fingerprint*) present_terminal nomarchy-setup-fingerprint ;;
|
*Fingerprint*) present_terminal nomarchy-setup-fingerprint ;;
|
||||||
*Fido2*) present_terminal nomarchy-setup-fido2 ;;
|
*Fido2*) present_terminal nomarchy-setup-fido2 ;;
|
||||||
*) show_setup_menu ;;
|
*) back_to show_setup_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ show_setup_config_menu() {
|
|||||||
*Waybar*) open_in_editor ~/.config/waybar/config.jsonc && nomarchy-restart-waybar ;;
|
*Waybar*) open_in_editor ~/.config/waybar/config.jsonc && nomarchy-restart-waybar ;;
|
||||||
*XCompose*) open_in_editor ~/.XCompose && nomarchy-restart-xcompose ;;
|
*XCompose*) open_in_editor ~/.XCompose && nomarchy-restart-xcompose ;;
|
||||||
*Overrides*) xdg-open ~/.config/nomarchy/overrides/ ;;
|
*Overrides*) xdg-open ~/.config/nomarchy/overrides/ ;;
|
||||||
*) show_setup_menu ;;
|
*) back_to show_setup_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ show_setup_system_menu() {
|
|||||||
*Suspend*) nomarchy-toggle-suspend ;;
|
*Suspend*) nomarchy-toggle-suspend ;;
|
||||||
*"Enable Hibernate"*) present_terminal nomarchy-hibernation-setup ;;
|
*"Enable Hibernate"*) present_terminal nomarchy-hibernation-setup ;;
|
||||||
*"Disable Hibernate"*) present_terminal nomarchy-hibernation-remove ;;
|
*"Disable Hibernate"*) present_terminal nomarchy-hibernation-remove ;;
|
||||||
*) show_setup_menu ;;
|
*) back_to show_setup_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ show_update_menu() {
|
|||||||
*Timezone*) present_terminal nomarchy-tz-select ;;
|
*Timezone*) present_terminal nomarchy-tz-select ;;
|
||||||
*Time*) present_terminal nomarchy-update-time ;;
|
*Time*) present_terminal nomarchy-update-time ;;
|
||||||
*Password*) show_update_password_menu ;;
|
*Password*) show_update_password_menu ;;
|
||||||
*) show_main_menu ;;
|
*) back_to show_main_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
show_update_process_menu() {
|
show_update_process_menu() {
|
||||||
@@ -297,7 +297,7 @@ show_update_process_menu() {
|
|||||||
*Swayosd*) nomarchy-restart-swayosd ;;
|
*Swayosd*) nomarchy-restart-swayosd ;;
|
||||||
*Walker*) nomarchy-restart-walker ;;
|
*Walker*) nomarchy-restart-walker ;;
|
||||||
*Waybar*) nomarchy-restart-waybar ;;
|
*Waybar*) nomarchy-restart-waybar ;;
|
||||||
*) show_update_menu ;;
|
*) back_to show_update_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,7 +308,7 @@ show_update_hardware_menu() {
|
|||||||
*Audio*) present_terminal nomarchy-restart-pipewire ;;
|
*Audio*) present_terminal nomarchy-restart-pipewire ;;
|
||||||
*Wi-Fi*) present_terminal nomarchy-restart-wifi ;;
|
*Wi-Fi*) present_terminal nomarchy-restart-wifi ;;
|
||||||
*Bluetooth*) present_terminal nomarchy-restart-bluetooth ;;
|
*Bluetooth*) present_terminal nomarchy-restart-bluetooth ;;
|
||||||
*) show_update_menu ;;
|
*) back_to show_update_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,7 +316,7 @@ show_update_password_menu() {
|
|||||||
case $(menu "Update Password" " Drive Encryption\n User") in
|
case $(menu "Update Password" " Drive Encryption\n User") in
|
||||||
*Drive*) present_terminal nomarchy-drive-set-password ;;
|
*Drive*) present_terminal nomarchy-drive-set-password ;;
|
||||||
*User*) present_terminal passwd ;;
|
*User*) present_terminal passwd ;;
|
||||||
*) show_update_menu ;;
|
*) back_to show_update_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user