修复热键设置加载失败后永久 loading#351
Merged
H-Chris233 merged 1 commit intoMay 8, 2026
Merged
Conversation
Hotkey settings are a shared context for multiple pages, so one rejected IPC call must not leave the provider in a permanent loading state. The refresh path now records a localized recoverable error, keeps any successfully loaded half of the state, and always releases loading so consumers can render retry UI instead of staying blank. Constraint: Issue Open-Less#316 requires local load failures to stay visible and non-fatal. Rejected: Keep Promise.all with one catch | it would still discard partial success from the other IPC call. Confidence: high Scope-risk: narrow Tested: git diff --check; npm run build; cargo check --manifest-path src-tauri/Cargo.toml Not-tested: Manual Tauri UI session with a deliberately corrupted preferences.json. Related: Open-Less#316
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
变更内容
HotkeySettingsContext.refresh()任一 IPC 失败后loading永远不释放的问题。error,refresh()使用finally保证退出 loading,并保留成功返回的 prefs/capability 半边状态。验证
git diff --checkcd openless-all/app && npm run buildcd openless-all/app && cargo check --manifest-path src-tauri/Cargo.toml(仅既有 warning)Closes #316
PR Type
Bug fix, Enhancement
Description
Fix permanent loading state on IPC failure using
Promise.allSettledandfinallyAdd
errorstate to HotkeySettingsContext for consumersShow localized error alert and retry button in Translation page
Add
retryandsettingsLoadFailedkeys to all five localesDiagram Walkthrough
flowchart LR A["HotkeySettingsProvider.refresh()"] --> B["Promise.allSettled(getSettings, getHotkeyCapability)"] B -- "fulfilled" --> C["setPrefs / setCapability (partial success)"] B -- "rejected" --> D["setError(reason)"] C --> E["finally { setLoading(false) }"] D --> E E --> F["Context value updated with error"] F --> G["Translation page shows alert + retry button"]File Walkthrough
5 files
Add retry and load failure i18n keysAdd retry and load failure i18n keysAdd retry and load failure i18n keysAdd retry and load failure i18n keysAdd retry and load failure i18n keys2 files
Display error alert and retry on load failureHandle IPC failures with error state and finally