fix(web): improve logs panel scroll handling (#2305)

- forward refs through ScrollArea so logs can access the viewport
- keep logs pinned to the bottom only when the user is already near it
- apply import and className ordering cleanup across frontend components
This commit is contained in:
wenjie authored and GitHub committed 2026-04-03 15:37:23 +08:00
1 parent 7f7b4c430b
commit bd56e10bb8
13 files changed
+97 -53

No files matched your search

@@ -3,13 +3,13 @@ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"
import { cn } from "@/lib/utils"
function ScrollArea({
className,
children,
...props
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
const ScrollArea = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
>(({ className, children, ...props }, ref) => {
return (
<ScrollAreaPrimitive.Root
ref={ref}
data-slot="scroll-area"
className={cn("relative", className)}
{...props}
@@ -24,7 +24,9 @@ function ScrollArea({
<ScrollAreaPrimitive.Corner />
</ScrollAreaPrimitive.Root>
)
}
})
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
function ScrollBar({
className,