Skip to content

修复 History IPC 失败时无反馈和卡 loading#343

Merged
H-Chris233 merged 2 commits into
Open-Less:betafrom
H-Chris233:fix/issue-310-history-load-errors
May 8, 2026
Merged

修复 History IPC 失败时无反馈和卡 loading#343
H-Chris233 merged 2 commits into
Open-Less:betafrom
H-Chris233:fix/issue-310-history-load-errors

Conversation

@H-Chris233
Copy link
Copy Markdown
Collaborator

@H-Chris233 H-Chris233 commented May 8, 2026

User description

摘要

修复 History 页 listHistory() / clearHistory() / deleteHistoryEntry() IPC 调用失败时缺少反馈的问题。

  • refresh() 增加 try/catch/finally,避免加载失败后永久停留在 loading
  • 加载失败时显示 inline 错误和重试按钮
  • 清空/删除失败时显示错误,并恢复原本列表与选中项
  • 补齐简体中文、繁体中文、英文、日文、韩文文案

Closes #310

验证

  • git diff --check
  • cd openless-all/app && npm run build

PR 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

flowchart LR
  H["History page"]
  I["IPC calls"]
  E["Inline error UI"]
  T["Localized messages"]

  H -- "listHistory / clearHistory / deleteHistoryEntry" --> I
  I -- "rejects with error" --> H
  H -- "show load/action errors" --> E
  H -- "render translated strings" --> T
Loading

File Walkthrough

Relevant files
Bug fix
History.tsx
Handle History IPC failures safely                                             

openless-all/app/src/pages/History.tsx

  • Wrap refresh() in try/catch/finally so loading always clears.
  • Add loadError and actionError state for inline feedback.
  • Show a retry button when history loading fails.
  • Keep selection stable and surface clear/delete errors without breaking
    the page.
+59/-19 
Enhancement
zh-CN.ts
Add Simplified Chinese History errors                                       

openless-all/app/src/i18n/zh-CN.ts

  • Add loadFailed, retry, clearFailed, and deleteFailed strings.
  • Provide user-facing wording for History load and mutation failures.
+4/-0     
zh-TW.ts
Add Traditional Chinese History errors                                     

openless-all/app/src/i18n/zh-TW.ts

  • Add translated History load-failure and action-failure messages.
  • Add the shared retry label for the new error state.
+4/-0     
en.ts
Add English History error strings                                               

openless-all/app/src/i18n/en.ts

  • Add English copy for load, clear, and delete failures.
  • Add the retry label used by the inline recovery UI.
+4/-0     
ja.ts
Add Japanese History error strings                                             

openless-all/app/src/i18n/ja.ts

  • Add Japanese translations for load and action failure messages.
  • Add the localized retry label.
+4/-0     
ko.ts
Add Korean History error strings                                                 

openless-all/app/src/i18n/ko.ts

  • Add Korean translations for History load, clear, and delete failures.
  • Add the localized retry label for recovery.
+4/-0     

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
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

PR Reviewer Guide 🔍

(Review updated until commit f79a8dc)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

310 - Partially compliant

Compliant requirements:

  • refresh() now clears loading in a finally block.
  • Load failures now render an inline error with a retry button.
  • Clear/delete failures now surface inline error messages.
  • History failure strings were added to all supported locale files.

Non-compliant requirements:

  • None identified from the diff.

Requires further human verification:

  • The new load-failure and action-failure states should be checked in the app UI to confirm the layout, spacing, and retry flow feel correct.
  • The exact text shown for backend errors should be verified with real IPC failures to ensure it stays readable and appropriately sanitized.
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

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.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Persistent review updated to latest commit f79a8dc

@H-Chris233 H-Chris233 merged commit 66e0efa into Open-Less:beta May 8, 2026
3 checks passed
@H-Chris233 H-Chris233 deleted the fix/issue-310-history-load-errors branch May 9, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ui][bug] History 页 listHistory/clear/delete 失败无反馈 — loading 可能永卡

1 participant