Preselect the current region when the form asks again

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 23:25:57 -04:00
1 parent c86af5cea5
commit b6bf851af4
2 files changed
+9 -8

No files matched your search

+7 -3
View File
@@ -53,6 +53,8 @@ source "$ROOT/install/provisioning/setup-form.sh"
notice() { printf '%s\n' "$1" >>"$NOTICES"; }
region=${REGION:-global}
if [[ -n ${TAKEN_USERS:-} ]]; then
omarchy_username_taken() { [[ " $TAKEN_USERS " == *" $1 "* ]]; }
fi
@@ -129,10 +131,12 @@ pass "the form publishes the 0/1/130 status contract and leads with English (US)
run_prompt omarchy_prompt_region "0:China"
assert_status 0 "region prompt succeeds"
[[ $(field region) == "china" ]] || fail "region prompt stores China as china"
grep -qxF -- 'choose --selected Global --header Select region Global China' "$GUM_ARGS" || fail "region prompt offers Global then China and preselects Global"
run_prompt omarchy_prompt_region "0:Global"
[[ $(<"$tmp_dir/stdin.1") == $'Global\nChina' ]] || fail "region prompt offers Global then China"
grep -qxF -- 'choose --selected Global --header Select region' "$GUM_ARGS" || fail "region prompt preselects Global on a fresh form"
REGION=china run_prompt omarchy_prompt_region "0:Global"
[[ $(field region) == "global" ]] || fail "region prompt stores Global as global"
pass "region prompt maps Global and China to the stored region"
grep -qxF -- 'choose --selected China --header Select region' "$GUM_ARGS" || fail "region prompt preselects the region chosen on an earlier visit"
pass "region prompt maps Global and China and preselects the current region"
run_prompt omarchy_prompt_region "1:"
assert_status "$OMARCHY_FORM_BACK" "region prompt reports Esc as back"