feat(editor): Hide focus panel while node panel is open (no-changelog) (#17333)

This commit is contained in:
Daria
2025-07-15 18:35:49 +03:00
committed by GitHub
parent 8232d7f1d4
commit f888b3353b
3 changed files with 42 additions and 17 deletions

View File

@@ -973,6 +973,10 @@ function onUpdateNodeOutputs(id: string) {
}
function onClickNodeAdd(source: string, sourceHandle: string) {
if (isFocusPanelFeatureEnabled.value && focusPanelStore.focusPanelActive) {
focusPanelStore.hideFocusPanel();
}
nodeCreatorStore.openNodeCreatorForConnectingNode({
connection: {
source,
@@ -1182,7 +1186,7 @@ async function onRevertAddNode({ node }: { node: INodeUi }) {
await revertAddNode(node.name);
}
async function onSwitchActiveNode(nodeName: string) {
function onSwitchActiveNode(nodeName: string) {
const node = workflowsStore.getNodeByName(nodeName);
if (!node) return;
@@ -1190,7 +1194,7 @@ async function onSwitchActiveNode(nodeName: string) {
selectNodes([node.id]);
}
async function onOpenSelectiveNodeCreator(
function onOpenSelectiveNodeCreator(
node: string,
connectionType: NodeConnectionType,
connectionIndex: number = 0,
@@ -1198,24 +1202,24 @@ async function onOpenSelectiveNodeCreator(
nodeCreatorStore.openSelectiveNodeCreator({ node, connectionType, connectionIndex });
}
function onOpenNodeCreatorForTriggerNodes(source: NodeCreatorOpenSource) {
nodeCreatorStore.openNodeCreatorForTriggerNodes(source);
function onToggleNodeCreator(options: ToggleNodeCreatorOptions) {
nodeCreatorStore.setNodeCreatorState(options);
if (isFocusPanelFeatureEnabled.value && focusPanelStore.focusPanelActive) {
focusPanelStore.hideFocusPanel(options.createNodeActive);
}
if (!options.createNodeActive && !options.hasAddedNodes) {
uiStore.resetLastInteractedWith();
}
}
function onOpenNodeCreatorFromCanvas(source: NodeCreatorOpenSource) {
onToggleNodeCreator({ createNodeActive: true, source });
}
function onToggleNodeCreator(options: ToggleNodeCreatorOptions) {
nodeCreatorStore.setNodeCreatorState(options);
if (options.createNodeActive) {
focusPanelStore.closeFocusPanel();
}
if (!options.createNodeActive && !options.hasAddedNodes) {
uiStore.resetLastInteractedWith();
}
function onOpenNodeCreatorForTriggerNodes(source: NodeCreatorOpenSource) {
nodeCreatorStore.openNodeCreatorForTriggerNodes(source);
}
function onToggleFocusPanel() {
@@ -1229,6 +1233,10 @@ function onToggleFocusPanel() {
function closeNodeCreator() {
if (nodeCreatorStore.isCreateNodeActive) {
nodeCreatorStore.isCreateNodeActive = false;
if (isFocusPanelFeatureEnabled.value && focusPanelStore.focusPanelActive) {
focusPanelStore.hideFocusPanel(false);
}
}
}