From 638b50380f667c5173eeaf1387950d9ae8fdce6b Mon Sep 17 00:00:00 2001 From: markmybytes Date: Sun, 4 Oct 2026 17:44:09 +0800 Subject: [PATCH] fix(frontend): gate match on hardware availability, block options while matching Match was clickable while hardware info was unavailable, so it fired a query that matched nothing and gave no feedback. The skeleton state and the null hw value already mark that window, so reuse it as the availability signal instead of adding new state. matching ref brackets the query so a second click cannot race the first, and clearing it in finally keeps failures on the existing toast path. The overlay exists because matching leaves the selects writable: a user can change a selection mid-flight and silently lose the matched result. Covering the option form makes the in-flight state visible and takes the controls out of play. --- frontend/src/i18n/en.json | 1 + frontend/src/i18n/zh_Hant_HK.json | 1 + frontend/src/pages/index.vue | 33 ++++++++++++++++++++++++++++--- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 00f5349..6d7bedc 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -103,6 +103,7 @@ "labelManual": "Manual", "labelMissingExe": "Not Found", "labelMatch": "Match", + "labelMatching": "Matching", "labelMultiPatternMatching": "Multi-Pattern Matching", "labelMultiRuleMatching": "Multi-Rule Matching", "labelNA": "N/A", diff --git a/frontend/src/i18n/zh_Hant_HK.json b/frontend/src/i18n/zh_Hant_HK.json index d693454..fc27ec1 100644 --- a/frontend/src/i18n/zh_Hant_HK.json +++ b/frontend/src/i18n/zh_Hant_HK.json @@ -103,6 +103,7 @@ "labelManual": "手動輸入", "labelMissingExe": "路徑無效", "labelMatch": "配對", + "labelMatching": "配對中", "labelMultiPatternMatching": "多匹配值配對", "labelMultiRuleMatching": "多規則配對", "labelNA": "N/A", diff --git a/frontend/src/pages/index.vue b/frontend/src/pages/index.vue index 831f3d8..18e5ad9 100644 --- a/frontend/src/pages/index.vue +++ b/frontend/src/pages/index.vue @@ -42,6 +42,7 @@ let timer: ReturnType | null = null const selectedNetwork = ref(0) const selectedDisplay = ref(0) const selectedMiscellaneous = ref([]) +const matching = ref(false) function loadSystemInfo() { Promise.all([utils.getHardware(), utils.getOSInfo()]).then(([hw, os]) => { @@ -92,6 +93,7 @@ onBeforeMount(() => { }) function selectMatchedOptions() { + matching.value = true matcher .MatchedGroupIds() .then(matchedIds => { @@ -110,6 +112,9 @@ function selectMatchedOptions() { }) }) .catch(err => toast.add({ title: decodeError(err, t), color: 'error' })) + .finally(() => { + matching.value = false + }) } function resetSelection() { @@ -258,7 +263,17 @@ onBeforeUnmount(() => { -
+ +
+ + + {{ $t('labelMatching') }} +
+
- + {{ $t('labelMatch') }} - + {{ $t('actionReset') }}