feat(webview): 添加错误横幅组件显示错误信息#30
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
Summary
Changes
Test plan
PR Type
enhancement, bug_fix
Description
Add quota/billing error detection in
ChatService.ktto classify insufficient_quota, billing, credit, and payment-related errorsRedesign ErrorBanner component with distinct visual styles for each error type (config, quota, network, runtime) and custom icons
Implement retry functionality that re-sends the last user message when clicking "重试" on network errors
Update error handling to dynamically set error type based on connection state (config vs runtime)
Diagram Walkthrough
flowchart LR A[User Action] --> B{Send Message} B --> C{Connection State} C -->|unconfigured/error| D[Error Type: config] C -->|connected| E[Error Type: runtime] D --> F[ErrorBanner: Open Settings] E --> G[ErrorBanner: Close/Retry] H[Stream Error] --> I[classifyStreamError] I --> J{Error Type} J -->|401/403/API Key| K[config] J -->|quota/billing| L[quota] J -->|timeout/5xx/429| M[network] J -->|other| N[runtime] K --> O[Show ErrorBanner] L --> O M --> O N --> OFile Walkthrough
1 files
Add quota error type classification4 files
Add error action handling and retry logicRedesign ErrorBanner with custom stylingAdd quota to BridgeError typeAdd custom CSS for error banners1 files
Add technical design documentation1 files