Skip to content

修复 Overview IPC 加载失败时误显示空数据#342

Merged
H-Chris233 merged 1 commit into
Open-Less:betafrom
H-Chris233:fix/issue-311-overview-load-errors
May 8, 2026
Merged

修复 Overview IPC 加载失败时误显示空数据#342
H-Chris233 merged 1 commit into
Open-Less:betafrom
H-Chris233:fix/issue-311-overview-load-errors

Conversation

@H-Chris233
Copy link
Copy Markdown
Collaborator

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

User description

摘要

修复 Overview 页在 listHistory() / getCredentials() IPC 调用失败时静默吞掉错误的问题。

  • 历史读取失败时,指标和最近识别区域显示 inline 错误
  • 最近识别支持重试
  • 凭据状态读取失败时,ProviderCard 显示“无法读取”第三态,避免误显示“未配置”
  • 补齐简体中文、繁体中文、英文、日文、韩文文案

Closes #311

验证

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

PR Type

Bug fix, Enhancement


Description

  • Catch errors from listHistory and getCredentials IPC calls

  • ProviderCard now shows 'error' status distinct from not-configured

  • Metrics and recent area display inline error with retry button

  • Add error-related i18n strings in 5 locales


Diagram Walkthrough

flowchart LR
  A["listHistory / getCredentials"] -- "catch errors" --> B["setHistoryError / setCredsError"]
  B --> C["ProviderCard status = 'error'"]
  B --> D["Metrics show '—' and error labels"]
  B --> E["WeekChart replaced with error text"]
  B --> F["Recent area shows retry button"]
Loading

File Walkthrough

Relevant files
Error handling
Overview.tsx
Handle IPC errors with inline feedback and retry                 

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

  • Added historyError and credsError state
  • Wrapped listHistory in useCallback with error catch
  • Added .catch to getCredentials with error set
  • Updated ProviderCard to accept status prop (incl. 'error')
  • Metrics, WeekChart, and recent section show inline error feedback
+63/-22 
Enhancement
en.ts
Add English error-related overview strings                             

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

  • Added keys: statusUnknown, credentialsLoadError, historyLoadError,
    recentLoadFailed, historyRetry
+5/-0     
ja.ts
Add Japanese error-related overview strings                           

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

  • Added keys: statusUnknown, credentialsLoadError, historyLoadError,
    recentLoadFailed, historyRetry
+5/-0     
ko.ts
Add Korean error-related overview strings                               

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

  • Added keys: statusUnknown, credentialsLoadError, historyLoadError,
    recentLoadFailed, historyRetry
+5/-0     
zh-CN.ts
Add Simplified Chinese error-related overview strings       

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

  • Added keys: statusUnknown, credentialsLoadError, historyLoadError,
    recentLoadFailed, historyRetry
+5/-0     
zh-TW.ts
Add Traditional Chinese error-related overview strings     

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

  • Added keys: statusUnknown, credentialsLoadError, historyLoadError,
    recentLoadFailed, historyRetry
+5/-0     

Overview previously treated rejected history and credential IPC calls like empty data, which made backend read failures indistinguishable from a clean first run. The page now keeps separate error flags, shows provider status as unreadable when credential status cannot load, and replaces history-derived metrics/recent rows with retryable inline failure states.

Constraint: Issue Open-Less#311 asks for per-card inline feedback without changing backend handler signatures or adding global toast UI.\nRejected: Global error boundary or toast | broader UI behavior than needed for the Overview 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#311
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

311 - Fully compliant

Compliant requirements:

  • IPC calls now have .catch, inline errors displayed
  • ProviderCard has 'error' status distinct from 'notConfigured'
  • Recent cards show error with retry button on failure
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@H-Chris233 H-Chris233 merged commit 13937d2 into Open-Less:beta May 8, 2026
3 checks passed
@H-Chris233 H-Chris233 deleted the fix/issue-311-overview-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] Overview 页 listHistory/getCredentials 失败时无反馈 — 永远停留在空数据

1 participant