-
Notifications
You must be signed in to change notification settings - Fork 12
refactor #59
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: main
Are you sure you want to change the base?
refactor #59
Conversation
Consider renaming ps. Naming is hard 😅 |
That makes sense. Thanks! |
07d6dab
to
4f113e9
Compare
…rchPage → SearchWebPage for clarity
… using StateJsonPath
ade893f
to
14c4fc2
Compare
…OpenHomePageCommand and SearchWebCommand
… WebSearchShortcutDataEntry for clarity
c414a82
to
3dd8082
Compare
3dd8082
to
0df0218
Compare
0df0218
to
f35e8e6
Compare
f35e8e6
to
c0d48fc
Compare
c0d48fc
to
b33eb4e
Compare
…e memory visibility; add warm reload
b33eb4e
to
f99ab49
Compare
Ready... hopefully for real this time. |
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 refactoring PR improves code quality through better naming conventions, cleaner APIs, and enhanced maintainability. The changes focus on making the codebase more consistent and readable while maintaining all existing functionality.
- Renamed core classes and methods to better reflect their purpose (e.g.,
WebSearchShortcutItem
→WebSearchShortcutDataEntry
,SearchPage
→SearchWebPage
) - Consolidated suggestion providers into a unified registry system with improved API design
- Enhanced browser discovery with thread-safe lazy initialization replacing manual double-checked locking
Reviewed Changes
Copilot reviewed 39 out of 40 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
WebSearchShortcutItem.cs | Removed old data model class |
WebSearchShortcutDataEntry.cs | New data model with better naming and added GetHomePageUrl method |
WebSearchShortcutCommandsProvider.cs | Refactored command provider with cleaner method names and improved organization |
SuggestionsProviders/*.cs | Moved and updated suggestion providers with consistent interface implementation |
Suggestion.cs | Refactored suggestions system into registry pattern with improved API |
Storage.cs | Fixed path handling bug and updated to use new data model |
SearchWebPage.cs | New search page implementation replacing SearchPage.cs |
Commands/*.cs | Updated commands to use new data model and consistent icon usage |
Properties/Icons.cs | Moved to Properties namespace and reordered for consistency |
Files not reviewed (1)
- CmdPalWebSearchShortcut/WebSearchShortcut/Properties/Resources.Designer.cs: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Thank you very much for your contribution! Initially, this project was just a personal project, and many parts were not written meticulously (also, I'm just a beginner in dotnet, with my main development language being TypeScript), so there are many rough areas in the project code. This PR has addressed these issues! Thanks again for your contribution. |
Refactor / Naming / Consistency
OpenHomePageCommand
andSearchWebCommand
are now used the same way.List<T>
withT[]
(internal immutable snapshots) orIReadOnlyList<T>
(API boundaries) where mutation isn’t required.Lazy<T>
cache; reload now supports an optional warm mode.Fixes
WriteToFile
now respects the caller-providedpath
.Icons.Search
inOpenHomePageCommand
andSearchWebCommand
, removing hardcoded icons.Lazy<T>
fixes a potential memory-visibility issue where_isLoaded
could be observed before_cachedBrowsers
due to CPU/JIT reordering, ensuring readers never see stale/empty data after initialization.Chore