Repository navigation
feat: make Shell opt-in - #2074
Conversation
There was a problem hiding this comment.
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
splashboolean template parameter pluspresetSplashDefault,useSplash, anduseExtendedSplashScreensymbols. - Updated
Shell.xamlandShell.xaml.csto include ESS only whenuseExtendedSplashScreenis true (instead ofuseToolkit). - Exposed the
--splashflag 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.
There was a problem hiding this comment.
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
--shelltemplate 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
--shellscenarios.
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.
There was a problem hiding this comment.
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
shellparameter plususeExtendedSplashScreenand$navigationRootType$symbols, and excludes Shell-related files whenshellis 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
--shellscenarios.
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.
993f094 to
6fe3134
Compare
GitHub Issue (If applicable): related to #2073
PR Type
What kind of change does this PR introduce?
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
shelltemplate parameter makes Shell entirely opt-in. When--shellis not passed, Shell.xaml and its associated files (ShellModel/ShellViewModel) are completely excluded from the generated project:blankandrecommendedpresets defaultshelltofalse.shellis false: Shell files are excluded, navigation goes directly to MainPage, and route maps use flat routes instead of nested routes under Shell.shellis 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.$navigationRootType$replacement token resolves toShellorMainPagebased on theuseShellflag, keeping the NavigateAsync call clean.dotnet new unoapp -preset recommended --shellOther information
Files changed
shellparameter,presetShellDefault,useShell, andnavigationRootTypesymbols; updateduseExtendedSplashScreentouseShell && useToolkit; added(!useShell)file exclusion rule for Shell filesNavigateAsync<Shell>withNavigateAsync<$navigationRootType$>; added#if (useShell)branching in RegisterRoutes for nested vs flat route mapsuseExtendedSplashScreenconditional from prior commit)--splashwith--shellCLI flagsplashwithshellin preset defaults, Features MultiSelect, SymbolOverrides, and ExportableSymbols; removed Toolkit dependency (Shell works without it)RecommendedShellandRecommendedShellMarkuptest entries