Skip to content

Update ACS to WinAppSDK 2.0-exp4 + List Indices in Settings#573

Open
karkarl wants to merge 14 commits intomicrosoft:mainfrom
karkarl:user/karkarl/ACSExp4
Open

Update ACS to WinAppSDK 2.0-exp4 + List Indices in Settings#573
karkarl wants to merge 14 commits intomicrosoft:mainfrom
karkarl:user/karkarl/ACSExp4

Conversation

@karkarl
Copy link
Contributor

@karkarl karkarl commented Jan 30, 2026

  • Update WinAppSDK 2.0-exp4 and update AppContentSearch namespaces
  • Display to local indices in settings page
image

Copilot AI review requested due to automatic review settings January 30, 2026 00:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates Windows App SDK from 2.0-experimental3 to 2.0-experimental4 and migrates AppContentSearch APIs from the experimental namespace to the stable namespace. Additionally, it adds a new feature to display and manage local AppContentIndex stores in the settings page.

Changes:

  • Updated WinAppSDK package from experimental3 to experimental4
  • Migrated namespace from Microsoft.Windows.AI.Search.Experimental.AppContentIndex to Microsoft.Windows.Search.AppContentIndex
  • Added UI in Settings page to display, browse, and delete AppContentIndex stores with storage information
  • Updated FlowLayout and WrapPanel properties to match WinAppSDK 2.0-exp4 API changes

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Directory.Packages.props Updated Microsoft.WindowsAppSDK from 2.0.0-experimental3 to 2.0.0-experimental4
AIDevGallery/Samples/WCRAPIs/SemanticSearch.xaml.cs Updated AppContentIndex namespace from experimental to stable API
AIDevGallery/Samples/WCRAPIs/KnowledgeRetrieval.xaml.cs Updated AppContentIndex namespace from experimental to stable API
AIDevGallery/Samples/WCRAPIs/AppIndexCapability.xaml.cs Updated AppContentIndex namespace from experimental to stable API
AIDevGallery/Pages/SettingsPage.xaml.cs Added logic to enumerate and manage AppContentIndex stores including size calculation and deletion
AIDevGallery/Pages/SettingsPage.xaml Added new settings expander UI for displaying local indices with delete functionality
AIDevGallery/Pages/APIs/APIOverview.xaml Updated FlowLayout from MinColumnSpacing/MinRowSpacing to MinItemSpacing for WinAppSDK 2.0-exp4
AIDevGallery/Models/AppContentIndexStores.cs Added new model class to represent index store data for display in settings
AIDevGallery/MainWindow.xaml.cs Updated AppContentIndex namespace from experimental to stable API
AIDevGallery/Controls/ModelPicker/ModelPickerViews/OnnxPickerView.xaml Migrated from custom WrapPanel to built-in WrapPanel with ItemSpacing/LineSpacing properties

Comment on lines +107 to +166
private void GetAppContentIndexStorageInfo()
{
try
{
indexStores.Clear();

var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
var appContentIndicesFolder = Path.Combine(localFolder, "AppContentIndices");

indexFolderPath = appContentIndicesFolder;
IndexFolderPathTxt.Content = appContentIndicesFolder.Length > 100
? string.Concat("...", appContentIndicesFolder.AsSpan(appContentIndicesFolder.Length - 100))
: appContentIndicesFolder;
ToolTipService.SetToolTip(IndexFolderPathTxt, appContentIndicesFolder);

if (Directory.Exists(appContentIndicesFolder))
{
// Find subdirectories under AppContentIndices. These correspond to each index associated with the app.
var indexFolders = Directory.GetDirectories(appContentIndicesFolder);
long totalIndexSize = 0;

if (indexFolders.Length > 0)
{
foreach (var folder in indexFolders)
{
var indexSize = GetDirectorySize(folder);
var folderName = Path.GetFileName(folder);

indexStores.Add(new AppContentIndexStores(folderName, folder, indexSize));
totalIndexSize += indexSize;
}

ToolTipService.SetToolTip(IndexFolderPathTxt, appContentIndicesFolder);
TotalIndexSizeText.Text = AppUtils.FileSizeToString(totalIndexSize);
}
else
{
TotalIndexSizeText.Text = string.Empty;
}

if (indexStores.Count > 0)
{
IndexStorageExpander.IsExpanded = true;
}
}
else
{
indexFolderPath = null;
IndexFolderPathTxt.Content = "Index storage not found";
TotalIndexSizeText.Text = string.Empty;
}
}
catch (Exception ex)
{
indexFolderPath = null;
IndexFolderPathTxt.Content = "Unable to locate index storage";
TotalIndexSizeText.Text = string.Empty;
Debug.WriteLine($"Error getting AppContentIndex storage info: {ex.Message}");
}
}
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

GetAppContentIndexStorageInfo performs synchronous I/O operations (Directory.Exists, Directory.GetDirectories, Directory.GetFiles) on the UI thread during OnNavigatedTo. This can cause UI freezing if the index folders are large or on slow storage. Consider making this method async and running the I/O operations on a background thread using Task.Run, similar to how GetStorageInfo is implemented as an async method. This would improve UI responsiveness and follow the performance best practices used elsewhere in the codebase.

Copilot uses AI. Check for mistakes.
</toolkit:SettingsExpander.Items>
</toolkit:SettingsExpander>

<toolkit:SettingsExpander x:Name="IndexStorageExpander"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: just a minor suggestion, not blocker. you can consider adding a "Clear all indices" button like the "Clear" button that deletes all cached models in the model cache section for better user experience :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be addressed in the next PR. WindowsAppSDK 2.0preview1 change is incoming :)

haoliuu and others added 7 commits February 4, 2026 11:23
- Rename ModelSize -> IndexSize in AppContentIndexStores
- Make GetAppContentIndexStorageInfo async (I/O off UI thread)
- Remove duplicate ToolTipService.SetToolTip call
- Add AutomationProperties.Name to index folder HyperlinkButton
- Remove trailing whitespace and extra blank line

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Class represents a single index store entry, not multiple.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Microsoft.WindowsAppSDK.Base package provides the Search WinMDs
(Microsoft.Windows.Search.AppContentIndex namespace). Without it,
navigating to Settings causes a TypeLoadException.

Also restores correct namespace (Microsoft.Windows.Search.AppContentIndex)
and updates WcrApiCodeSnippet inline samples to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Collaborator

@haoliuu haoliuu left a comment

Choose a reason for hiding this comment

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

@huichen123 mentioned that VSR may not work on WindowsAppSDK 2.0 Exp4 and Exp5 in another thread. @huichen123 could you please double confirm? If that's the case, we should hold off on the upgrade for now.
@karkarl have you tested locally to see if AIDG works properly with these changes?

@huichen123
Copy link
Contributor

@huichen123 mentioned that VSR may not work on WindowsAppSDK 2.0 Exp4 and Exp5 in another thread. @huichen123 could you please double confirm? If that's the case, we should hold off on the upgrade for now. @karkarl have you tested locally to see if AIDG works properly with these changes?

yes, the existing QNN EP doesn't work with new ORT in exp4+

@karkarl
Copy link
Contributor Author

karkarl commented Mar 4, 2026

@huichen123 mentioned that VSR may not work on WindowsAppSDK 2.0 Exp4 and Exp5 in another thread. @huichen123 could you please double confirm? If that's the case, we should hold off on the upgrade for now. @karkarl have you tested locally to see if AIDG works properly with these changes?

yes, the existing QNN EP doesn't work with new ORT in exp4+

That checks out. I'm seeing the same thing while debugging a crash I'm seeing locally with windbg. I'll just add the preview1 changes here.

@haoliuu
Copy link
Collaborator

haoliuu commented Mar 5, 2026

@huichen123 mentioned that VSR may not work on WindowsAppSDK 2.0 Exp4 and Exp5 in another thread. @huichen123 could you please double confirm? If that's the case, we should hold off on the upgrade for now. @karkarl have you tested locally to see if AIDG works properly with these changes?

yes, the existing QNN EP doesn't work with new ORT in exp4+

That checks out. I'm seeing the same thing while debugging a crash I'm seeing locally with windbg. I'll just add the preview1 changes here.

Is the problem in exp4+ fixed in preview1? I noticed that exp5 released at the same time as preview1 so not sure if they have the same QNN EP issue. Or we need to hold off until the new EP is released before merging the change

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