Feat: Use memo to wrap canvas nodes to improve fluency #3221 (#7929)

### What problem does this PR solve?

Feat: Use memo to wrap canvas nodes to improve fluency #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-05-29 11:10:45 +08:00
committed by GitHub
parent 64f930b1c5
commit 3f695a542c
20 changed files with 78 additions and 28 deletions

View File

@ -1,4 +1,5 @@
import { getLLMIconName, getLlmNameAndFIdByLlmId } from '@/utils/llm-util';
import { memo } from 'react';
import { LlmIcon } from '../svg-icon';
interface IProps {
@ -24,4 +25,4 @@ const LLMLabel = ({ value }: IProps) => {
);
};
export default LLMLabel;
export default memo(LLMLabel);

View File

@ -1,7 +1,7 @@
import { LlmModelType } from '@/constants/knowledge';
import { useComposeLlmOptionsByModelTypes } from '@/hooks/llm-hooks';
import * as SelectPrimitive from '@radix-ui/react-select';
import { forwardRef, useState } from 'react';
import { forwardRef, memo, useState } from 'react';
import { LlmSettingFieldItems } from '../llm-setting-items/next';
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
import { Select, SelectTrigger, SelectValue } from '../ui/select';
@ -14,7 +14,7 @@ interface IProps {
disabled?: boolean;
}
export const NextLLMSelect = forwardRef<
const NextInnerLLMSelect = forwardRef<
React.ElementRef<typeof SelectPrimitive.Trigger>,
IProps
>(({ value, disabled }, ref) => {
@ -52,4 +52,6 @@ export const NextLLMSelect = forwardRef<
);
});
NextLLMSelect.displayName = 'LLMSelect';
NextInnerLLMSelect.displayName = 'LLMSelect';
export const NextLLMSelect = memo(NextInnerLLMSelect);