docs: document that navigating to the shown view does nothing (#25629) (CP: 25.3) - #25656
Merged
Merged
Conversation
Part of #25580 **DX/docs** · flow-server · everyone who navigates to the view that is already shown Navigating to the view that is already shown does nothing, and the javadoc promised the opposite: it said the return value tells you whether the navigation happened, when it never does. Anyone who wanted the view rebuilt had no way to find the method that rebuilds it. Both are documented now; behaviour is unchanged. **Risks:** - ✅ Javadoc only, plus one test that pins the documented behaviour: no behaviour change, no API change, nothing deprecated. **Context.** The skip prevents navigation loops, because a `BeforeEnter` reroute and the client history sync go through the same call, so the behaviour stays as it is and only the javadoc was wrong. `refreshCurrentRoute(boolean)` already does the rebuild that was asked for. - Documented on all nine `UI.navigate` overloads that navigating to the location that is already shown does nothing: the view is not re-instantiated, no navigation lifecycle event fires, and `refreshCurrentRoute(boolean)` is the way to rebuild it. - Corrected `@return` on the seven overloads that return an `Optional`. It said "the view instance, if navigation actually happened"; the `Optional` holds the view that was already shown when the navigation was skipped, and is empty when a reroute or a forward went elsewhere. - Added the reciprocal cross-reference on `refreshCurrentRoute(boolean)`, which now says it is the way to rebuild the view that is currently shown and links back to `navigate`. - Added `UITest` coverage: navigating twice to the same target returns the same instance, and `refreshCurrentRoute(false)` replaces it.
vaadin-review-bot
approved these changes
Sep 11, 2026
Collaborator
Author
|
This PR is eligible for auto-merging policy, so it has been approved automatically. If there are pending conditions, auto merge (with 'squash' method) has been enabled for this PR [Message is sent from bot] |
vaadin-bot
enabled auto-merge (squash)
September 11, 2026 06:57
|
Contributor
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR cherry-picks changes from the original PR #25629 to branch 25.3.
Original PR description