feat: introduced cloud state in sketchbook view

Closes #1879
Closes #1876
Closes #1899
Closes #1878

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2023-02-15 18:03:37 +01:00
committed by Akos Kitta
parent b09ae48536
commit 0ab28266df
53 changed files with 1971 additions and 659 deletions

View File

@@ -106,7 +106,7 @@ export class SketchbookWidgetContribution
this.revealSketchNode(treeWidgetId, nodeUri),
});
registry.registerCommand(SketchbookCommands.OPEN_NEW_WINDOW, {
execute: (arg) => this.openNewWindow(arg.node),
execute: (arg) => this.openNewWindow(arg.node, arg?.treeWidgetId),
isEnabled: (arg) =>
!!arg && 'node' in arg && SketchbookTree.SketchDirNode.is(arg.node),
isVisible: (arg) =>
@@ -209,14 +209,20 @@ export class SketchbookWidgetContribution
});
}
private openNewWindow(node: SketchbookTree.SketchDirNode): void {
const widget = this.tryGetWidget();
if (widget) {
const treeWidgetId = widget.activeTreeWidgetId();
if (!treeWidgetId) {
private openNewWindow(
node: SketchbookTree.SketchDirNode,
treeWidgetId?: string
): void {
if (!treeWidgetId) {
const widget = this.tryGetWidget();
if (!widget) {
console.warn(`Could not retrieve active sketchbook tree ID.`);
return;
}
treeWidgetId = widget.activeTreeWidgetId();
}
const widget = this.tryGetWidget();
if (widget) {
const nodeUri = node.uri.toString();
const options: WorkspaceInput = {};
Object.assign(options, {