Repository navigation
feat: Revamp the SamplesApp shell with Fluent design - #25108
Conversation
|
Claude finished @MartinZikmund's task in 30s —— View job Review summaryVerdict: fix-first (light). The change is large, but I found no blocking defects. This was a targeted spot-check, not a line-by-line read of all 15k added lines. Issues: 0 high, 2 medium or low, both posted inline.
What I checked
Cross-cutting concerns
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25108/docs/index.html |
|
|
|
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25108/docs/index.html |
|
Claude finished @MartinZikmund's task in 39s —— View job Review summaryVerdict: fix-first (light). I found no blocking defects. This was a targeted spot-check of the async, test and layering rules in Issues: 0 high, 1 medium, 1 low. I could not post the medium one inline because GitHub rejected the line, so it is described here.
Already handled in earlier review rounds
Cross-cutting concerns
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25108/docs/index.html |
|
|
|
Claude finished @MartinZikmund's task in 27s —— View job Review summaryVerdict: fix-first (light). I found no blocking defects. This is a targeted re-check after the latest push, not a line-by-line read of the roughly 15k added lines. Issues: 0 high, 1 medium, 1 low. Neither could be posted inline. GitHub rejects both lines because they are outside the PR diff, which suggests the code predates this PR.
Resolved since the earlier reviews
Cross-cutting concerns
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25108/docs/index.html |
WinUI boxes the uint count and lets the property system convert it; Uno kept the uint, so GetSizeOfSet threw InvalidCastException. On WASM that aborted the whole semantic DOM build once a BreadcrumbBar was in the tree. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
A StaticResource ControlCornerRadius setter resolved to null on Uno, leaving tags square. WinUI's own styles use ThemeResource for these. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
The fixed 5 s startup delay was not always enough for the larger shell, and setting the theme dereferenced a null XamlRoot. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
Scroll the home view rather than bring the repeater itself into view, which Uno rejects, and walk the runner's height down instead of guessing where each platform's fonts put the stat strip. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
The iOS/tvOS trimmer strips TargetPlatformAttribute, so the target framework read as a bare net11.0. Fall back to the running OS. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
WinUI realizes only the cards inside the window, which CI keeps narrower than the 1232 grid. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
The async void handler let a missing archive or a picker/IO failure crash the app. Show it in the status line and log it, like the run handler does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
An earlier test can leave the whole Android window shifted for the soft keyboard; the guard then flagged a host that only moved back with it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
WinUI can apply the brush after WaitForIdle returns, which made the test fail on the first CI pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpy6FGmTfiTyJWZnteuZZG
2c5ed0f to
57a6e6e
Compare
|
Claude finished @MartinZikmund's task in 14s —— View job Review summaryVerdict: ship, pending CI and the screenshot diff. HEAD is Issues: 0 high, 0 medium, 0 low. No inline comments. Still open
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25108/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25108/wasm-skia-net9/index.html |
|
The build 238784 found UI Test snapshots differences: Details
|
GitHub Issue: closes #25107
PR Type:
✨ Feature
What changed? 🚀
TL;DR
The SamplesApp shell (the sample chooser) and its infrastructure pages (runtime-test runner, Benchmarks, sample Info, Help) are rebuilt as a modern WinUI 3 Fluent app. It follows the WinUI design guidance for layout, controls, the type ramp, theme brushes, the 4 px spacing grid, corner radii and accessibility, and it adapts from a phone in portrait to a wide desktop window.
Individual samples are not touched. Apart from one small Uno.UI fix the new shell surfaced (
BreadcrumbBarstoredSizeOfSetas auint, which broke WASM accessibility — see §12), every change lives undersrc/SamplesApp/**, plus docs. All automation contracts are preserved (element names, launch arguments, the runtime-test runner geometry and its results file). Twelve real bugs found along the way are fixed, each as afix:commit followed by atest:commit.Before / after
1. Shell layout
The old shell was a hamburger
SplitViewwith one long category list, oversized rows and a toolbar of unlabelled icon buttons. The new shell has three parts:NavigationView, compact): Home, Library, Runtime tests, Benchmarks, Playground, plus Help and Settings in the footer. Selection follows the current destination.SplitView, soIsSplitVisiblekeeps its meaning. It has aSelectorBarwith Recent / Favorites / Library tabs, a Manual tests filter chip, Library → category drill-in with a breadcrumb, and a context menu on every row: Open, Open in new window, Add to favorites, Copy link, Copy type name, View source on GitHub.Library › Category › Sample), an always-visible search box, and aCommandBarfor the current sample.The sample host sits on a layer card with a top-left corner radius. Samples render unchanged inside it.
Adaptive tiers (
VisualStateManagerwithAdaptiveTrigger):Rows are 32 DIP on desktop and 40 DIP on touch heads (Android, iOS, or Simulate touch). Touch targets are at least 40 DIP everywhere.
2. Search
btevfindsButton_Events. Debounced to 150 ms.3. Header command bar and description strip
_Nonesamples such as the runner and Help) show a reduced set.4. Home (new default start page)
5. Settings
The Settings view lives in the browser pane, so the sample stays live while you change things. It has four card groups:
CanUseMica).Shell settings are saved under
Shell.*keys inApplicationData.LocalSettings. The existing keys (Samples.Favorites,Samples.LRU,Samples.LatestCategory,ShowFpsIndicator,unitestcontrols_config) are unchanged. RTL is never saved. Recents now keep 20 entries in every configuration; Release used to keep 0.6. Keyboard shortcuts
All shortcuts go through one dispatcher (
ShellCommands.cs). It drives the rootKeyboardAccelerators, the tooltips,AutomationProperties.AcceleratorKeyand the Help page. Shortcuts are suppressed while a sample's text input or the runtime-test runner has focus, so typing in a sample is never stolen./, Ctrl+KShortcuts that collide with the browser are flagged as unsafe on WebAssembly, and Help shows the browser-safe route for each one.
7. Help page (generated)
Help is generated from
ShellCommands, with keycaps, so it can never drift from the real shortcuts. It also has a Command line & deep links section:sample=,theme=,--runtime-tests,--runtime-test-filter,--auto-screenshots, and the WebAssembly query-string form.8. Runtime-test runner dashboard
InfoBarthat is Informational while running (with a determinate progress bar fed by the newPlannedTestCountproperty), then Success, Warning or Error at the end.IsRunningOnCI) the runner builds no rows and noInfoBar, as before.On portrait phones (narrower than 600 DIP and taller than wide) the runner switches to a bottom sheet. The side-by-side 50/50 split left both halves about 200 DIP wide there.
InfoBar, failure details with a wrapped trace, and single-line result rows with durations. It always shows at least 3 result rows.runButton,stopButtonand the stat cards are moved into the bar, not duplicated, and they move back on wide layouts. Desktop, tablet and landscape layouts and their CI geometry are unchanged. Only narrow portrait CI lanes see a different host position, which is intended.24-android-runner-sheet-collapsed.pnghere25-android-runner-sheet-expanded.pnghere9. Sample info panel and Benchmarks
10. Phone and narrow layouts
11. Focus mode, screenshot recording and automation
📸 drop
14-focus-mode.pnghere--auto-screenshots(RecordAllTests) now hides the chrome, so every capture is the sample alone at full window size (see reviewer note 1).--runtime-tests,--auto-screenshots,sample=under UI tests,UITEST_RUNTIME_*,UNO_PERF_*): no saved settings are restored or written, no recents are recorded, Home is never shown, and the runner host keeps its CI geometry (unitTestContentRootorigin is unchanged).theme=Light|Dark|System. It is additive and can be combined assample=Buttons/Button_Events&theme=Dark.12. Bug fixes found along the way
Each is a
fix:commit followed by atest:commit (the test fails before the fix where feasible):fix: Keep inline sample pane open on clickSplitViewBehavior.CloseOnClickclosed the pane even in Inline mode, so every pick hid the list on wide windowsfix: Notify all theme flags on theme changeIsAppThemeSystem/Light/Darkdidn't notify their siblings, so theme radios went stalefix: Use touch row height in browser panefix: Keep sample host edge visible in darkfix: Keep library list on its category at startupfix: Keep favorite toggle working before browsingfix: Guard sample info copy against nullfix: Start a test run for instance-only runsRunTestsForInstanceon a fresh runner threw aNullReferenceExceptionfix: Report benchmark runs that match nothingfix: Run benchmarks to the end on WinAppSDKfix: Keep launch focus on the selected rail itemfix: Exit non-zero when runtime tests failfix: Archive benchmarks before reporting FinishedBenchmarkDotNetTestscould read results before they were archivedfix: Reset restored shell settings for UI testsfix: Open a launch-time runner in system themefix(breadcrumbbar): Store SizeOfSet as int(Uno.UI)GetSizeOfSetthrewInvalidCastExceptionon BreadcrumbBar items; on WASM that aborted the whole semantic DOM build, so every WASM DOM accessibility test failed once the shell's breadcrumb was in the treefix(samplesapp): Keep drilled category when manual filter togglesnullback through the TwoWay binding before the remap ranfix(samplesapp): Resolve shell corner radii as ThemeResourceStaticResource ControlCornerRadiusstyle setter resolved to null on Uno, so tags were square (WinUI's own styles use ThemeResource)fix(samplesapp): Wait for the shell before setting the test theme--runtime-testscould crash on a nullXamlRootfix(samplesapp): Fix the iOS build of ShellThemeBrushes? color : nulldid not compile on the iOS headfix(samplesapp): Show the platform in About on iOSTargetPlatformAttribute, so About showed a barenet11.013. Code map
Presentation/SampleChooserViewModel.Shell.cs(shell state, commands, persistence),.Search.cs,SampleSearch.cs(ranking),ShellCommands.cs(shortcut catalogue),ShellEnums.cs,AppInfo.cs,ShellLog.cs. All additions; no existing member renamed or removedSampleChooserControl.xamland the partials.Shell.cs(layout, tiers, chrome states),.Shortcuts.cs,PerfHooks.cs(theUNO_PERF_*hooks, moved verbatim)Views/Controls/Shell/HomeView.xaml,SettingsView.xamlViews/Styles/Shell/ShellResources.xaml(Light/Dark/HighContrast tokens, card/tag/keycap styles, noDefaultkey),ShellToggleResources.xaml,Views/Helper/ShellThemeBrushes.cs,ShellFunctions.cs(x:Bind helpers)UnitTest/UnitTestsControl.xaml+.Shell.cs,SampleInfoControl.xaml,Benchmarks.Shared/Controls/BenchmarkDotNetControl.xaml,SamplesApp.Shared/Samples/Help/HelpPage.xamlSamplesApp.Shared/App.Tests.cs(theme=, automation detection, exit code)Views/Styles/Application/*andViews/Styles/Controls/*. Each key was checked with a grep acrosssrcfirstworking-with-the-samples-apps.md,creating-runtime-tests.md,creating-tests.md14. Contracts preserved
SampleChooserViewModel.InstanceAPI (SetSelectedSample,RunRuntimeTests,RecordAllTests,IsAppThemeLight, …)App.Tests.cs, RuntimeTests,SamplesApp.UITests.GeneratorsampleControl,SplitView,SearchBox,InfoButton,OverflowSettingsButton,OverflowSettingsIcon,ThemeMenuFlyout,SampleInfoFlyoutContent,TabletStateUnitTestsRootControl,runButton,runTestCount,ignoredTestCount,failedTests,failedTestDetails,runningState,testResults,unitTestContentRootunitTestContentRootgeometry under--runtime-testsis unchanged--runtime-tests,--runtime-test-filter,--auto-screenshots,sample=, WASM query string, NUnit results formattheme=is additiveUNO_PERF_OPEN_MENU,UNO_PERF_SCROLL,UNO_LOG_FPSSamplesApp.UITestsNavigationView, because the shell rail is one too15. Tests
16 new runtime-test classes (
SamplesApp.Tests.*, discovered from the SamplesApp assembly likeNativeStorageRuntimeTests):Given_ShellLayout,Given_ShellBrowserPane,Given_ShellCommandBar,Given_ShellHomeView,Given_ShellSettingsView,Given_ShellShortcuts,Given_ShellViewModelState,Given_ShellResources,Given_SampleSearch,Given_SampleChooserViewModel,Given_SampleInfoControl,Given_SplitViewBehavior,Given_UnitTestsControl,Given_RunnerBottomSheet,Given_BenchmarkDotNetControl,Given_HelpPage. Together they have 174[TestMethod]s and 213[DataRow]s.16. Validation
BuildProjectReferences=false; a fullbuild-app.ps1hits a path-too-long error in the local worktree)Given_*classes, filtered run-p:CI_Build=true), filtered runNotes for reviewers
--auto-screenshots/ UI-test snapshot changes once. The shell chrome is now hidden while recording, so the baselines show only the sample, at full window size. This is intentional: from now on, shell changes no longer touch the baselines. Expect theScreenshots Compare Test Rundiff to flag every sample once.Given_ShellHomeViewfailures are fixed — WinUI realizes repeater items only on screen, leaves anx:Bindtemplate'sDataContextalone and gets no keys fromKeyboardHelper(the Esc test is now excluded on NativeWinUI, like the existing one inGiven_RunnerBottomSheet).Given_AccessibleSlider,Given_AccessibleAria,Given_AccessibleDataGridandGiven_WasmAccessibilityLifecycle, which all timed out before it.UnoIslandsSamplesApp.Skiabuilds, but no in-repo host can launch it.ListViewItemhas no Fluent selection pill on Skia.How to review
The history is a series of self-contained commits that each build; reading them in order works well:
chore: Move shell perf hooks…→feat: Add shell theme resources(fixes, view-model state, search ranking, shortcut dispatcher, resources).feat: Rebuild shell around rail and browser→feat: Hide shell chrome during recording(phone layout, search results, command bar, Settings, Home, chrome states).chore: Remove unused shell stylesonward.Uno Platform issues found during this work
These are recorded for separate filing, not fixed here:
FlowDirection=RightToLeftis laid out as an RTL paragraph and its brackets flip (related to RightToLeftTextBlockdraws its text at the left edge with the defaultTextAlignment(WinUI draws it at the right) #24904)Logger.Warn(string, Exception)/LogWarning(string, Exception)silently drop the exceptionListViewItemhas no Fluent selection indicator pill on SkiaListViewignoresGroupStyleheaders (ListViewGrouping #21019)FontFamilyfallback list is treated as one family nameUno.Fonts.Fluenthas no U+E733 ("Blocked") glyphControl.Templateon a loaded control doesn't apply the new templateHyperlinkButtonwith string content is underlined on Uno, but not on WinUI 3dict.ThemeDictionaries["Light"][key]from code returns the ambient theme's valueFindNamemissesCommandBarcommands in the closed overflowNavigationViewstopsHighContrastAdjustmentfrom recolouring a TextBoxVisibilitydrops an x:Bind value set while the state was activeNavigationViewabove the content swallows touchPointerExitedEnableAccessibilitystays flagged on when the initial semantic build throws, so accessibility is dead for the session (hardening; the trigger is fixed here){StaticResource ControlCornerRadius}style setter resolves to null while{StaticResource OverlayCornerRadius}in the same file works (worked around here)ItemsRepeater.StartBringIntoView()on the repeater itself throws on Uno but works on WinUIOpen questions for maintainers
SamplesApp.Tests.*classes run wherever runtime tests run (Skia desktop, WASM, Android, iOS). Some of them temporarily change the live shell (always restored infinally). Should they get their own category or lane?CommandBardynamic overflow?StackPanel. CI builds no rows, but a full local or WASM run creates thousands. AnItemsRepeatercould be a follow-up.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01DZqARsYT34zwsK3y97Vr4G