Skip to content

docs: document that navigating to the shown view does nothing (#25629) (CP: 25.3) - #25656

Merged
vaadin-bot merged 1 commit into
25.3from
cherry-pick-25629-to-25.3-1789108781715
Sep 11, 2026
Merged

docs: document that navigating to the shown view does nothing (#25629) (CP: 25.3)#25656
vaadin-bot merged 1 commit into
25.3from
cherry-pick-25629-to-25.3-1789108781715

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

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

Original PR description

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.

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-bot

Copy link
Copy Markdown
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
vaadin-bot enabled auto-merge (squash) September 11, 2026 06:57
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 1 439 files  ±0   1 523 suites  ±0   1h 37m 11s ⏱️ - 1m 6s
12 037 tests +1  11 969 ✅ +1  68 💤 ±0  0 ❌ ±0 
12 355 runs  +1  12 287 ✅ +1  68 💤 ±0  0 ❌ ±0 

Results for commit 8d29c9f. ± Comparison against base commit 7c53777.

@vaadin-bot
vaadin-bot merged commit a2bc0c2 into 25.3 Sep 11, 2026
42 checks passed
@vaadin-bot
vaadin-bot deleted the cherry-pick-25629-to-25.3-1789108781715 branch September 11, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants