Skip to content

修复划词追问保存失败无反馈#338

Merged
H-Chris233 merged 2 commits into
Open-Less:betafrom
H-Chris233:fix/issue-315-selectionask-save-feedback
May 7, 2026
Merged

修复划词追问保存失败无反馈#338
H-Chris233 merged 2 commits into
Open-Less:betafrom
H-Chris233:fix/issue-315-selectionask-save-feedback

Conversation

@H-Chris233
Copy link
Copy Markdown
Collaborator

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

User description

摘要

  • 为 SelectionAsk 页 QA 快捷键和历史保存增加 saving/saved/error 状态提示
  • QA 快捷键注册失败时停止后续保存并刷新偏好,避免 UI 与真实状态漂移
  • 补齐简中、繁中、英文、日文、韩文错误文案

验证

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

Closes #315


PR Type

Bug fix


Description

  • Add saving/saved/failed UI feedback for QA hotkey and history saves.

  • Stop persistence on hotkey registration error and refresh prefs to prevent UI drift.

  • Disable toggles and shortcut recorder during save to avoid race conditions.

  • Add localized error messages in zh‑CN, zh‑TW, en, ja, ko.


Diagram Walkthrough

flowchart LR
  A["User toggle / history change"] -- saving --> B["showSaveStatus('saving')"]
  B --> C["setQaHotkey or persistPrefs"]
  C -- success --> D["showSaveStatus('saved')"]
  C -- error --> E["showSaveStatus('failed') with message"]
  E --> F["refresh prefs and stop"]
  D --> G["UI reflects true state"]
  F --> G
  A --> H["Disable toggles & recorder during saving"]
Loading

File Walkthrough

Relevant files
Bug fix
1 files
SelectionAsk.tsx
Introduce save state feedback and error handling                 
+102/-11
Enhancement
6 files
ShortcutRecorder.tsx
Add disabled prop to prevent recording during saves           
+14/-4   
en.ts
Add English error messages for save failures                         
+5/-0     
ja.ts
Add Japanese error messages for save failures                       
+5/-0     
ko.ts
Add Korean error messages for save failures                           
+5/-0     
zh-CN.ts
Add Simplified Chinese error messages for save failures   
+5/-0     
zh-TW.ts
Add Traditional Chinese error messages for save failures 
+5/-0     

Selection Ask reused the same QA hotkey and history persistence paths as other settings pages, but the page did not surface pending, success, or failure states. A rejected hotkey registration or settings write could therefore leave users believing the feature or history option was enabled when the backend had not accepted the change.\n\nThis keeps the existing persistence contract and mirrors the Translation page status treatment: register QA hotkeys before saving prefs, stop on registration errors, refresh after write failures, and add localized feedback for all supported UI languages.\n\nConstraint: Issue Open-Less#315 requests minimal UI feedback and rollback behavior without refactoring the shared settings queue.\nRejected: Refactor HotkeySettingsContext persistence semantics | broader cross-page behavior change than needed for this bug.\nConfidence: high\nScope-risk: narrow\nTested: cd openless-all/app && npm run build\nTested: git diff --check\nNot-tested: Manual Tauri hotkey conflict flow on macOS/Windows.\nRelated: Open-Less#315
@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 🔍

(Review updated until commit b0f481c)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

315 - Fully compliant

Compliant requirements:

  • 三个保存路径(切换 QA 热键开关、录制新 QA 热键、切换“保存 Q&A 历史”)需有 saving/saved/failed 状态提示
  • setQaHotkey 被 reject 时回滚 toggle 视觉并提示“热键注册失败”,不继续调用 savePrefs
  • 与 Translation 页修法保持一致风格
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

The Selection Ask page now disables its card toggles while a save is in flight, but the nested shortcut recorder still accepted new recordings. That left a small overlap window where a second QA hotkey save could race the current setQaHotkey/savePrefs pair.\n\nThis keeps the recorder default behavior unchanged for other pages by adding an optional disabled prop and only wiring it from Selection Ask during its saving state.\n\nConstraint: Review feedback on PR Open-Less#338 requested preventing overlapping QA shortcut saves without broad settings-queue refactoring.\nRejected: Global serialization inside ShortcutRecorder | unnecessary for pages that already own their own persistence state.\nConfidence: high\nScope-risk: narrow\nTested: cd openless-all/app && npm run build\nTested: git diff --check\nNot-tested: Manual browser interaction against a slow Tauri IPC response.\nRelated: https://github.com/appergb/openless/issues/315\nRelated: Open-Less#338
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Persistent review updated to latest commit b0f481c

@H-Chris233 H-Chris233 merged commit c4a7ebe into Open-Less:beta May 7, 2026
3 checks passed
@H-Chris233 H-Chris233 deleted the fix/issue-315-selectionask-save-feedback 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] SelectionAsk 页保存动作无 saving/saved/error 反馈 — 失败用户无感

1 participant