Fix: Optimize table style #3221 (#9703)

### What problem does this PR solve?

Fix: Optimize table style
-Modify the style of the table scrollbar and remove unnecessary
scrollbars
-Adjust the header style of the table, add background color and
hierarchy
-Optimize the style of datasets and file tables
-Add a new background color variable

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-08-26 10:46:54 +08:00
committed by GitHub
parent 63b5c2292d
commit ae505e6165
8 changed files with 113 additions and 65 deletions

View File

@ -50,9 +50,10 @@ export function DatasetActionCell({
}, [record, showRenameModal]);
return (
<section className="flex gap-4 items-center text-text-sub-title-invert">
<section className="flex gap-4 items-center text-text-sub-title-invert opacity-0 group-hover:opacity-100 transition-opacity">
<Button
variant={'ghost'}
variant="transparent"
className="border-none hover:bg-bg-card text-text-primary"
size={'sm'}
disabled={isRunning}
onClick={handleRename}
@ -61,7 +62,12 @@ export function DatasetActionCell({
</Button>
<HoverCard>
<HoverCardTrigger>
<Button variant="ghost" disabled={isRunning} size={'sm'}>
<Button
variant="transparent"
className="border-none hover:bg-bg-card text-text-primary"
disabled={isRunning}
size={'sm'}
>
<Eye />
</Button>
</HoverCardTrigger>
@ -88,7 +94,8 @@ export function DatasetActionCell({
{isVirtualDocument || (
<Button
variant={'ghost'}
variant="transparent"
className="border-none hover:bg-bg-card text-text-primary"
onClick={onDownloadDocument}
disabled={isRunning}
size={'sm'}
@ -97,7 +104,12 @@ export function DatasetActionCell({
</Button>
)}
<ConfirmDeleteDialog onOk={handleRemove}>
<Button variant={'ghost'} size={'sm'} disabled={isRunning}>
<Button
variant="transparent"
className="border-none hover:bg-bg-card text-text-primary"
size={'sm'}
disabled={isRunning}
>
<Trash2 />
</Button>
</ConfirmDeleteDialog>

View File

@ -119,7 +119,7 @@ export function DatasetTable({
return (
<div className="w-full">
<Table rootClassName="max-h-[82vh]">
<Table rootClassName="max-h-[calc(100vh-222px)]">
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
@ -144,6 +144,7 @@ export function DatasetTable({
<TableRow
key={row.id}
data-state={row.getIsSelected() && 'selected'}
className="group"
>
{row.getVisibleCells().map((cell) => (
<TableCell