Feature/agent UI style optimization (#10385)

### What problem does this PR solve?

Hi team,  @ZhenhangTung @KevinHuSh  @cike8899 
About #10384 , I've completed the UI optimization adjustments for the
Agent page according to our previous discussions and the design draft
sketches provided by @Naomi. The main modifications include:

1. Adjusted the style and content of placeholder-node.
2. Adjusted the location of the dropdown (to the right of the
placeholder-node) .
3. Adjusted the tooltip position spacing when the mouse hovers in the
dropdown menu.
4. Hides the thick scroll bar on the dropdown component.
5. Highlight the connection line when dragging to generate a
placeholder-node

<img width="1323" height="509" alt="Image"
src="https://github.com/user-attachments/assets/0d366f7f-477d-4c00-bb58-d5d58b3a745f"
/>

Please review the related code modifications when you have time. Let me
know if further adjustments are needed!
Thanks!

### Type of change

- [x] Other (please describe): UI Enhancement

---------

Co-authored-by: leonlai <leonlai@futurefab.ai>
This commit is contained in:
FatMii
2025-10-09 11:12:12 +08:00
committed by GitHub
parent 4585edc20e
commit f341dc03b8
12 changed files with 174 additions and 38 deletions

View File

@ -39,6 +39,7 @@ export type RFState = {
selectedEdgeIds: string[];
clickedNodeId: string; // currently selected node
clickedToolId: string; // currently selected tool id
highlightedPlaceholderEdgeId: string | null;
onNodesChange: OnNodesChange<RAGFlowNodeType>;
onEdgesChange: OnEdgesChange;
onEdgeMouseEnter?: EdgeMouseHandler<Edge>;
@ -89,6 +90,7 @@ export type RFState = {
) => void; // Deleting a condition of a classification operator will delete the related edge
findAgentToolNodeById: (id: string | null) => string | undefined;
selectNodeIds: (nodeIds: string[]) => void;
setHighlightedPlaceholderEdgeId: (edgeId: string | null) => void;
};
// this is our useStore hook that we can use in our components to get parts of the store and call actions
@ -101,6 +103,7 @@ const useGraphStore = create<RFState>()(
selectedEdgeIds: [] as string[],
clickedNodeId: '',
clickedToolId: '',
highlightedPlaceholderEdgeId: null,
onNodesChange: (changes) => {
set({
nodes: applyNodeChanges(changes, get().nodes),
@ -127,8 +130,9 @@ const useGraphStore = create<RFState>()(
},
onConnect: (connection: Connection) => {
const { updateFormDataOnConnect } = get();
const newEdges = addEdge(connection, get().edges);
set({
edges: addEdge(connection, get().edges),
edges: newEdges,
});
updateFormDataOnConnect(connection);
},
@ -526,6 +530,9 @@ const useGraphStore = create<RFState>()(
})),
);
},
setHighlightedPlaceholderEdgeId: (edgeId) => {
set({ highlightedPlaceholderEdgeId: edgeId });
},
})),
{ name: 'graph', trace: true },
),