修复 History IPC 失败时无反馈和卡 loading#343
Merged
H-Chris233 merged 2 commits intoMay 8, 2026
Merged
Conversation
History actions previously assumed list, clear, and delete IPC calls would resolve. A rejected load could leave the page stuck in loading, while failed mutations gave no user-visible feedback. The page now clears loading in finally, shows retryable inline load errors, and reports clear/delete failures while restoring the prior local selection and items. Constraint: Issue Open-Less#310 asks for inline card feedback without changing Rust handlers or introducing a toast system.\nRejected: New shared error component | broader UI surface than needed for this single-page failure path.\nConfidence: high\nScope-risk: narrow\nTested: cd openless-all/app && git diff --check && npm run build\nNot-tested: Live Tauri IPC failure injection.\nRelated: Open-Less#310
PR Reviewer Guide 🔍(Review updated until commit f79a8dc)Here are some key observations to aid the review process:
|
The History mutation handlers already wait for backend success before changing visible list state, so failure recovery does not need to write back the request-time snapshot. Removing that restoration avoids overwriting a newer refresh result, and delete success now updates from the latest list state instead of the closure captured before the IPC call. Constraint: PR Open-Less#343 review identified stale snapshot writes during overlapping refresh and mutation requests.\nRejected: Add action-wide locking | more UI state than needed once failed mutations stop writing stale snapshots.\nConfidence: high\nScope-risk: narrow\nTested: cd openless-all/app && git diff --check && npm run build\nNot-tested: Manual overlapping refresh/delete in the Tauri app.
|
Persistent review updated to latest commit f79a8dc |
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
摘要
修复 History 页
listHistory()/clearHistory()/deleteHistoryEntry()IPC 调用失败时缺少反馈的问题。refresh()增加try/catch/finally,避免加载失败后永久停留在 loadingCloses #310
验证
git diff --checkcd openless-all/app && npm run buildPR Type
Bug fix
Description
Prevent History loading from getting stuck
Show inline errors for clear/delete failures
Add retryable load-failure UI state
Localize new History error messages
Diagram Walkthrough
File Walkthrough
History.tsx
Handle History IPC failures safelyopenless-all/app/src/pages/History.tsx
refresh()intry/catch/finallyso loading always clears.loadErrorandactionErrorstate for inline feedback.the page.
zh-CN.ts
Add Simplified Chinese History errorsopenless-all/app/src/i18n/zh-CN.ts
loadFailed,retry,clearFailed, anddeleteFailedstrings.zh-TW.ts
Add Traditional Chinese History errorsopenless-all/app/src/i18n/zh-TW.ts
retrylabel for the new error state.en.ts
Add English History error stringsopenless-all/app/src/i18n/en.ts
retrylabel used by the inline recovery UI.ja.ts
Add Japanese History error stringsopenless-all/app/src/i18n/ja.ts
retrylabel.ko.ts
Add Korean History error stringsopenless-all/app/src/i18n/ko.ts
retrylabel for recovery.