Skip to content

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

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

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

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.

1 participant