Skip to content

feat: make Shell opt-in - #2074

Merged
agneszitte merged 3 commits into
mainfrom
dev/mara/optional-ess
May 1, 2026
Merged

agneszitte merged 3 commits into
mainfrom
dev/mara/optional-ess

Conversation

@rajamatt

@rajamatt rajamatt commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): related to #2073

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

Shell.xaml is always included when using Uno.Extensions navigation (regions). The recommended preset enables Toolkit by default, which means every recommended-preset project gets Shell with an ExtendedSplashScreen, and non-Toolkit projects get Shell with a nearly empty ContentControl wrapper. There is no way to exclude Shell without switching to frame-based navigation.

What is the new behavior?

A new shell template parameter makes Shell entirely opt-in. When --shell is not passed, Shell.xaml and its associated files (ShellModel/ShellViewModel) are completely excluded from the generated project:

  • Both blank and recommended presets default shell to false.
  • When shell is false: Shell files are excluded, navigation goes directly to MainPage, and route maps use flat routes instead of nested routes under Shell.
  • When shell is true: Shell.xaml is included as the root navigation container with nested route maps. If Toolkit is also enabled, the ExtendedSplashScreen is used inside Shell; otherwise a plain ContentControl is used.
  • A $navigationRootType$ replacement token resolves to Shell or MainPage based on the useShell flag, keeping the NavigateAsync call clean.
  • CLI usage: dotnet new unoapp -preset recommended --shell

Other information

Files changed

  • template.json -- Added shell parameter, presetShellDefault, useShell, and navigationRootType symbols; updated useExtendedSplashScreen to useShell && useToolkit; added (!useShell) file exclusion rule for Shell files
  • App.recommended.cs -- Replaced NavigateAsync<Shell> with NavigateAsync<$navigationRootType$>; added #if (useShell) branching in RegisterRoutes for nested vs flat route maps
  • Shell.xaml / Shell.xaml.cs -- Unchanged (already use useExtendedSplashScreen conditional from prior commit)
  • dotnetcli.host.json -- Replaced --splash with --shell CLI flag
  • TemplateWizard.json -- Replaced splash with shell in preset defaults, Features MultiSelect, SymbolOverrides, and ExportableSymbols; removed Toolkit dependency (Shell works without it)
  • CI test matrix -- Added RecommendedShell and RecommendedShellMarkup test entries

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 makes the Extended Splash Screen (ESS) optional in the unoapp template by introducing a new splash template parameter and gating ESS inclusion behind a computed useExtendedSplashScreen symbol (which also requires Toolkit).

Changes:

  • Added a splash boolean template parameter plus presetSplashDefault, useSplash, and useExtendedSplashScreen symbols.
  • Updated Shell.xaml and Shell.xaml.cs to include ESS only when useExtendedSplashScreen is true (instead of useToolkit).
  • Exposed the --splash flag for CLI and added the option (with Toolkit dependency) to the Studio Template Wizard presets/features.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Presentation/Shell.xaml.cs Gates the ESS C#-markup branch behind useExtendedSplashScreen.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Presentation/Shell.xaml Gates the ESS XAML branch behind useExtendedSplashScreen.
src/Uno.Templates/content/unoapp/.template.config/template.json Introduces the splash parameter and computed symbol used to control ESS inclusion.
src/Uno.Templates/content/unoapp/.template.config/dotnetcli.host.json Adds CLI symbol mapping for --splash.
src/Uno.Templates/content/unoapp/.template.config/TemplateWizard.json Adds splash defaults to presets and exposes it as a feature with a Toolkit requirement.

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

@rajamatt
rajamatt marked this pull request as draft April 29, 2026 18:13
@rajamatt
rajamatt marked this pull request as ready for review May 1, 2026 13:52
@rajamatt rajamatt changed the title feat: make ExtendedSplashScreen opt-in feat: make Shell opt-in May 1, 2026
@rajamatt
rajamatt requested a review from Copilot May 1, 2026 14:54

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

Makes Shell.xaml optional in the unoapp template so projects can use Uno.Extensions regions navigation without the extra Shell wrapper by default (addressing issue #2073).

Changes:

  • Added a new --shell template parameter and generated symbols (useShell, $navigationRootType$, useExtendedSplashScreen) to make Shell opt-in and keep splash logic tied to Shell+Toolkit.
  • Updated recommended navigation startup and route registration to support both nested (Shell root) and flat (MainPage root) route maps.
  • Updated wizard/CLI wiring and CI matrix to cover --shell scenarios.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Presentation/Shell.xaml.cs Switches conditional splash UI to useExtendedSplashScreen (Shell+Toolkit).
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Presentation/Shell.xaml Aligns XAML conditional blocks with useExtendedSplashScreen.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/App.recommended.cs Uses $navigationRootType$ for startup navigation and branches route maps based on useShell.
src/Uno.Templates/content/unoapp/.template.config/template.json Introduces shell parameter, useShell/navigationRootType symbols, updates splash computation, and excludes Shell files when not selected.
src/Uno.Templates/content/unoapp/.template.config/dotnetcli.host.json Adds --shell CLI switch mapping.
src/Uno.Templates/content/unoapp/.template.config/TemplateWizard.json Adds shell to wizard defaults and selectable features.
.github/actions/ci/generate-test-matrix/action.yml Adds CI matrix coverage for -preset recommended --shell (including C# markup).

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

@agneszitte
agneszitte requested a review from nickrandolph May 1, 2026 15:11
@rajamatt
rajamatt marked this pull request as draft May 1, 2026 15:16
@rajamatt
rajamatt marked this pull request as ready for review May 1, 2026 16:24
@rajamatt
rajamatt requested review from Copilot and kazo0 May 1, 2026 16:24

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

Adds an opt-in --shell template parameter to Uno Templates so Shell.xaml (and its related model/viewmodel) is only generated when explicitly requested, simplifying the default regions-navigation output.

Changes:

  • Introduces a new shell parameter plus useExtendedSplashScreen and $navigationRootType$ symbols, and excludes Shell-related files when shell is false.
  • Updates recommended app startup + route registration to support Shell (nested routes) vs no-Shell (flat routes) generation.
  • Extends CLI/wizard surface area and CI template matrix to cover --shell scenarios.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Presentation/Shell.xaml.cs Switches splash conditional to useExtendedSplashScreen in C# markup variant.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Presentation/Shell.xaml Switches splash conditional to useExtendedSplashScreen in XAML variant.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/App.recommended.cs Uses $navigationRootType$ for startup navigation; routes are nested only when shell is enabled.
src/Uno.Templates/content/unoapp/.template.config/template.json Adds shell parameter, computes useExtendedSplashScreen, adds $navigationRootType$, and excludes Shell files when not selected.
src/Uno.Templates/content/unoapp/.template.config/dotnetcli.host.json Exposes --shell flag in dotnet new CLI host config.
src/Uno.Templates/content/unoapp/.template.config/TemplateWizard.json Adds shell to wizard presets/features/exportable symbols and feature metadata.
.github/actions/ci/generate-test-matrix/action.yml Adds CI matrix entries for recommended preset with --shell (including C# markup).

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

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.

4 participants