feat(core): back button event on Android, closes #8142 - #6
Conversation
📝 WalkthroughWalkthroughThis pull request implements Android back button event handling for Tauri apps across multiple layers. Changes include a new Android plugin managing back navigation, Kotlin/Rust platform-specific code, JavaScript listener API, updated permissions, and a dependency update to wry 0.53.4 with linux-body support. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Activity as Android Activity
participant AppPlugin as AppPlugin<br/>(Kotlin)
participant WebView as WebView
participant Runtime as Tauri Runtime<br/>(JS/Rust)
User->>Activity: Press back button
Activity->>AppPlugin: onBackPressed callback
AppPlugin->>AppPlugin: hasListener("back-button")?
alt Listener registered
AppPlugin->>AppPlugin: Check canGoBack state
AppPlugin->>Runtime: emit back-button event<br/>(canGoBack payload)
Runtime->>Runtime: JS handler receives event
Runtime->>WebView: Handle in app logic
else No listener
AppPlugin->>WebView: goBack() if history exists
alt WebView history available
WebView->>WebView: Navigate back
else No history
AppPlugin->>Activity: System back press
Activity->>Activity: Pop back stack
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Benchmark PR from agentic-review-benchmarks#6
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.