-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #178 from hotwired/query-param-visits
New path properties presentation option for same-path visits with query strings
- Loading branch information
Showing
7 changed files
with
120 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
turbo/src/main/kotlin/dev/hotwire/turbo/nav/TurboNavQueryStringPresentation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package dev.hotwire.turbo.nav | ||
|
||
/** | ||
* Represents how a given navigation destination should be presented when the current | ||
* location path on the backstack matches the new location path *and* a query string is | ||
* present in either location. | ||
* | ||
* Example situation: | ||
* current location: /feature | ||
* new location: /feature?filter=true | ||
*/ | ||
enum class TurboNavQueryStringPresentation { | ||
/** | ||
* A generic default value when no specific presentation value is provided and results in | ||
* generally accepted "normal" behavior — replacing the root when on the start destination and | ||
* going to the start destination again, popping when the location is in the immediate | ||
* backstack, replacing when going to the same destination, and pushing in all other cases. | ||
*/ | ||
DEFAULT, | ||
|
||
/** | ||
* Pops the current location off the nav stack and pushes the new location onto the nav stack. | ||
* If you use query strings in your app to act as a way to filter results in a destination, | ||
* this allows you to present the new (filtered) destination without adding onto the backstack. | ||
*/ | ||
REPLACE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters