-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix: Fixed issue where drive folders in sidebar have wrong properies category #14540
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
Conversation
@@ -202,6 +202,14 @@ public object ToolTip | |||
{ | |||
get | |||
{ | |||
if (Section == SectionType.Favorites) |
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.
What's this for?
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.
It's for showing the pinned icon.
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.
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.
Isn't that already handled by the sidebar?
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.
I believe the sidebar only shows the icon defined by the pinned item. The other items have the icon because it is defined by locationItem
.
@ZTL-UwU can you clarify what issue this is trying to solve? |
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.
First, properties window shows correct information and fixed the issue.
However, this breaks the order of favorites, pinning/unpinning drives and brings instability of favorites section.
I recommend to investigate, re-create or abandon.
I left some reviews regarding codebase quality.
private static DrivesViewModel DrivesViewModel { get; } = Ioc.Default.GetRequiredService<DrivesViewModel>(); | ||
private static NetworkDrivesViewModel NetworkDrivesViewModel { get; } = Ioc.Default.GetRequiredService<NetworkDrivesViewModel>(); | ||
private static readonly ICloudDetector cloudDetector = Ioc.Default.GetRequiredService<ICloudDetector>(); |
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.
Practically we use private property for DI. Change as below:
private NetworkDrivesViewModel NetworkDrivesViewModel { get; } = Ioc.Default.GetRequiredService<NetworkDrivesViewModel>();
private DrivesViewModel DrivesViewModel { get; } = Ioc.Default.GetRequiredService<DrivesViewModel>();
private ICloudDetector CloudDetector { get; } = Ioc.Default.GetRequiredService<ICloudDetector>();
/// <summary> | ||
/// Adds the item (from a path) to the navigation sidebar | ||
/// </summary> | ||
/// <param name="path">The path which to save</param> | ||
/// <returns>Task</returns> | ||
public async Task AddItemToSidebarAsync(string path) | ||
{ | ||
var locationItem = await CreateLocationItemFromPathAsync(path); | ||
INavigationControlItem? item; | ||
if (PathNormalization.NormalizePath(PathNormalization.GetPathRoot(path)) == PathNormalization.NormalizePath(path) || (await cloudDetector.DetectCloudProvidersAsync()).Any(x => x.SyncFolder == path)) // Is drive or cloudDrive |
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.
Don't use brackets-omitted if-else statement.
- Add curly brackets.
- Split those two conditions into two lines.
Thank you for your contribution. This idea has not been planned and not been expected. Closing for now and can you describe how to fix this in the issue? And I think this issue can be fixed with the cloud one. |
Resolved / Related Issues
Closes Bug: Inconsistency of properties window when drives are pinned #14530
Validation
How did you test these changes?
Screenshots (optional)
