-
Notifications
You must be signed in to change notification settings - Fork 309
Add Notes App for AppContentSearch Samples #566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/experimental
Are you sure you want to change the base?
Add Notes App for AppContentSearch Samples #566
Conversation
There was a problem hiding this 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) |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
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.
| { | ||
| attachment.Type = NoteAttachmentType.Image; | ||
| } | ||
| else if (new string[] { ".mp3", ".wav", ".m4a", ".opus", ".waptt" }.Contains(file.FileType)) |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
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.
| 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"); | ||
| } |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
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.
| x:Name="SearchBoxQueryIcon" | ||
| FontSize="16" | ||
| Foreground="{ThemeResource TextFillColorPrimaryBrush}" | ||
| Glyph="󣜡" /> |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
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.
| <configuration> | ||
| <config> | ||
| <clear /> | ||
| <add key="globalPackagesFolder" value="$\..\..\packages" /> |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
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.
| catch (Exception ex) | ||
| { | ||
| // Initialization failures will be handled when SendRequest is called | ||
| Debug.WriteLine($"Initialization failed: {ex}"); | ||
| } |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
| catch (Exception ex) | ||
| { | ||
| Debug.WriteLine("Failed to read image Subregion: " + ex.Message); | ||
| } |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
| catch (Exception ex) | ||
| { | ||
| _dispatcherQueue?.TryEnqueue(() => | ||
| assistantEntry.Message = string.IsNullOrWhiteSpace(assistantEntry.Message) | ||
| ? $"[Error] {ex.Message}" | ||
| : $"{assistantEntry.Message}\n\n[Error] {ex.Message}"); | ||
| } |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
| catch (Exception ex) | ||
| { | ||
| Debug.WriteLine($"Search failed: {ex.Message}"); | ||
| // Handle other exceptions as needed | ||
| } |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
| if (localSettings.Values.ContainsKey(ShowBoundingBoxesKey) && | ||
| localSettings.Values[ShowBoundingBoxesKey] is bool b) | ||
| { | ||
| tsShowBoundingBoxes.IsOn = b; | ||
| } | ||
| else | ||
| { | ||
| tsShowBoundingBoxes.IsOn = true; | ||
| } |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
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.
| @@ -0,0 +1,53 @@ | |||
| --- | |||
There was a problem hiding this comment.
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.
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.