Skip to content

feat(core): back button event on Android, closes #8142 - #6

Open
tomerqodo wants to merge 2 commits into
cursor_full_base_featcore_back_button_event_on_android_closes_8142_pr6from
cursor_full_head_featcore_back_button_event_on_android_closes_8142_pr6
Open

tomerqodo wants to merge 2 commits into
cursor_full_base_featcore_back_button_event_on_android_closes_8142_pr6from
cursor_full_head_featcore_back_button_event_on_android_closes_8142_pr6

Conversation

@tomerqodo

@tomerqodo tomerqodo commented Jan 26, 2026 •

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#6


Note

Adds Android back button handling and corresponding JS API, plus listener infrastructure and build integration.

  • Mobile plugin (Android): New AppPlugin intercepts back presses; emits app > back-button with canGoBack; falls back to WebView goBack() or default back; adds exit command. Auto-generated TauriActivity now sets handleBackNavigation = true.
  • JS API: Adds app.onBackButtonPress(handler) and OnBackButtonPressPayload; wires through addPluginListener in global bundle and packages/api/src/app.ts.
  • Core/build/permissions: Enables register_listener/remove_listener commands for core:app; registers the Android plugin in app setup; updates permissions docs.
  • Deps/other: Bumps wry to 0.53.4 (and related windows crates); minor Android path code cleanup; regenerates global API bundle.

Written by Cursor Bugbot for commit 5a010d0. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

{
let handle = _api.register_android_plugin("app.tauri", "AppPlugin")?;
let handle_ref = &handle;
_app.manage(AppPlugin(*handle_ref));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid move out of reference for non-Copy type

High Severity

The code creates a reference handle_ref to handle and then attempts to dereference it with *handle_ref. Since PluginHandle<R> implements Clone but not Copy, this attempts an invalid move out of a shared reference. The intermediate reference serves no purpose — the code can simply pass handle directly to AppPlugin(handle).

Fix in Cursor Fix in Web

fun exit(invoke: Invoke) {
activity.finish()
invoke.resolve()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Command exit is unreachable due to missing permission

Low Severity

The exit command is annotated with @Command but has no corresponding permission entry in build.rs and no TypeScript API exposure. Plugin commands require permissions to be callable via the invoke system. Without adding ("exit", false) to the core:app commands in build.rs, this command is dead code that can never be reached through JavaScript.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant