Skip to content

Conversation

@JeffTsang
Copy link

This PR depends on tauri-apps/wry#1624

@JeffTsang JeffTsang requested a review from a team as a code owner October 18, 2025 05:59
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Oct 18, 2025
@github-actions
Copy link
Contributor

Package Changes Through 2954c83

There are 11 changes which include @tauri-apps/api with minor, tauri-cli with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri with minor, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-build with minor, tauri-codegen with patch, tauri-macros with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.8.0 2.9.0
tauri-utils 2.7.0 2.8.0
tauri-bundler 2.6.1 2.7.0
tauri-runtime 2.8.0 2.9.0
tauri-runtime-wry 2.8.1 2.9.0
tauri-codegen 2.4.0 2.4.1
tauri-macros 2.4.0 2.4.1
tauri-plugin 2.4.0 2.4.1
tauri-build 2.4.1 2.5.0
tauri 2.8.5 2.9.0
@tauri-apps/cli 2.8.4 2.9.0
tauri-cli 2.8.4 2.9.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

nklact added a commit to nklact/normaai that referenced this pull request Nov 10, 2025
This commit fixes the critical issue where the app shows a blank screen when reopened after being inactive on iPhone for extended periods.

**Problem:**
- iOS terminates the WKWebView's WebContent process when app is backgrounded
- JavaScript-based detection cannot work because the JS engine is part of the terminated process
- Users see about:blank and must force-close the app

**Solution:**
1. Patched wry to dev branch with WebView process termination handler (wry#1624)
2. Added native iOS health monitoring in Rust that runs in main app process
3. Monitors WebView responsiveness every 2 seconds via JavaScript eval
4. Automatically reloads page when WebView becomes unresponsive
5. Removed ineffective JavaScript-only recovery code from App.jsx

**Technical Details:**
- Uses Cargo patch to pull wry from GitHub dev branch
- Native monitoring survives WebContent process termination
- Spawns background thread for continuous health checks
- See IOS_WEBVIEW_FIX.md for full documentation

**References:**
- Upstream fix: tauri-apps/wry#1624
- Related PR: tauri-apps/tauri#14325

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
nklact added a commit to nklact/normaai that referenced this pull request Nov 10, 2025
…tion

This commit replaces the polling-based workaround with a proper native implementation using Apple's official WKNavigationDelegate protocol.

**What Changed:**
1. Implemented native WKNavigationDelegate in webview_helper.rs using objc2
2. Added ProcessTerminationDelegate class that implements webViewWebContentProcessDidTerminate
3. Removed inefficient polling code that checked WebView health every 2 seconds
4. Removed unused imports (WebviewWindowExt, sel)
5. Updated documentation to reflect proper implementation

**Technical Implementation:**
- Forward-declared WKWebView and WKNavigationDelegate using objc2 extern declarations
- Created custom Objective-C class at runtime using define_class! macro
- Set navigation delegate directly on WKWebView instance
- Stored delegate in thread-local storage to keep it alive
- Automatically reloads page when iOS terminates WebContent process

**Benefits:**
✅ Uses Apple's official delegate method (proper standard)
✅ No polling - called directly by WebKit framework
✅ Zero performance impact when running normally
✅ No battery drain from background thread
✅ Clean, maintainable code following existing patterns
✅ Follows same objc2 pattern as keyboard scroll prevention

**References:**
- Apple WKNavigationDelegate: https://developer.apple.com/documentation/webkit/wknavigationdelegate
- wry PR #1624: tauri-apps/wry#1624
- Tauri PR #14325: tauri-apps/tauri#14325

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📬Proposal

Development

Successfully merging this pull request may close these issues.

1 participant