Skip to content
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

Split commands in tracked explorer tree between virtual and non-virtual paths #816

Merged
merged 5 commits into from
Sep 16, 2021

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Sep 16, 2021

1/2 master <- this <- #818

This PR reworks the way that we display commands for files that are not on disk. Previously we showed all the commands and then had different code paths for if the file !exists. This change eliminates those code paths by giving providing a different context in the tree. Should eliminate a source of bugs in the future and set us up for different actions for "virtual" files / folders.

Demo:

Screen.Recording.2021-09-16.at.1.46.08.pm.mov

@mattseddon mattseddon added the product PR that affects product label Sep 16, 2021
@mattseddon mattseddon self-assigned this Sep 16, 2021
@@ -127,94 +127,6 @@ suite('Tracked Explorer Tree Test Suite', () => {
expect(window.activeTextEditor?.viewColumn).not.to.equal(ViewColumn.One)
})

it('should not fail to open a file to the side if it is not on disk', async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] This code path no longer exists, if the file does not exist on disk then the command should not be shown.

@@ -280,12 +280,6 @@
"description": "%config.pythonPath.description%",
"type": "string",
"default": null
},
"dvc.views.trackedExplorerTree.noPromptPullMissing": {
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] Another do not show again option that we no longer need


internalCommands.registerExternalCommand<string>(
RegisteredCommands.TRACKED_EXPLORER_OPEN_TO_THE_SIDE,
path => executeCommand('explorer.openToSide', path)
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] We only reregister these so that we can get analytics for the actions.

@mattseddon mattseddon marked this pull request as ready for review September 16, 2021 04:00
@mattseddon mattseddon enabled auto-merge (squash) September 16, 2021 19:55
@codeclimate
Copy link

codeclimate bot commented Sep 16, 2021

Code Climate has analyzed commit d5a75c8 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.0% (0.0% change).

View more on Code Climate.

@mattseddon mattseddon merged commit f5fb1eb into master Sep 16, 2021
@mattseddon mattseddon deleted the add-virtual-tree-context branch September 16, 2021 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants