Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enables native UI (Linux GTK toolbar) to request Blazor route navigation via IToolbarService, and uses that mechanism to add a dedicated “Doctor” button on Linux for navigating to the diagnostic page.
Changes:
- Extended
IToolbarService/ToolbarServicewith aNavigationRequestedevent plusRequestNavigation(route)to bridge native UI → Blazor routing. - Wired
MainLayout.razorto listen for navigation requests and navigate viaNavigationManager. - Updated the Linux GTK header bar to reposition Settings and add a Doctor button that triggers navigation to
/doctor.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/MauiSherpa/Components/MainLayout.razor | Subscribes to toolbar navigation requests and performs Blazor navigation. |
| src/MauiSherpa.LinuxGtk/LinuxToolbarManager.cs | Adds/repositions persistent GTK header buttons (Settings + new Doctor) and triggers native→Blazor navigation. |
| src/MauiSherpa.Core/Services/ToolbarService.cs | Implements the new navigation request event + method on the toolbar service. |
| src/MauiSherpa.Core/Interfaces.cs | Extends IToolbarService contract to expose navigation requests from native UI. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Redth
approved these changes
Apr 2, 2026
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 pull request adds the ability for native UI elements to trigger navigation to Blazor routes, and introduces a new "Doctor" button to the Linux GTK toolbar that uses this feature to navigate to a diagnostic page. The changes include updates to the toolbar service interface and implementation, the GTK toolbar manager, and the main layout component to support and handle navigation requests from native UI.
Native-to-Blazor Navigation Integration:
NavigationRequestedand methodRequestNavigationto theIToolbarServiceinterface and implemented them inToolbarService, allowing native UI to request navigation to a specific Blazor route. [1] [2]NavigationRequestedevent inMainLayout.razorto perform navigation usingNavManager, and ensured proper event unsubscription during component disposal. [1] [2] [3]GTK Toolbar Enhancements:
/doctorroute via the new toolbar service method. Also repositioned the settings button to be beside the Copilot button for improved UI consistency.Part of this effort will be in conflict with #136 - but merge is simple