Skip to content

feat: Enhance navigation initialization for shell support in App class - #2093

Merged
kazo0 merged 3 commits into
mainfrom
dev/sb/no-shell-nav
May 5, 2026
Merged

kazo0 merged 3 commits into
mainfrom
dev/sb/no-shell-nav

Conversation

@kazo0

@kazo0 kazo0 commented May 5, 2026

Copy link
Copy Markdown
Contributor

This pull request updates the app launch logic in App.recommended.cs to improve how navigation is initialized, especially when using the shell template and authentication. The changes streamline navigation setup and ensure that the correct initial route or view model is loaded based on authentication status.

Navigation initialization improvements:

  • When using the shell template without authentication, navigation is now initialized via MainWindow.InitializeNavigationAsync, specifying the initial route as "Main" for a clearer and more consistent startup experience.
  • When using the shell template with authentication, navigation is initialized with a new initialNavigate delegate. This delegate checks authentication status and navigates to either the main or login view model accordingly, ensuring users are directed to the appropriate screen on launch.

Copilot AI review requested due to automatic review settings May 5, 2026 04:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the App launch flow in the Uno.Extensions navigation template to change how navigation is initialized in OnLaunched, adding MainWindow.InitializeNavigationAsync(...) paths and adjusting initial navigation behavior when authentication is enabled.

Changes:

  • Add a non-auth navigation initialization path using MainWindow.InitializeNavigationAsync(..., initialRoute: "Main") under the non-shell branch.
  • Add an auth-aware initialization path using MainWindow.InitializeNavigationAsync(..., initialNavigate: ...) under the non-shell branch, mirroring the existing builder.NavigateAsync(..., initialNavigate: ...) logic.
  • Add #if (shell) branching around the existing builder.NavigateAsync paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@kazo0

kazo0 commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ kazo0
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

@copilot apply changes based on the comments in this thread

Applied all changes from the review thread in commit 2d3bed5:

  1. Branch confusion (shell vs non-shell): The code was already correct — builder.NavigateAsync<$navigationRootType$>() is used for the shell path (requires a typed root), and MainWindow.InitializeNavigationAsync(...) is used for the non-shell path. The PR description had the wording backwards.

  2. CS1998 async warning (async () => builder.Build()): Already fixed in the !useAuthentication path; the remaining instance in the auth path is now also fixed to () => Task.FromResult(builder.Build()).

  3. Duplicate initialNavigate lambda: Extracted into a single InitialNavigate local function defined before the #if (shell) branch, which both the shell and non-shell auth paths now reference.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • crl.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/E7B5E0C97290FB53C2DCA420CF493E2A/missingpackages_workingdir --packages /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • josvsblobprodcus372.blob.core.windows.net
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/E7B5E0C97290FB53C2DCA420CF493E2A/missingpackages_workingdir --packages /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • k4kvsblobprodcus344.blob.core.windows.net
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/E7B5E0C97290FB53C2DCA420CF493E2A/missingpackages_workingdir --packages /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • ocsp.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/E7B5E0C97290FB53C2DCA420CF493E2A/missingpackages_workingdir --packages /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • st8vsblobprodcus339.blob.core.windows.net
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/BFFC70736DA5D9CF3FC363BB1FA27302/missingpackages_workingdir --packages /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-1c2f7738df64b749/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of kazo0 May 5, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants