Skip to content

Conversation

@jayohms
Copy link
Contributor

@jayohms jayohms commented Apr 10, 2025

This is the Android equivalent of the iOS changes here: hotwired/hotwire-native-ios#76

Context

Turbo Native allows server-driven routing in Rails applications. Previously, developers had to explicitly define these routing rules in the path config. This PR adds default routing rules for server-driven navigation directly into the framework.

Changes

  • recede, resume and refresh historical location rules (historical location rules) have been added as PathConfigurationRules.
  • historical location rules are now loaded by default whether or not the source of the path config is provided.

Historical Location Behaviour

resume_historical_location

  1. Dismiss the modal destination.
  2. Arrive back at the destination on the "default" stack.

refresh_historical_location

  1. Dismiss the modal destination.
  2. Arrive back at the destination on the "default" stack.
  3. Refresh the destination no the "default" stack by revisiting the location.

recede_historical_location

  1. Dismiss the modal destination.
  2. Arrive back at the destination on the "default" stack.
  3. Pop the destination on the "default" stack (unless it's already at the beginning of the backstack).
  4. This will trigger a refresh on the appeared destination if the snapshot cache has been cleared by a form submission.

@jayohms jayohms mentioned this pull request Apr 10, 2025
2 tasks
@jayohms jayohms merged commit 25ec6c7 into main Apr 10, 2025
1 check passed
@jayohms jayohms deleted the historical-location-urls branch April 10, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants