Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server driven navigation without path configuration #74

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jpsphaxer
Copy link

This PR addresses Issue #71, which proposed adding support for server-driven routes like /recede_historical_location, /resume_historical_location, and /refresh_historical_location. These routes are designed to handle navigation stack behaviors (pop, refresh, or no-op) based on directives from the server.

Implementation Overview

I've introduced a new extension to the NavigationHierarchyController class to handle these historical location routes. Key changes include:

Route Handling:

  • Added a handleHistoricalLocation(proposal:) method to process specific historical routes and execute actions such as:
    • recede_historical_location: Pops the current view or dismisses a modal.
    • resume_historical_location: No-op (does nothing).
    • refresh_historical_location: Refreshes the current view via a VisitProposal.

Route Detection:

Added an isHistoricalLocation(_:) helper method to determine if a given URL matches one of the _historical_location patterns.

Routing Logic:

Updated route(controller:proposal:) to check for historical location routes before falling back to default routing logic.

Goals of This PR

  • Start the Discussion: This is a proof of concept, and I’d like to gather feedback on whether this is the right direction for implementation.
  • Evaluate the Approach: Does adding this logic to NavigationHierarchyController align with the desired architecture? Is there a better way to integrate this functionality natively without requiring explicit path configurations?
  • Explore Next Steps: If this approach works, we could look into automating or simplifying the configuration process.

Notes:

I will be adding tests in the coming days - just wanted to see what the initial reaction might be.

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.

1 participant