Visitar URL original
feat: add --shell-layout option to the unoapp template (NavigationView / TabBar / TabView) by MartinZikmund · Pull Request #2126 · unoplatform/uno.templates · GitHub
Skip to content

feat: add --shell-layout option to the unoapp template (NavigationView / TabBar / TabView) - #2126

Open
MartinZikmund wants to merge 7 commits into
mainfrom
dev/mazi/shell-layouts
Open

MartinZikmund wants to merge 7 commits into
mainfrom
dev/mazi/shell-layouts

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

What

Adds a --shell-layout option to the unoapp template for scaffolding a menu-based application shell.

--shell-layout Control Frame mode Regions mode
blank (default) — single content page single content page
navview WinUI NavigationView NavigationView + Frame (code-behind) NavigationView region
tabbar Uno.Toolkit TabBar TabBar + Frame (code-behind) TabBar region
tabview WinUI TabView static tabbed documents static tabbed documents (plain)
  • navview / tabbar are navigation shells and auto-adapt to the app's navigation model: region-based (uen:Region.Attached) with DI + Uno.Extensions.Navigation (the recommended preset), otherwise plain Frame navigation.
  • tabbar uses the Uno.Toolkit TabBar, so it requires the Toolkit (default in recommended; -toolkit true in blank).
  • tabview is a plain, static WinUI TabView (tabbed documents); it does not use regions and works in any preset.
  • C# Markup currently falls back to the single page (shell layouts are XAML-only for now).

Validation

All 6 combos (navview / tabbar / tabview × frame / regions) generate and build on the desktop head.

Docs / CI

docs/shell-layouts.md + README link; 6 CI matrix rows covering the combos above.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 27, 2026 17:30

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 adds a new --shell-layout option to the unoapp template to scaffold common app shells (NavigationView, TabBar, TabView) with behavior that adapts to the selected navigation model (Frame vs Uno.Extensions regions).

Changes:

  • Introduces the shellLayout template parameter (CLI: --shell-layout) and supporting computed symbols to drive conditional generation.
  • Adds shell UI implementations for Frame navigation (MyExtensionsApp.1/MainPage.xaml(.cs)) and for region-based navigation (MyExtensionsApp.1/Presentation/MainPage.xaml), plus new basic pages for Frame-based shells.
  • Documents the feature (docs/shell-layouts.md, README link) and extends CI template-generation coverage with 6 new matrix entries.

Reviewed changes

Copilot reviewed 15 out of 15 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/MainPage.xaml Adds region-based NavigationView/TabBar/TabView shell layouts using uen:Region.*.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Pages/SettingsPage.xaml.cs Adds Settings page code-behind for Frame-based NavigationView settings navigation.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Pages/SettingsPage.xaml Adds Settings page UI scaffold.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Pages/HomePage.xaml.cs Adds Home page code-behind for Frame-based shells.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Pages/HomePage.xaml Adds Home page UI scaffold.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Pages/AboutPage.xaml.cs Adds About page code-behind for Frame-based shells.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Pages/AboutPage.xaml Adds About page UI scaffold.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/MainPage.xaml.cs Adds code-behind navigation wiring for NavigationView/TabBar Frame-based shells.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/MainPage.xaml Adds Frame-based NavigationView/TabBar shells and a static TabView shell.
src/Uno.Templates/content/unoapp/MyExtensionsApp.1/App.recommended.cs Adds nested routes for Home/About under Main when using region-based navview/tabbar shells.
src/Uno.Templates/content/unoapp/.template.config/template.json Adds shellLayout parameter, computed booleans, and excludes Pages when not needed.
src/Uno.Templates/content/unoapp/.template.config/dotnetcli.host.json Maps shellLayout to CLI --shell-layout.
README.md Links to new shell-layout documentation.
docs/shell-layouts.md Adds user-facing documentation and examples for --shell-layout.
.github/actions/ci/generate-test-matrix/action.yml Adds CI matrix rows to cover navview/tabbar/tabview × frame/regions combinations.

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

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The generated source checks are positive: in isolated hives I generated blank NavigationView/Frame, recommended TabBar/regions, recommended TabBar/Frame (-nav blank), and blank TabView. The selected pages, handlers and nested routes match those modes; TabBarItem's default IsSelectable is true, so the Frame branch need not repeat the region branch's explicit value. I have not confirmed a compiled app/navigation run for this head, and the current check list contains analysis/summary checks rather than the platform matrix evidence. Leaving this without approval until that new UI behavior is covered by an actual generated-app build/navigation run; the generation checks alone are not runtime validation.

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The runtime-validation gap from my earlier comment is now covered. I generated, built and launched all six shell cases from this head's CI-produced Uno.Templates/Uno.Sdk 7.0.0-dev.10.gff611b3250, then exercised the actual controls through accessibility actions:

Generated case Observed navigation/content
NavigationView + Frame Home -> About -> Settings -> Home
NavigationView + regions Home -> About -> Home
Toolkit TabBar + Frame Home -> About -> Home
Toolkit TabBar + regions Home -> About -> Home
TabView, blank preset Home -> About -> Home
TabView, recommended preset Home -> About -> Home

For every switch I checked both the selected item and the actual content text, not just the tab/menu label. These were unmodified generated UI sources on Windows Skia Desktop, Release/net10.0-desktop, using .NET SDK 10.0.102, Uno runtime 6.8.0-dev.130, and the pinned Toolkit 9.2.0-dev.19 / Navigation 7.4.0-dev.29 where applicable. The supported UnoDisableHotDesign=true build switch omitted unavailable optional design tooling; no runtime/navigation package versions were substituted. The missing packages were obtained from the repository-declared development feed.

The generated-app CI matrix also completed all 72 platform jobs successfully. The interactive checks above were Skia Desktop only; I am not claiming native WinAppSDK, mobile or browser UI execution.

@mergify

mergify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/shell-layouts branch 2 times, most recently from a1996b8 to 0273038 Compare September 29, 2026 15:24
@mergify

mergify Bot commented Sep 29, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

MartinZikmund and others added 7 commits November 4, 2026 15:57
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds shellLayout choice (blank/navview/tabbar), the useNavView*/useTabBar*
computed symbols, a Pages/** exclusion for non-navview-frame, and the
--shell-layout CLI option. shortName is "shell-layout" (empty is rejected).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Plain WinUI shells for the non-extensions navigation path: root MainPage hosts
a NavigationView+Frame (with SelectionChanged code-behind to Pages/Home/About/
Settings) or a TabView. Shell computed symbols now exclude C# Markup so those
modes fall back to the single page (XAML-only for now). Validated: blank-preset
desktop builds succeed for both navview and tabbar.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… docs

Regions mode (Uno.Extensions.Navigation): Presentation/MainPage hosts a
NavigationView or utu:TabBar as a uen:Region.Attached region with inline
content regions; RegisterRoutes gains view-less nested Home/About routes under
Main. Adds 4 CI matrix rows and docs/shell-layouts.md (+ README link).
Generated content inspected clean; build validation in progress.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
shellLayout now offers blank|navview|tabbar|tabview. tabview is a plain static
WinUI TabView (no regions, works in any preset). tabbar uses Uno.Toolkit TabBar
in BOTH frame (TabBar + Frame code-behind) and regions modes, and requires the
Toolkit (default in recommended; -toolkit true in blank). Validated: all 6
combos (navview/tabbar/tabview x frame/regions) build on desktop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nothing in the template referenced it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M4hG8PDawQsDBqY62tf2wG
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/shell-layouts branch from 0273038 to 7afbfb1 Compare November 4, 2026 14:57
@github-actions github-actions Bot added area/automation Categorizes an issue or PR as relevant to project automation area/solution-templates Categories an issue or PR as relevant to the Solution Templates labels Nov 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

19 65 90 116 area/automation Categorizes an issue or PR as relevant to project automation area/solution-templates Categories an issue or PR as relevant to the Solution Templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants