-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add webview for when dvc is not available or not initialized #2861
Conversation
The structure should change a lot in the following PRs. Not sure if it's worth adding tests for now. I'll add them if you think otherwise. |
extension/src/webview/workspace.ts
Outdated
@@ -48,5 +66,15 @@ export abstract class BaseWorkspaceWebviews< | |||
return overrideRoot || (await this.getFocusedOrOnlyOrPickProject()) | |||
} | |||
|
|||
protected async showEmptyWebview(viewColumn?: ViewColumn) { | |||
await createWebview( |
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.
Creating a simple webview for now, but I've already started creating a class for it to add messages.
extension/package.json
Outdated
@@ -1351,7 +1351,7 @@ | |||
{ | |||
"view": "dvc.views.webviews", | |||
"contents": "[Show Experiments](command:dvc.showExperiments)\n[Show Plots](command:dvc.showPlots)\n[Show Experiments and Plots](command:dvc.showExperimentsAndPlots)", | |||
"when": "dvc.commands.available && dvc.project.available" | |||
"when": "true" |
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.
[Q] Would it be easier to show the same view but with different underlying commands under different circumstances? Would that simplify the code elsewhere?
i.e
{
"view": "dvc.views.webviews",
"contents": "[Show Experiments](command:dvc.showExperiments)\n[Show Plots](command:dvc.showPlots)\n[Show Experiments and Plots](command:dvc.showExperimentsAndPlots)",
"when": "dvc.commands.available && dvc.project.available"
},
{
"view": "dvc.views.webviews",
"contents": "[Show Experiments](command:dvc.showEmptyWebview)\n[Show Plots](command:dvc.showEmptyWebview)\n[Show Experiments and Plots](command:dvc.showEmptyWebview)",
"when": "!dvc.commands.available || !dvc.project.available"
}
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 think you're right. I'll try that. Thanks!
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.
Left one [Q] that might help to simplify code paths. Just need to check that the new webview is correctly bundled with the extension.
Code Climate has analyzed commit ca03d49 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 64.7% (85% is the threshold). This pull request will bring the total coverage in the repository to 96.6% (-0.1% change). View more on Code Climate. |
A start on #2776
Screen.Recording.2022-11-30.at.6.40.39.PM.mov