Skip to content

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

Open
tomerqodo wants to merge 2 commits into
augment_full_base_featcore_back_button_event_on_android_closes_8142_pr6from
augment_full_head_featcore_back_button_event_on_android_closes_8142_pr6
Open

tomerqodo wants to merge 2 commits into
augment_full_base_featcore_back_button_event_on_android_closes_8142_pr6from
augment_full_head_featcore_back_button_event_on_android_closes_8142_pr6

Conversation

@tomerqodo

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#6

@augmentcode

augmentcode Bot commented Jan 26, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Adds Android back-button handling through a new mobile core app plugin and exposes it in the JS API.

Changes:

  • Bumps wry to 0.53.4 and enables back-navigation handling in the generated Android TauriActivity.
  • Adds an Android AppPlugin that intercepts back presses: triggers a back-button event when listeners exist, otherwise performs WebView back navigation or delegates to the activity back behavior.
  • Extends core app plugin ACL/permission generation to include register_listener / remove_listener.
  • Introduces app.onBackButtonPress and a typed payload (canGoBack) in @tauri-apps/api.
  • Adds changelog entries documenting the new plugin/API surface.

Technical Notes: The event payload exposes whether the WebView can navigate back so JS can decide whether to navigate or exit; default behavior remains when no listener is registered.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode 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.

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

}
}
}
(activity as AppCompatActivity).onBackPressedDispatcher.addCallback(activity, callback)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This hard-casts the host activity to AppCompatActivity, which will crash at runtime if a non-AppCompatActivity ever constructs this plugin. Also, addCallback(activity, ...) relies on the argument being a LifecycleOwner, so it may be worth ensuring the same AppCompatActivity instance is used for registration.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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