diff --git a/src/components/graph.ts b/src/components/graph.ts index 849ffbc..0b0558b 100644 --- a/src/components/graph.ts +++ b/src/components/graph.ts @@ -976,7 +976,7 @@ export class Graph { } const ret = await dialog.showSaveDialog({ - defaultPath: workspace.workdir, + defaultPath: workspace.workdir.replaceAll("/", Path.sep), properties: ["showOverwriteConfirmation"], filters: [{ name: "Json", extensions: ["json"] }], }); diff --git a/src/components/menu.tsx b/src/components/menu.tsx index 1d7386b..eaf91b4 100644 --- a/src/components/menu.tsx +++ b/src/components/menu.tsx @@ -14,6 +14,7 @@ import { useWorkspace } from "../contexts/workspace-context"; import * as b3util from "../misc/b3util"; import i18n from "../misc/i18n"; import { Hotkey, isMacos } from "../misc/keys"; +import Path from "../misc/path"; const MenuItemLabel: FC = (itemProps) => { return ( @@ -107,6 +108,7 @@ export const Menu: FC = () => { click: () => { console.log("newFile"); const path = dialog.showSaveDialogSync({ + defaultPath: workspace.workdir.replaceAll("/", Path.sep), properties: ["showOverwriteConfirmation"], filters: [{ name: "Json", extensions: ["json"] }], }); diff --git a/src/components/register-node.ts b/src/components/register-node.ts index 1fc22ae..2a0dd0b 100644 --- a/src/components/register-node.ts +++ b/src/components/register-node.ts @@ -189,8 +189,8 @@ b3util.setSizeCalculator((data: NodeData) => { height += 20; } updateHeight(data.args); - updateHeight(data.input); - updateHeight(data.output); + data.input?.find((v) => !!v) && updateHeight(data.input); + data.output?.find((v) => !!v) && updateHeight(data.output); return [width, height]; }); @@ -513,7 +513,7 @@ class TreeNode extends Rect { } private drawInputText(attributes: Required, container: Group) { - const input = this._data.input ?? []; + const input = this._data.input?.find((v) => !!v) ? this._data.input : []; const { str, line } = input.length > 0 ? toBreakWord(`${i18n.t("regnode.input")}${JSON.stringify(input)}`, 200) @@ -552,7 +552,7 @@ class TreeNode extends Rect { } private drawOutputText(attributes: Required, container: Group) { - const output = this._data.output ?? []; + const output = this._data.output?.find((v) => !!v) ? this._data.output : []; const { str, line } = output.length > 0 ? toBreakWord(`${i18n.t("regnode.output")}${JSON.stringify(output)}`, 200)