Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions client/src/pages/platform/workflow-editor/WorkflowEditorLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,37 +177,37 @@ const WorkflowEditorLayout = ({includeComponents, runDisabled, showWorkflowInput
<DialogContent className="absolute bottom-4 left-16 top-12 h-[calc(100vh-64px)] w-[calc(100vw-80px)] max-w-none translate-x-0 translate-y-0 gap-2 bg-surface-main p-0">
<ClusterElementsWorkflowEditor />

{currentComponent && (
<>
<WorkflowNodeDetailsPanel
className="fixed inset-y-0 right-0 rounded-l-none border-none"
invalidateWorkflowQueries={invalidateWorkflowQueries!}
previousComponentDefinitions={previousComponentDefinitions}
updateWorkflowMutation={updateWorkflowMutation!}
workflowNodeOutputs={filteredWorkflowNodeOutputs ?? []}
/>
<>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sada je ovaj fragment <> visak

<WorkflowNodeDetailsPanel
className="fixed inset-y-0 right-0 rounded-l-none"
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The border-none class was removed from the className prop. Since WorkflowNodeDetailsPanel has a default border (border border-stroke-neutral-secondary on line 1124), this panel will now display a border in the cluster elements canvas. If this is unintentional and you want to maintain the previous borderless appearance, add border-none back to the className: className="fixed inset-y-0 right-0 rounded-l-none border-none"

Suggested change
className="fixed inset-y-0 right-0 rounded-l-none"
className="fixed inset-y-0 right-0 rounded-l-none border-none"

Copilot uses AI. Check for mistakes.
closeButton={
<DialogClose asChild>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivicac je li zelimo da se NodeDetailsPanel nikako ne moze zatvoriti -> da se automatski zatvara i canvas klikom na X ?

Jer onda bi tribali dodati i logiku kada se brise vec selektirani cluster element, da se u panelu mozda otvori mainRoot (trenutno brisanje selektiranog elementa samo zatvara panel) 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Button
className="absolute right-2 top-2"
size="icon"
title="Close the canvas"
variant="ghost"
>
<XIcon />
</Button>
</DialogClose>
Comment on lines +184 to +193
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The close button's behavior is potentially confusing. It's positioned in the WorkflowNodeDetailsPanel header (where users would expect it to close just the panel), but wrapping it in DialogClose makes it close the entire cluster elements canvas dialog instead.

Consider either:

  1. Using a separate close button for the canvas placed outside the panel header
  2. Implementing custom logic to close only the panel while keeping the canvas open
  3. Making it clear through positioning/styling that this button closes the entire canvas, not just the panel
Suggested change
<DialogClose asChild>
<Button
className="absolute right-2 top-2"
size="icon"
title="Close the canvas"
variant="ghost"
>
<XIcon />
</Button>
</DialogClose>
(() => {
const setPanelOpen = useWorkflowNodeDetailsPanelStore(state => state.setOpen);
return (
<Button
className="absolute right-2 top-2"
size="icon"
title="Close panel"
variant="ghost"
onClick={() => setPanelOpen(false)}
>
<XIcon />
</Button>
);
})()

Copilot uses AI. Check for mistakes.
}
invalidateWorkflowQueries={invalidateWorkflowQueries!}
previousComponentDefinitions={previousComponentDefinitions}
updateWorkflowMutation={updateWorkflowMutation!}
workflowNodeOutputs={filteredWorkflowNodeOutputs ?? []}
/>

{dataPillPanelOpen && (
<Suspense fallback={<DataPillPanelSkeleton />}>
<DataPillPanel
className="fixed inset-y-0 right-[465px] rounded-none"
previousComponentDefinitions={previousComponentDefinitions}
workflowNodeOutputs={filteredWorkflowNodeOutputs ?? []}
/>
</Suspense>
)}
</>
)}

<DialogClose asChild>
<Button
className="absolute right-2 top-2 size-10 border bg-white p-2 shadow-none [&_svg]:size-5"
title="Close the canvas"
variant="ghost"
>
<XIcon />
</Button>
</DialogClose>
{dataPillPanelOpen && (
<Suspense fallback={<DataPillPanelSkeleton />}>
<DataPillPanel
className="fixed inset-y-0 right-[465px] rounded-none"
previousComponentDefinitions={previousComponentDefinitions}
workflowNodeOutputs={filteredWorkflowNodeOutputs ?? []}
/>
</Suspense>
)}
</>
</DialogContent>
</Dialog>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import {
import {TooltipPortal} from '@radix-ui/react-tooltip';
import {useQueryClient} from '@tanstack/react-query';
import {InfoIcon, XIcon} from 'lucide-react';
import {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {ReactNode, useCallback, useEffect, useMemo, useRef, useState} from 'react';
import isEqual from 'react-fast-compare';
import InlineSVG from 'react-inlinesvg';
import {twMerge} from 'tailwind-merge';
Expand Down Expand Up @@ -106,6 +106,7 @@ const TABS: Array<{label: string; name: TabNameType}> = [

interface WorkflowNodeDetailsPanelProps {
className?: string;
closeButton?: ReactNode;
invalidateWorkflowQueries: () => void;
previousComponentDefinitions: Array<ComponentDefinitionBasic>;
updateWorkflowMutation: UpdateWorkflowMutationType;
Expand All @@ -114,6 +115,7 @@ interface WorkflowNodeDetailsPanelProps {

const WorkflowNodeDetailsPanel = ({
className,
closeButton,
invalidateWorkflowQueries,
previousComponentDefinitions,
updateWorkflowMutation,
Expand Down Expand Up @@ -1155,13 +1157,17 @@ const WorkflowNodeDetailsPanel = ({
</Tooltip>
)}

<button
aria-label="Close the node details dialog"
className="ml-auto pr-0"
onClick={handlePanelClose}
>
<XIcon aria-hidden="true" className="size-4 cursor-pointer" />
</button>
{closeButton ? (
closeButton
) : (
<button
aria-label="Close the node details dialog"
className="ml-auto pr-0"
onClick={handlePanelClose}
>
<XIcon aria-hidden="true" className="size-4 cursor-pointer" />
</button>
)}
</header>

<main className="flex h-full flex-col overflow-hidden">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ export default function useNodeClick(data: NodeDataType, id: NodeProps['id'], ac

if (!!data.clusterRoot && !clusterElementsCanvasOpen) {
setClusterElementsCanvasOpen(true);

setCurrentComponent(undefined);

setWorkflowNodeDetailsPanelOpen(false);

return;
}

setWorkflowNodeDetailsPanelOpen(true);
Expand Down
Loading