Fix: The buttons at the bottom of the dataset settings page are not visible on small screens #9638 (#9639)

### What problem does this PR solve?

Fix: The buttons at the bottom of the dataset settings page are not
visible on small screens #9638
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2025-08-21 19:25:14 +08:00
committed by GitHub
parent 0af57ff772
commit 4110f7f5ce
5 changed files with 33 additions and 25 deletions

View File

@ -116,7 +116,10 @@ export { ExpandedInput, Input, SearchInput };
type NumberInputProps = { onChange?(value: number): void } & InputProps; type NumberInputProps = { onChange?(value: number): void } & InputProps;
export const NumberInput = ({ onChange, ...props }: NumberInputProps) => { export const NumberInput = React.forwardRef<
HTMLInputElement,
NumberInputProps & { value: Value; onChange(value: Value): void }
>(function NumberInput({ onChange, ...props }, ref) {
return ( return (
<Input <Input
type="number" type="number"
@ -125,6 +128,7 @@ export const NumberInput = ({ onChange, ...props }: NumberInputProps) => {
onChange?.(value === '' ? 0 : Number(value)); // convert to number onChange?.(value === '' ? 0 : Number(value)); // convert to number
}} }}
{...props} {...props}
ref={ref}
></Input> ></Input>
); );
}; });

View File

@ -19,7 +19,7 @@ export default function DatasetWrapper() {
const { data } = useFetchKnowledgeBaseConfiguration(); const { data } = useFetchKnowledgeBaseConfiguration();
return ( return (
<section> <section className="flex h-full flex-col w-full">
<PageHeader> <PageHeader>
<Breadcrumb> <Breadcrumb>
<BreadcrumbList> <BreadcrumbList>
@ -35,7 +35,7 @@ export default function DatasetWrapper() {
</BreadcrumbList> </BreadcrumbList>
</Breadcrumb> </Breadcrumb>
</PageHeader> </PageHeader>
<div className="flex flex-1"> <div className="flex flex-1 min-h-0">
<SideBar></SideBar> <SideBar></SideBar>
<div className="flex-1"> <div className="flex-1">
<Outlet /> <Outlet />

View File

@ -66,10 +66,10 @@ export function ChunkMethodForm() {
}, [finalParserId]); }, [finalParserId]);
return ( return (
<> <section className="h-full flex flex-col">
<section className="overflow-auto max-h-[76vh]"> <div className="overflow-auto flex-1 min-h-0">
<ConfigurationComponent></ConfigurationComponent> <ConfigurationComponent></ConfigurationComponent>
</section> </div>
<div className="text-right pt-4 flex justify-end gap-3"> <div className="text-right pt-4 flex justify-end gap-3">
<Button <Button
type="reset" type="reset"
@ -112,6 +112,6 @@ export function ChunkMethodForm() {
{t('knowledgeConfiguration.save')} {t('knowledgeConfiguration.save')}
</Button> </Button>
</div> </div>
</> </section>
); );
} }

View File

@ -1,4 +1,5 @@
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { X } from 'lucide-react'; import { X } from 'lucide-react';
import { useState } from 'react'; import { useState } from 'react';
import CategoryPanel from './category-panel'; import CategoryPanel from './category-panel';
@ -14,20 +15,22 @@ export default ({
return ( return (
<div <div
style={{ className={cn('hidden flex-1', {
display: tab === 'chunkMethodForm' ? 'block' : 'none', 'flex flex-col': tab === 'chunkMethodForm',
}} })}
> >
<Button <div>
variant="outline" <Button
onClick={() => { variant="outline"
setVisible(!visible); onClick={() => {
}} setVisible(!visible);
> }}
Learn More >
</Button> Learn More
</Button>
</div>
<div <div
className="bg-[#FFF]/10 p-[20px] rounded-[12px] mt-[10px] relative" className="bg-[#FFF]/10 p-[20px] rounded-[12px] mt-[10px] relative flex-1 overflow-auto"
style={{ display: visible ? 'block' : 'none' }} style={{ display: visible ? 'block' : 'none' }}
> >
<CategoryPanel chunkMethod={parserId}></CategoryPanel> <CategoryPanel chunkMethod={parserId}></CategoryPanel>

View File

@ -81,22 +81,23 @@ export default function DatasetSettings() {
} }
return ( return (
<section className="p-5 "> <section className="p-5 h-full flex flex-col">
<TopTitle <TopTitle
title={t('knowledgeDetails.configuration')} title={t('knowledgeDetails.configuration')}
description={t('knowledgeConfiguration.titleDescription')} description={t('knowledgeConfiguration.titleDescription')}
></TopTitle> ></TopTitle>
<div className="flex gap-14"> <div className="flex gap-14 flex-1 min-h-0">
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-6 basis-full min-w-[1000px] max-w-[1000px]" className="space-y-6 flex-1"
> >
<Tabs <Tabs
defaultValue="generalForm" defaultValue="generalForm"
onValueChange={(val) => { onValueChange={(val) => {
setCurrentTab(val); setCurrentTab(val);
}} }}
className="h-full flex flex-col"
> >
<TabsList className="grid bg-transparent grid-cols-2 rounded-none text-foreground"> <TabsList className="grid bg-transparent grid-cols-2 rounded-none text-foreground">
<TabsTrigger <TabsTrigger
@ -120,10 +121,10 @@ export default function DatasetSettings() {
</div> </div>
</TabsTrigger> </TabsTrigger>
</TabsList> </TabsList>
<TabsContent value="generalForm"> <TabsContent value="generalForm" className="flex-1 min-h-0">
<GeneralForm></GeneralForm> <GeneralForm></GeneralForm>
</TabsContent> </TabsContent>
<TabsContent value="chunkMethodForm"> <TabsContent value="chunkMethodForm" className="flex-1 min-h-0">
<ChunkMethodForm></ChunkMethodForm> <ChunkMethodForm></ChunkMethodForm>
</TabsContent> </TabsContent>
</Tabs> </Tabs>