fix: made tool_mode components minimizable (#6237)

Fixed count handles function to allow tool_mode to minimize

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
This commit is contained in:
Lucas Oliveira 2025-02-12 17:31:24 -03:00 • committed by GitHub
commit a64f3764be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,8 +9,10 @@ export function countHandlesFn(data: NodeDataType): number {
) )
.map((templateCamp) => { .map((templateCamp) => {
const { template } = data.node!; const { template } = data.node!;
if (template[templateCamp]?.input_types) return true; if (template[templateCamp]?.tool_mode && data.node?.tool_mode)
return false;
if (!template[templateCamp]?.show) return false; if (!template[templateCamp]?.show) return false;
if (template[templateCamp]?.input_types) return true;
switch (template[templateCamp]?.type) { switch (template[templateCamp]?.type) {
case "str": case "str":
case "bool": case "bool":
@ -18,8 +20,10 @@ export function countHandlesFn(data: NodeDataType): number {
case "code": case "code":
case "prompt": case "prompt":
case "file": case "file":
case "table":
case "int": case "int":
return false; return false;
default: default:
return true; return true;
} }