Skip to content

Conversation

@karkarl
Copy link

@karkarl karkarl commented Nov 7, 2025

Description

Add Notes sample app to showcase AppContentSearch capabilities in WindowsAppSDK 2.0 exp2

Target Release

WindowsAppSDK 2.0 exp2

Checklist

Note that /azp run currently isn't working for this repo.

@karkarl karkarl changed the title Add AppContentSearch Samples Add Notes App for AppContentSearch Samples Nov 7, 2025
Copy link

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 PR introduces a Notes sample application to demonstrate AppContentSearch capabilities in Windows App SDK 2.0 experimental2. The app allows users to create, edit, and search notes with attachments, featuring AI-powered chat functionality and image search with bounding boxes.

Key changes:

  • Implements a complete notes management system with CRUD operations
  • Integrates AppContentSearch APIs for indexing and searching notes and image attachments
  • Adds AI chat functionality using multiple language model providers (Phi Silica, Azure OpenAI, Foundry Local)

Reviewed Changes

Copilot reviewed 42 out of 96 changed files in this pull request and generated 83 comments.

Show a summary per file
File Description
ViewModels/*.cs Implements view models for notes, search, chat, and attachments
Utils/*.cs Provides utility classes for search, attachment processing, and language model management
Pages/*.xaml/.cs UI pages for notes editing and settings configuration
Controls/*.xaml/.cs Reusable UI controls for search, chat, and attachment viewing
Models/*.cs Data models for notes, attachments, and transcriptions
Project configuration files Project setup including manifest, NuGet config, and csproj
Comments suppressed due to low confidence (1)

Samples/AppContentSearch/cs-winui/ViewModels/NoteViewModel.cs:143

  • This assignment to shouldCopyFile is useless, since its value is never read.

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

// Remove all attachments associated with the Note.
foreach (var attachment in noteViewModel.Attachments.ToList())
{
if (noteViewModel != null && attachment != null)
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Redundant null check: noteViewModel is already checked for null on line 45 and cannot be null inside the foreach loop. The check noteViewModel != null on line 50 is redundant.

Copilot uses AI. Check for mistakes.
{
attachment.Type = NoteAttachmentType.Image;
}
else if (new string[] { ".mp3", ".wav", ".m4a", ".opus", ".waptt" }.Contains(file.FileType))
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Spelling error in file extension: '.waptt' should likely be '.watt' or another valid audio format. This appears to be a typo.

Copilot uses AI. Check for mistakes.
Comment on lines +140 to +145
else if (new string[] { ".mp3", ".wav", ".m4a", ".opus", ".waptt" }.Contains(file.FileType))
{
attachment.Type = NoteAttachmentType.Audio;
shouldCopyFile = false;
throw new NotSupportedException("audio files are not supported");
}
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Dead code after throw statement: Lines 142-143 set attachment.Type and shouldCopyFile but are never executed because line 144 throws an exception immediately. These assignments should be removed or the exception should be thrown before the assignments.

Copilot uses AI. Check for mistakes.
x:Name="SearchBoxQueryIcon"
FontSize="16"
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
Glyph="󣜡" />
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Invalid Unicode escape sequence: The glyph '󣜡' exceeds the valid Unicode range (U+0000 to U+10FFFF). The hex value E3721 is too large. This should likely be '' to match the search icon glyph used elsewhere in the codebase.

Copilot uses AI. Check for mistakes.
<configuration>
<config>
<clear />
<add key="globalPackagesFolder" value="$\..\..\packages" />
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Invalid path format: The path '$\..\..\packages' contains an invalid '$\' prefix. This should likely be a relative path without the '$\' or use a proper environment variable syntax.

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +49
catch (Exception ex)
{
// Initialization failures will be handled when SendRequest is called
Debug.WriteLine($"Initialization failed: {ex}");
}
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Generic catch clause.

Copilot uses AI. Check for mistakes.
Comment on lines +182 to +185
catch (Exception ex)
{
Debug.WriteLine("Failed to read image Subregion: " + ex.Message);
}
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Generic catch clause.

Copilot uses AI. Check for mistakes.
Comment on lines +121 to +127
catch (Exception ex)
{
_dispatcherQueue?.TryEnqueue(() =>
assistantEntry.Message = string.IsNullOrWhiteSpace(assistantEntry.Message)
? $"[Error] {ex.Message}"
: $"{assistantEntry.Message}\n\n[Error] {ex.Message}");
}
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Generic catch clause.

Copilot uses AI. Check for mistakes.
Comment on lines +120 to +124
catch (Exception ex)
{
Debug.WriteLine($"Search failed: {ex.Message}");
// Handle other exceptions as needed
}
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Generic catch clause.

Copilot uses AI. Check for mistakes.
Comment on lines +362 to +370
if (localSettings.Values.ContainsKey(ShowBoundingBoxesKey) &&
localSettings.Values[ShowBoundingBoxesKey] is bool b)
{
tsShowBoundingBoxes.IsOn = b;
}
else
{
tsShowBoundingBoxes.IsOn = true;
}
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,53 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we put this folder under Samples/WindowsAIFoundry?
Since that's how I discover Windows AI related feature.

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.

2 participants