feat(history): 润色未变化检测与历史重新润色 (Fixes #653)#666
Conversation
Align updateChannel prefs with background AutoUpdateGate, add symmetric manual stable/beta check buttons, Android auto-download after check, and settings toggle; extract updater_logic helpers with unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
call_static_method caused NoSuchMethodError on Thread-8 during AutoUpdateGate background check, killing the app ~4s after launch. Co-authored-by: Cursor <cursoragent@cursor.com>
Manual workflow_dispatch builds signed release APKs when ANDROID_KEYSTORE_* is configured (overlay install, data preserved); otherwise falls back to unsigned debug with job summary notice. Tag releases still require all secrets; minisign/manifest/GitHub Release remain tag-only. Co-authored-by: Cursor <cursoragent@cursor.com>
Sync UPDATER_PUBKEY_B64 with tauri.conf.json; fail download when installApk returns false; put Beta channel above auto-update toggle; add pubkey CI check script. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid squeezing the toggle beside long description text on narrow mobile layouts; align with AutoUpdateSection pattern. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Exclude Playwright/ui-check-screenshots outputs from version control and update the lockfile after tauri-nspanel resolution. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid NoSuchMethodError when installed APK dex lacks OpenLessAccessibilityService.isEnabled static bridge; query enabled services and heartbeat prefs directly. Co-authored-by: Cursor <cursoragent@cursor.com>
Add @keep and @JvmStatic on Rust-invoked bridge methods; default overlay service starts to startService and only START_RECORDING uses startForegroundService on API 26+; abort recording when foreground promotion fails. Co-authored-by: Cursor <cursoragent@cursor.com>
…ess#653) Add opt-in polishUnchanged detection, history-level repolish IPC, and UI; exclude translation history; preserve insert error codes on retry. Co-authored-by: Cursor <cursoragent@cursor.com>
…ssion Co-authored-by: Cursor <cursoragent@cursor.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
感谢 bot 标注,这条 Compile Error 是误报,当前代码可以正常编译。
CI 已在四平台通过(含 Android cargo check / macOS / Linux / Windows),若为真实编译错误,check 阶段会直接失败。 无需为此改动代码。 |
PR 合并冲突提示1. 与 #664 的包含关系
2. dictation.rs(与 #682、#688、#692)
3. 其他重叠(低风险)
建议合并顺序: 先定听写小修复(#682→#688→#692)与本 PR 谁先合,另一方 rebase 并解决 dictation.rs;不要同时合 #664。 |
User description
摘要
Fixes #653
非原文润色结果与 ASR 原文规范化比较后完全一致时,标记
polishUnchanged并在历史页提供「重新润色」;功能默认关闭,需在 设置 → 隐私 → 数据存储 开启「润色未变化检测」。修复 / 新增 / 改进
normalize_for_polish_compare+is_polish_unchanged;end_session在 pref 开启且非 raw 时写入errorCode = polishUnchanged。repolish_history_entryIPC / command;按原stylePackId(或 mode fallback)单轮润色并原地回写,保留id/createdAt/ 录音 / 插入状态。translationActive)禁止重新润色(UI + IPC);回写时仅重算None/polishUnchanged/polishFailed,保留focusRestoreFailed、windowsImeTsfRequired等插入错误码。DataStorageSection全局开关,默认 关。is_polish_unchanged、resolve_polish_unchanged_error_code、resolve_repolish_history_error_code等(CI Linux / macOS 已跑过)。兼容
repolish(rawText, mode)IPC。测试计划
命令:
npm run build结果:通过
证据路径:本地构建
命令:CI
workflow_dispatch(feat/issue-653-polish-unchanged)结果:4 job success(Android cargo check / macOS / Linux / Windows)
证据路径:https://github.com/HKLHaoBin/openless/actions/runs/27520160830
命令:
cargo test --lib(polish / repolish 相关,CI)结果:通过(Windows 本地缺 MSVC linker,未本地跑)
证据路径:同上 CI Linux / macOS job
命令:Android release APK 真机
adb install -r+ History / 设置操作结果:启动无 crash;pref 开启时列表 tag + 详情 banner +「重新润色」可见;点击重新润色触发 LLM;pref 关闭后 tag / banner / 按钮隐藏
证据路径:
ci-artifacts/openless-653-*.png(本地,未提交)命令:桌面端 History 回归(pref 开/关、重新润色、raw / 翻译条目)
结果:待 reviewer / 维护者复测
证据路径:—
PR Type
Enhancement, Bug fix
Description
Detect unchanged polish and allow re-polish from history
Add polish unchanged detection, repolish IPC, and UI
Fix Android release JNI crashes and overlay service issues
Update Android updater logic and CI for signed APK builds
Diagram Walkthrough
flowchart LR A[End session] --> B{polish unchanged?} B -- Yes --> C[Mark errorCode=polishUnchanged] B -- No --> D[Normal flow] C --> E[History detail shows banner + repolish button] E --> F[User clicks repolish] F --> G[IPC: repolish_history_entry] G --> H[Re-polish with original style pack] H --> I[Update entry in history]File Walkthrough
15 files
Add polish unchanged detection and repolish helpersAdd repolish_history_entry coordinator methodRefactor updater to use updater_logic helpersAdd pure updater helper functions with testsAdd repolish_history_entry IPC commandSupport auto-install for Android updatesEnable auto-install for Android background checksAdd polish unchanged badge and repolish buttonAdd polishUnchangedEnabled preference typeRework Beta toggle layout and add separate rowUse explicit channel labels for manual checksAdd Android auto-update toggle sectionAdd repolishHistoryEntry mock and invokeAdd polish unchanged detection toggleAdd script to validate pubkey consistency3 files
Add polish_unchanged_enabled preference fieldSupport signed release builds on workflow_dispatchAdd check:android-updater-pubkey script6 files
Fix accessibility state via Settings.SecureFix recording foreground service failure handlingAdd @Keep annotations to prevent R8 strippingAdd @Keep annotations to JNI methodsAdd @Keep and @JvmStatic annotationsAdd @Keep annotation to object3 files
Register repolish_history_entry commandExport updater_logic moduleAdd AutoUpdateSection to Advanced tab7 files
Add Japanese translations for polish unchangedAdd Traditional Chinese translations for polish unchangedAdd Korean translations for polish unchangedAdd Simplified Chinese translations for polish unchangedAdd English translations for polish unchangedUpdate docs for in-app updaterDocument updater and updater_logic modules2 files
Add polishUnchangedEnabled to test default prefsAdd pubkey check step