Skip to content

fix: subscribe to RoutedViewHost navigation commands - #184

Merged
glennawatson merged 1 commit into
mainfrom
CP_fix-routed-view-host-navigation
Aug 28, 2026
Merged

glennawatson merged 1 commit into
mainfrom
CP_fix-routed-view-host-navigation

Conversation

@ChrisPulman

@ChrisPulman ChrisPulman commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Bug fix and documentation/test correction for #185
Closes #185

What is the new behavior?

The routing example, routed-host demo fixture, and related tests subscribe to the observable returned by Router.Navigate.Execute(...). The README now explains that ReactiveCommand.Execute is cold and must be subscribed to or awaited.

What is the current behavior?

The previous example and test/demo call sites discarded the observable returned by Execute, so navigation was never performed and RoutedViewHost remained on its default content.

Checklist

  • Tests have been added or updated (for bug fixes / features)
  • Docs have been added or updated (for bug fixes / features)
  • Changes target the main branch
  • PR title follows Conventional Commits

Additional information

Addresses #185.

No ReactiveUI.Avalonia production-code change is required because the reported behavior is caused by an unexecuted cold navigation observable.

Validation:

  • Release solution build passed with warnings treated as errors.
  • ReactiveUI.Avalonia.Tests: 162/162 TUnit tests passed on net10.0.
  • ReactiveUI.Avalonia.Reactive.Tests: 31/31 TUnit tests passed on net10.0.
  • ReactiveUI.Avalonia.DryIoc.Tests: 7/7 TUnit tests passed on net10.0.
  • RoutedViewHost coverage: 100% line and branch coverage.

Documentation:
- update the routing example to execute the cold navigation observable
- explain that ReactiveCommand.Execute must be subscribed to or awaited

Tests and samples:
- execute navigation in RoutedViewHost coverage tests
- update the shared routed-view-host fixture without adding a System.Reactive dependency
- preserve navigation failures by rethrowing observer errors
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.89%. Comparing base (aaead28) to head (15049fb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     reactiveui/ReactiveUI#184   +/-   ##
=======================================
  Coverage   87.89%   87.89%           
=======================================
  Files          18       18           
  Lines         636      636           
  Branches      105      105           
=======================================
  Hits          559      559           
  Misses         76       76           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisPulman
ChrisPulman marked this pull request as ready for review August 27, 2026 21:57
@glennawatson
glennawatson merged commit f8ffdd6 into main Aug 28, 2026
6 checks passed
@glennawatson
glennawatson deleted the CP_fix-routed-view-host-navigation branch August 28, 2026 09:02
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: RoutedViewHost does not resolve LoginView in ReactiveUI.Avalonia 12.1.1

2 participants