Fix: If the agent debug sheet contains too much content, some of it will not be displayed. #12974 (#12975)

### What problem does this PR solve?

Fix: If the agent debug sheet contains too much content, some of it will
not be displayed. #12974

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2026-02-04 09:48:28 +08:00
committed by GitHub
parent 7b230aadf4
commit 414e261eda
4 changed files with 26 additions and 13 deletions

View File

@ -13,6 +13,7 @@ import { RAGFlowSelect } from '@/components/ui/select';
import { Switch } from '@/components/ui/switch'; import { Switch } from '@/components/ui/switch';
import { Textarea } from '@/components/ui/textarea'; import { Textarea } from '@/components/ui/textarea';
import { IMessage } from '@/interfaces/database/chat'; import { IMessage } from '@/interfaces/database/chat';
import { cn } from '@/lib/utils';
import { zodResolver } from '@hookform/resolvers/zod'; import { zodResolver } from '@hookform/resolvers/zod';
import React, { ReactNode, useCallback, useMemo } from 'react'; import React, { ReactNode, useCallback, useMemo } from 'react';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
@ -36,6 +37,8 @@ interface IProps {
loading?: boolean; loading?: boolean;
submitButtonDisabled?: boolean; submitButtonDisabled?: boolean;
btnText?: ReactNode; btnText?: ReactNode;
className?: string;
maxHeight?: string;
} }
const DebugContent = ({ const DebugContent = ({
@ -46,6 +49,8 @@ const DebugContent = ({
loading = false, loading = false,
submitButtonDisabled = false, submitButtonDisabled = false,
btnText, btnText,
className,
maxHeight,
}: IProps) => { }: IProps) => {
const { t } = useTranslation(); const { t } = useTranslation();
@ -234,7 +239,7 @@ const DebugContent = ({
); );
return ( return (
<> <>
<section> <section className={className}>
{message?.data?.tips && ( {message?.data?.tips && (
<div className="mb-2"> <div className="mb-2">
<MarkdownContent <MarkdownContent
@ -244,11 +249,15 @@ const DebugContent = ({
</div> </div>
)} )}
<Form {...form}> <Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4"> <form onSubmit={form.handleSubmit(onSubmit)}>
{parameters.map((x, idx) => { <section
return <div key={idx}>{renderWidget(x, idx.toString())}</div>; className={cn('overflow-auto px-2 space-y-4 pb-4', maxHeight)}
})} >
<div> {parameters.map((x, idx) => {
return <div key={idx}>{renderWidget(x, idx.toString())}</div>;
})}
</section>
<div className="px-2">
<ButtonLoading <ButtonLoading
type="submit" type="submit"
loading={loading} loading={loading}

View File

@ -60,6 +60,8 @@ const SingleDebugSheet = ({
isNext={false} isNext={false}
loading={loading} loading={loading}
submitButtonDisabled={list.length === 0} submitButtonDisabled={list.length === 0}
className="flex-1 overflow-auto min-h-0 pb-5"
maxHeight="max-h-[83vh]"
></DebugContent> ></DebugContent>
{!isEmpty(data) ? ( {!isEmpty(data) ? (
<div <div

View File

@ -20,7 +20,7 @@ export function QueryVariableList({
const form = useFormContext(); const form = useFormContext();
const name = 'query'; const name = 'query';
let options = useFilterQueryVariableOptionsByTypes({ types }); const options = useFilterQueryVariableOptionsByTypes({ types });
const secondOptions = flatOptions(options); const secondOptions = flatOptions(options);

View File

@ -52,15 +52,17 @@ const RunSheet = ({
return ( return (
<Sheet onOpenChange={hideModal} open modal={false}> <Sheet onOpenChange={hideModal} open modal={false}>
<SheetContent className={cn('top-20 p-2')}> <SheetContent className={cn('top-20 px-0 flex flex-col')}>
<SheetHeader> <SheetHeader>
<SheetTitle>{t('flow.testRun')}</SheetTitle> <SheetTitle>{t('flow.testRun')}</SheetTitle>
<DebugContent
ok={onOk}
parameters={inputs}
loading={loading}
></DebugContent>
</SheetHeader> </SheetHeader>
<DebugContent
ok={onOk}
parameters={inputs}
loading={loading}
className="flex-1 overflow-auto min-h-0 pb-5"
maxHeight="max-h-[83vh]"
></DebugContent>
</SheetContent> </SheetContent>
</Sheet> </Sheet>
); );