Skip to content

feat(windows): WebView2 lazy webviews + Android auto-update + history repolish#694

Closed
HKLHaoBin wants to merge 13 commits into
Open-Less:betafrom
HKLHaoBin:feat/webview2-memory-opt
Closed

feat(windows): WebView2 lazy webviews + Android auto-update + history repolish#694
HKLHaoBin wants to merge 13 commits into
Open-Less:betafrom
HKLHaoBin:feat/webview2-memory-opt

Conversation

@HKLHaoBin

@HKLHaoBin HKLHaoBin commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

User description

Summary

  • Windows (WebView2 memory): Lazy-create auxiliary webviews (QA, less-computer, glow) and destroy them on dismiss; add QaStateSnapshot for cold-start hydrate; lazy-load FloatingShell tabs and Settings sections to shrink main-window first paint and idle renderer count.
  • Android auto-update: Background check/download with stable/beta channels, settings UI alignment, updater logic extraction + unit tests, CI release signing on dispatch when keystore secrets exist, and fixes for launch-time JNI crashes (Build.SUPPORTED_ABIS, accessibility state, ProGuard @Keep on bridge methods).
  • History ([area:style] 润色结果偶发与原文完全一致,缺少重试提示 #653): Opt-in polish-unchanged detection, history-level repolish IPC/UI (excluding translation history), and preserve insert error codes on retry.
  • Dictation: Compute done_message before moving error_code into session (fixes a move-after-use bug).

Test plan

  • Windows: cold start — confirm main window loads; open/close QA panel, glow, less-computer; verify auxiliary webviews are created on demand and memory drops after dismiss
  • Windows: QA panel re-open after dismiss — state hydrates via snapshot
  • Android: launch app — no crash ~4s after start (updater background check)
  • Android: auto-update settings — stable/beta toggle, manual check, download + install flow
  • Android: overlay recording still works after foreground-service changes
  • History: enable polish-unchanged detection; verify repolish retry on unchanged polish; translation history excluded
  • Dictation: error paths still emit correct done message

PR Type

Bug fix, Enhancement, Tests


Description

  • Lazy-create auxiliary webviews (qa, less-computer)

  • Android auto-update with stable/beta channels

  • Detect polish unchanged and allow history repolish

  • Fix JNI read of Build.SUPPORTED_ABIS


Diagram Walkthrough

flowchart LR
  subgraph Desktop
    A[WebView2 lazy-create] --> B[qa/less-computer/glow]
    C[Hide→destroy] --> D[Free memory]
  end
  subgraph Android
    E[AutoUpdateGate] --> F[stable/beta manifest]
    F --> G[Download+install]
  end
  subgraph History
    H[Polish unchanged detection] --> I[mark polishUnchanged]
    I --> J[Repolish button]
  end
Loading

File Walkthrough

Relevant files
Enhancement
28 files
lib.rs
Add repolish/show QA window commands; lazy webview creation
+82/-33 
dictation.rs
Detect polish unchanged; resolve error codes; add tests   
+272/-9 
coordinator.rs
Add QA snapshot, repolish methods, style-pack resolution 
+137/-14
types.rs
Add polish_unchanged_enabled pref; update comments             
+17/-11 
history.rs
Add repolish_history_entry command                                             
+9/-0     
qa.rs
Add get_qa_window_state command and snapshot struct           
+13/-0   
mod.rs
Register updater_logic module                                                       
+1/-0     
AutoUpdate.tsx
Add autoInstallAndroid option; update dialog strings         
+80/-54 
QaPanel.tsx
Refactor state handling; add cold-start hydrate                   
+101/-59
FloatingShell.tsx
Lazy load non-overview tabs and settings modal                     
+38/-26 
History.tsx
Add repolish button and unchanged tag                                       
+51/-2   
types.ts
Add QaStateSnapshot, polishUnchangedEnabled fields             
+18/-6   
SettingsModal.tsx
Lazy load services, privacy, advanced tabs                             
+27/-7   
BetaChannelSection.tsx
Restructure layout; separate toggle and check button         
+12/-15 
ipc.ts
Add repolishHistoryEntry and getQaWindowState mocks           
+32/-0   
CheckUpdateButton.tsx
Show channel-specific button labels                                           
+5/-9     
AutoUpdateGate.tsx
Pass autoInstallAndroid to checkForUpdates                             
+6/-9     
AutoUpdateSection.tsx
Add Android auto-update toggle section                                     
+36/-0   
DataStorageSection.tsx
Add polish unchanged detection toggle                                       
+10/-1   
AdvancedTab.tsx
Compose advanced settings sections                                             
+34/-0   
PrivacyTab.tsx
Lazy load privacy tab                                                                       
+37/-0   
GeneralTab.tsx
Lazy load general tab                                                                       
+28/-0   
ServicesTab.tsx
Lazy load services tab                                                                     
+13/-0   
check-android-updater-pubkey.mjs
Add script to verify pubkey consistency                                   
+37/-0   
OpenLessOverlayBridge.kt
Adjust overlay bridge for new features                                     
+4/-0     
OpenLessAccessibilityService.kt
Align heartbeat with Rust-side checks                                       
+3/-0     
OpenLessUpdateInstaller.kt
Improve install result reporting                                                 
+4/-0     
OpenLessPermissionBridge.kt
Permission handling adjustments                                                   
+3/-0     
Bug fix
3 files
updater.rs
Extract constants; fix JNI field read; add install check 
+19/-65 
jni.rs
Rewrite accessibility checks via Settings.Secure                 
+136/-23
OpenLessOverlayService.kt
Update for background update integration                                 
+37/-18 
Tests
2 files
updater_logic.rs
Add version compare, manifest URLs, pubkey; unit tests     
+123/-0 
stylePrefs.test.ts
Add polishUnchangedEnabled to test defaults                           
+3/-2     
Documentation
7 files
ja.ts
Add Japanese translations for new features                             
+18/-1   
zh-TW.ts
Add Traditional Chinese translations                                         
+18/-1   
ko.ts
Add Korean translations                                                                   
+18/-1   
zh-CN.ts
Add Simplified Chinese translations                                           
+18/-1   
en.ts
Add English translations                                                                 
+18/-1   
android-mobile-apk-overlay-plan.md
Update documentation for auto-update                                         
+26/-2   
README.md
Update build instructions                                                               
+2/-0     
Configuration changes
3 files
android-apk.yml
Add release signing for manual dispatch                                   
+64/-10 
tauri.conf.json
Set create:false for auxiliary windows; update updater pubkey
+3/-0     
ci.yml
Add pubkey check job                                                                         
+3/-0     
Dependencies
1 files
package.json
Dependency adjustments for lazy loading                                   
+2/-1     
Additional files
1 files
tabs.tsx +0/-106 

HKLHaoBin and others added 13 commits June 14, 2026 20:58
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>
Reduce idle WebView2 renderers by creating qa/less-computer/glow on demand and destroying on dismiss; add QA state snapshot for cold-start hydrate; lazy-load FloatingShell tabs and Settings sections for smaller main-window first paint.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

653 - Partially compliant

Compliant requirements:

  • 润色未变化检测:添加了 is_polish_unchangednormalize_for_polish_compare 函数,在 end_session 中调用 resolve_polish_unchanged_error_code 生成 polishUnchanged 错误码。
  • 用户反馈:done_message 中返回中文提示“本次润色未产生变化,可在历史中重新润色”;历史详情页展示黄色提示条。
  • 历史记录标识:列表中添加 polishUnchanged Pill 标签;详情页显示提示块。
  • 重新润色操作:历史详情页提供「重新润色」按钮(触发 repolish_history_entry IPC),复用原 raw_transcript,无需重新录音。
  • 功能默认关闭(polish_unchanged_enabled: false),用户可在设置中开启。

Non-compliant requirements:

  • (无)

Requires further human verification:

  • (无)
⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

appergb added a commit that referenced this pull request Jun 19, 2026
合并 #704(安卓应用内自动更新 + JNI 修复)并把 PC updater 修复同步到安卓:①安卓公钥回退 6F4B5994→1DEAA803(同步#705)②installError 安装失败兜底+去 throw(同步#708)③还原被自动合并误删的桌面 logClientError。桌面机制零变更。CI 全绿 + @claude 审核通过。取代 #704#694 安卓部分。
@Felix201209

Copy link
Copy Markdown
Collaborator

感谢投入,但这个 PR 先关闭一下 🙏

主要问题是一个 PR 里捆绑了三块互不相关的改动,共 1715 行 / 47 个文件:

  1. Windows WebView2 懒加载 / 内存优化(QaPanelqa.rsFloatingShell 懒加载等)
  2. Android 自动更新(OpenLessUpdateInstaller.ktupdater.rs / updater_logic.rsAutoUpdate*.tsxBetaChannelSectionandroid-apk.yml 等)
  3. 历史记录 repolish(History.tsxhistory.rs

这种捆绑违反单一职责,审查、回归、出问题时回滚都很困难;而且重型构建 CI(Linux / Windows / macOS checks)此前没跑过,只有 pr_agent_job

建议按上面三个关注点拆成三个独立 PR,各自审查、各自合并。欢迎拆分后重新提交,关闭不代表否定其中任何一块。

katanumahotori added a commit to katanumahotori/openless that referenced this pull request Jun 26, 2026
整形(polish)結果が空(finalText空)になると、履歴の「コピー」が空文字を
コピーし、画面に見えている識別原文を UI から取り出せなかった。
- onCopy: finalText が空白のみのとき rawTranscript にフォールバック
- 原文パネルに独立コピーボタン追加(rawTranscript がある時のみ表示)
- 既存 common.copy/common.copied を流用、i18n 追加なし、フロントのみ

上流(Open-Less/openless)へ出す issue/PR 下書きを docs に追加。
既存の Open-Less#653 / 閉じた Open-Less#666Open-Less#694(履歴再整形)とは重複しない別の
基礎的バグ(finalText 空・errorCode 未設定)として整理。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jiangmuran pushed a commit that referenced this pull request Jun 27, 2026
… + copy button on raw panel (#752)

When polishing returns an empty finalText (errorCode stays null), the History
"Copy" button copied an empty string, so the raw transcript that is still
visible in the UI could not be recovered. Re-transcribe does not apply here
(ASR succeeded; polish is what failed).

- onCopy: fall back to rawTranscript when finalText is blank
- raw panel: add a dedicated copy button (shown only when rawTranscript exists)
- reuse existing common.copy / common.copied, no new i18n; frontend-only

Complements #653 (polish identical to raw); independent of the in-progress
history re-polish work (#666/#694). No backend/IPC changes.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants