Move graph breadcrumb trail button into the top bar

This commit is contained in:
Keavon Chambers
2024-07-15 20:03:10 -07:00
parent 857bc772de
commit 8e774efe9d
8 changed files with 25 additions and 41 deletions
+1 -3
View File
@@ -10,7 +10,6 @@
import LayoutCol from "@graphite/components/layout/LayoutCol.svelte";
import LayoutRow from "@graphite/components/layout/LayoutRow.svelte";
import BreadcrumbTrailButtons from "@graphite/components/widgets/buttons/BreadcrumbTrailButtons.svelte";
import IconButton from "@graphite/components/widgets/buttons/IconButton.svelte";
import TextButton from "@graphite/components/widgets/buttons/TextButton.svelte";
import RadioInput from "@graphite/components/widgets/inputs/RadioInput.svelte";
@@ -95,7 +94,7 @@
category.nodes.push(node);
} else
categories.set(node.category, {
open: open,
open,
nodes: [node],
});
});
@@ -315,7 +314,6 @@
style:--dot-radius={`${dotRadius}px`}
data-node-graph
>
<BreadcrumbTrailButtons labels={["Document"].concat($nodeGraph.subgraphPath)} action={(index) => editor.handle.exitNestedNetwork($nodeGraph.subgraphPath?.length - index)} />
<!-- Right click menu for adding nodes -->
{#if $nodeGraph.contextMenuInformation}
<LayoutCol
@@ -16,7 +16,6 @@ import {
UpdateNodeGraphTransform,
UpdateNodeTypes,
UpdateNodeThumbnail,
UpdateSubgraphPath,
UpdateWirePathInProgress,
UpdateZoomWithScroll,
} from "@graphite/wasm-communication/messages";
@@ -34,7 +33,6 @@ export function createNodeGraphState(editor: Editor) {
zoomWithScroll: false as boolean,
thumbnails: new Map<bigint, string>(),
selected: [] as bigint[],
subgraphPath: [] as string[],
transform: { scale: 1, x: 0, y: 0 },
});
@@ -89,12 +87,6 @@ export function createNodeGraphState(editor: Editor) {
return state;
});
});
editor.subscriptions.subscribeJsMessage(UpdateSubgraphPath, (UpdateSubgraphPath) => {
update((state) => {
state.subgraphPath = UpdateSubgraphPath.subgraphPath;
return state;
});
});
editor.subscriptions.subscribeJsMessage(UpdateWirePathInProgress, (updateWirePathInProgress) => {
update((state) => {
state.wirePathInProgress = updateWirePathInProgress.wirePath;
@@ -83,10 +83,6 @@ export class UpdateOpenDocumentsList extends JsMessage {
readonly openDocuments!: FrontendDocumentDetails[];
}
export class UpdateSubgraphPath extends JsMessage {
readonly subgraphPath!: string[];
}
export class UpdateWirePathInProgress extends JsMessage {
readonly wirePath!: WirePath | undefined;
}
@@ -1479,7 +1475,6 @@ export const messageMakers: Record<string, MessageMaker> = {
UpdateOpenDocumentsList,
UpdatePropertyPanelOptionsLayout,
UpdatePropertyPanelSectionsLayout,
UpdateSubgraphPath,
UpdateToolOptionsLayout,
UpdateToolShelfLayout,
UpdateWorkingColorsLayout,