diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 5ae5357b6..f90ce8960 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -73,6 +73,13 @@ Pages use the `ControlExample` custom control to show interactive demos: 2. Create a folder `Samples/{UniqueId}/` and add `{ControlName}Page.xaml` and `.xaml.cs` using the `ControlExample` pattern above. The folder name **must** match the `UniqueId` exactly. 3. The source generator auto-maps the `UniqueId` to the page type — no manual registration needed. 4. Add any code snippets as `.txt` files in the same `Samples/{UniqueId}/` folder. They are automatically included in the build as content. +5. Regenerate the sample index and commit the result: + +```powershell +dotnet run --project tools/CatalogExporter -- generate +``` + +`catalog/windows-samples.json` is a checked-in file that other tools consume, and CI fails if it does not match the current samples. Run this whenever you add, rename, remove, or edit a control page or a snippet `.txt`. ## Accessibility diff --git a/.pipelines/azure-pipelines.yml b/.pipelines/azure-pipelines.yml index c36e3d6b9..72209d6fc 100644 --- a/.pipelines/azure-pipelines.yml +++ b/.pipelines/azure-pipelines.yml @@ -24,6 +24,12 @@ steps: feedsToUse: 'config' nugetConfigPath: '$(System.DefaultWorkingDirectory)\nuget.config' + - task: DotNetCoreCLI@2 + displayName: Verify catalog/windows-samples.json is up to date + inputs: + command: 'test' + projects: 'tests/WinUIGallery.CatalogExporter.Tests/WinUIGallery.CatalogExporter.Tests.csproj' + - task: PowerShell@2 displayName: Generate Test Signing Certificate inputs: diff --git a/WinUIGallery.slnx b/WinUIGallery.slnx index 644b72718..8be678907 100644 --- a/WinUIGallery.slnx +++ b/WinUIGallery.slnx @@ -48,6 +48,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/WinUIGallery/SampleSupport/Data/ControlInfoData.json b/WinUIGallery/SampleSupport/Data/ControlInfoData.json index 6ea10fcc9..4f6518be1 100644 --- a/WinUIGallery/SampleSupport/Data/ControlInfoData.json +++ b/WinUIGallery/SampleSupport/Data/ControlInfoData.json @@ -236,7 +236,13 @@ "Title": "XamlReader - API", "Uri": "https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.markup.xamlreader" } - ] + ], + "Catalog": { + "Aliases": [ + "repl", + "live xaml preview" + ] + } } ] }, @@ -1383,7 +1389,13 @@ "RepeatButton", "HyperlinkButton", "AppBarButton" - ] + ], + "Catalog": { + "Aliases": [ + "cta", + "call to action" + ] + } }, { "UniqueId": "DropDownButton", @@ -2606,8 +2618,6 @@ } ], "RelatedControls": [ - "Panel", - "StackLayout", "ItemsRepeater" ] }, diff --git a/WinUIGallery/SampleSupport/Data/ControlInfoDataSchema.json b/WinUIGallery/SampleSupport/Data/ControlInfoDataSchema.json index 8651990f7..1d74f36dd 100644 --- a/WinUIGallery/SampleSupport/Data/ControlInfoDataSchema.json +++ b/WinUIGallery/SampleSupport/Data/ControlInfoDataSchema.json @@ -103,6 +103,31 @@ }, "description": "Additional keywords used purely for search. If a search query matches one of these tags, this sample will be surfaced in the results even when the tag does not appear in the Title." }, + "Catalog": { + "type": "object", + "description": "Optional, opt-in overrides consumed only by tools/CatalogExporter when generating catalog/windows-samples.json. Everything here is additive/derivable metadata that the running gallery app itself never reads; omit this block entirely unless a sample genuinely needs to diverge from what the exporter can derive automatically from the fields above and the on-disk sample folder.", + "properties": { + "Exclude": { + "type": "boolean", + "default": false, + "description": "When true, this item is left out of the generated catalog manifest entirely (for example, a developer utility page rather than a genuine, documentable sample)." + }, + "Aliases": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Additional search aliases that are useful for an external catalog/agent but too broad or noisy for the in-app search experience (which already uses Tags)." + }, + "RelatedSamples": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Extra related-sample references that point outside this repository, formatted as '{owner}/{repo}#{uniqueId}'. Used to extend (not replace) RelatedControls, which can only reference other items in this same file." + } + } + } }, "required": [ "UniqueId", "Title"] } diff --git a/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAccelerators.txt b/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAccelerators.txt new file mode 100644 index 000000000..33dfc9650 --- /dev/null +++ b/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAccelerators.txt @@ -0,0 +1,58 @@ +--- xaml + + + + + + + + + + + + + + + + + + + + + +--- c# +private void MakeRedButton_Click(object sender, RoutedEventArgs e) +{ + ColorRectangle.Fill = new SolidColorBrush(Colors.Red); +} +private void MakeBlueButton_Click(object sender, RoutedEventArgs e) +{ + ColorRectangle.Fill = new SolidColorBrush(Colors.Blue); +} +private void MakeChartreuseButton_Click(object sender, RoutedEventArgs e) +{ + ColorRectangle.Fill = new SolidColorBrush(Colors.Chartreuse); +} diff --git a/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAccessKeys.txt b/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAccessKeys.txt new file mode 100644 index 000000000..f9cfce2cc --- /dev/null +++ b/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAccessKeys.txt @@ -0,0 +1,20 @@ +--- xaml + + + + + + + + + + + + + + + + + + + diff --git a/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAutomaticArrowKeys.txt b/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAutomaticArrowKeys.txt new file mode 100644 index 000000000..073850c62 --- /dev/null +++ b/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAutomaticArrowKeys.txt @@ -0,0 +1,10 @@ +--- xaml + + + Red + Blue + Green + Yellow + diff --git a/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAutomaticTabOrder.txt b/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAutomaticTabOrder.txt new file mode 100644 index 000000000..a87b08445 --- /dev/null +++ b/WinUIGallery/Samples/AccessibilityKeyboard/AccessibilityKeyboardAutomaticTabOrder.txt @@ -0,0 +1,10 @@ +--- xaml + +