Implement Add Repositories UI in the File Explorer Dev Home Page - #3488
Conversation
There was a problem hiding this comment.
Please file an issue/bug to track this. We only have the one provider at the moment, so this shouldn't block some testing/selfhosting. But let's not forget to come back to this and fix it.
There was a problem hiding this comment.
Adding this as a potential fix. Using an MSBuild task to iterate through all the extensions and populate XAML before it is built. It would be difficult though. Just an idea.
16b9823 to
e7bc4e1
Compare
This reverts commit f30055f.
**Summary of the pull request** This PR contains implementation changes for the File Explorer Source Control Integration experimental feature. This feature will allow File Explorer to obtain property information from source control technologies for display (image attached below): **Detailed description of the pull request / Additional comments** This PR contains the following changes: - Reference official Dev Home SDK version (that defines APIs for File Explorer Source Control Integration) - Declare FileExplorerSourceControlIntegration as an experimental feature - The FileExplorerSourceControlIntegration project which creates a COM Server used to communicate information with File Explorer - The FileExplorerGitIntegration project which allows Dev Home to come with an inbox extension that understands git - Basic Unit Tests **Validation steps performed** SDK and MSIX local builds Tested Git Integration File Explorer behavior inside VM Related work items: #48431506
* declare appextension for git, find all source control extensions, UI changes, SDK changes, get extension information to use for mapping * changes to map extension to registered root paths, add validation to git implementation * changes after testing * use serilog in validation code * reorder using * use published SDK version * address PR feedback * address PR feedback * address PR feedback * Minor cleanup of RepositoryTracking.cs --------- Co-authored-by: Ryan Shepherd <ryansh@microsoft.com>
There was a problem hiding this comment.
PropName can be used here instead of re-typing the string.
There was a problem hiding this comment.
I believe the null checks are used because of iterating through the properties and this needs the latest commit to be not null.
I don't like the duplication of the check.
If LatestCommit returns null for a property, would a second call to LatestCommit return a non-null value? If this is the case the call to LatestCommit can be moved outside the foreach loop.
The null check for LatestCommit still needs to be in each case "If not null, add the property"
There was a problem hiding this comment.
Another way to do this is,
- Put
LatestCommitoutside of the for loop. - For every property use result.Add(propName, latestCommit?.[PropertyName] ?? string.empty)
- Before returning result remove all entries that contain string.empty.
There was a problem hiding this comment.
Why is this in its own scope?
There was a problem hiding this comment.
I believe this can be simplified to commits.FirstOrDefault()?.Tree?[relativePath] == null
There was a problem hiding this comment.
NIT: commit.Select(x => x.Tree[relativePath]).Where(x +> x is not null)
There was a problem hiding this comment.
NIT: currentCommit.Parents.Count() == 0
There was a problem hiding this comment.
NIT: You can use Microsoft.Windows.System.EnvironmentManager and the EV will be removed when the app is uninstalled.
There was a problem hiding this comment.
Why use PInvoke to get the ILocalRepositoryProvider? I believe DevHome has interfaces to get the providers already.
There was a problem hiding this comment.
old name? Can the name be changed to something more descriptive?
There was a problem hiding this comment.
Considering on line 72 the case is ignored.
There was a problem hiding this comment.
I understand. Tracked repositories is a map from a root path to the extension that is tracking the repository. I understand now. Okay.
NIT: change the name to TrackedRepositoriesToExtension, or something similar.
There was a problem hiding this comment.
That is why so many other files use pUnk to determing the extension type.
There was a problem hiding this comment.
NIT for the file: Make CLSID the second argument. That is what it is. All other methods need either
- nothing
- RootPath
- RootPath and CLSID.
This keeps the arguments in a consistent order.
|
@dhoehna Just a heads up. This PR contains alot of changes which have already been merged to the feature branch. Since the feature branch was rebased to latest in main, the changes are appearing here. I am currently (locally) fixing the state of the branch. As such, the PR will only contain the UI changes. However, we do plan to create a PR for review to commit to main soon. Thanks! |
There was a problem hiding this comment.
you already retrieved TrackedRepositories[rootPath] in TryGetValue. existingExtensionCLSID can be used in this scope.
There was a problem hiding this comment.
NVM. This is used to check the existence of the key. In the case. can you use .ContainsKey instead?
There was a problem hiding this comment.
NIT: use UTcNow. An edge case can occur if using .Now. For example, Daylight savings time occurred. Or the user moved between times zones.
There was a problem hiding this comment.
Is this TODO still relevant?
There was a problem hiding this comment.
NIT: repoCollection.Select(x => new RepositoryInformation(x.Key, x.Value))
There was a problem hiding this comment.
NIT: GetLocalProvider(rootFolderPath).GetRepository(rootFolderPath)
There was a problem hiding this comment.
Is this TODO still relevant?
2ea72d7 to
3ae6b69
Compare
Summary of the pull request
This PR removes the temporary UI and implements the design based UI for adding and removing repositories (for source control integration) in the File Explorer Settings page.
References and relevant issues
Detailed description of the pull request / Additional comments
Validation steps performed
Built msix release pckg
Validated UI functionality
PR checklist