Feat: Display the selected variables in the variable aggregation node. #10427 (#11113)

### What problem does this PR solve?
Feat: Display the selected variables in the variable aggregation node.
#10427

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-11-07 19:52:04 +08:00
committed by GitHub
parent 9a6808230a
commit 8f34824aa4
4 changed files with 79 additions and 9 deletions

View File

@ -20,7 +20,10 @@ import { buildBeginInputListFromObject } from '../form/begin-form/utils';
import { BeginQuery } from '../interface';
import OperatorIcon from '../operator-icon';
import useGraphStore from '../store';
import { useFindAgentStructuredOutputTypeByValue } from './use-build-structured-output';
import {
useFindAgentStructuredOutputLabelByValue,
useFindAgentStructuredOutputTypeByValue,
} from './use-build-structured-output';
export function useSelectBeginNodeDataInputs() {
const getNode = useGraphStore((state) => state.getNode);
@ -281,6 +284,8 @@ export function useGetVariableLabelOrTypeByValue(nodeId?: string) {
const flattenOptions = useFlattenQueryVariableOptions(nodeId);
const findAgentStructuredOutputTypeByValue =
useFindAgentStructuredOutputTypeByValue();
const findAgentStructuredOutputLabel =
useFindAgentStructuredOutputLabelByValue();
const getItem = useCallback(
(val?: string) => {
@ -291,9 +296,17 @@ export function useGetVariableLabelOrTypeByValue(nodeId?: string) {
const getLabel = useCallback(
(val?: string) => {
return getItem(val)?.label;
const item = getItem(val);
if (item) {
return (
<div>
{item.parentLabel} / {item.label}
</div>
);
}
return getItem(val)?.label || findAgentStructuredOutputLabel(val);
},
[getItem],
[findAgentStructuredOutputLabel, getItem],
);
const getType = useCallback(