mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-23 19:05:16 +02:00
refactor(ui): standardize header styles across panels; adjust button sizes and spacing for improved layout consistency
This commit is contained in:
parent
c1c34eb916
commit
5c77864b14
5 changed files with 37 additions and 23 deletions
|
|
@ -9,8 +9,7 @@ const ChatScrollToBottom: FC = () => (
|
||||||
<ThreadPrimitive.ScrollToBottom asChild>
|
<ThreadPrimitive.ScrollToBottom asChild>
|
||||||
<TooltipIconButton
|
<TooltipIconButton
|
||||||
tooltip="Scroll to bottom"
|
tooltip="Scroll to bottom"
|
||||||
variant="outline"
|
className="aui-thread-scroll-to-bottom -top-12 absolute z-10 self-center rounded-full border-0 bg-muted p-4 text-foreground hover:bg-muted/80 disabled:invisible"
|
||||||
className="aui-thread-scroll-to-bottom -top-12 absolute z-10 self-center rounded-full p-4 disabled:invisible dark:bg-main-panel dark:hover:bg-accent"
|
|
||||||
>
|
>
|
||||||
<ArrowDownIcon />
|
<ArrowDownIcon />
|
||||||
</TooltipIconButton>
|
</TooltipIconButton>
|
||||||
|
|
|
||||||
|
|
@ -94,19 +94,24 @@ export const CitationPanelContent: FC<CitationPanelContentProps> = ({ chunkId, o
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="shrink-0 border-b">
|
<div className="shrink-0">
|
||||||
<div className="flex h-14 items-center justify-between px-4">
|
<div className="shrink-0 flex h-12 items-center justify-between px-3 border-b">
|
||||||
<h2 className="text-lg font-medium text-muted-foreground select-none">Citation</h2>
|
<h2 className="select-none text-lg font-semibold">Citation</h2>
|
||||||
<div className="flex items-center gap-1 shrink-0">
|
<div className="flex items-center gap-1 shrink-0">
|
||||||
{onClose && (
|
{onClose && (
|
||||||
<Button variant="ghost" size="icon" onClick={onClose} className="size-7 shrink-0">
|
<Button
|
||||||
<XIcon className="size-4" />
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
onClick={onClose}
|
||||||
|
className="h-8 w-8 rounded-full shrink-0"
|
||||||
|
>
|
||||||
|
<XIcon className="h-4 w-4 text-muted-foreground" />
|
||||||
<span className="sr-only">Close citation panel</span>
|
<span className="sr-only">Close citation panel</span>
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex h-10 items-center justify-between gap-2 border-t px-4">
|
<div className="flex h-10 items-center justify-between gap-2 border-b px-4">
|
||||||
<div className="min-w-0 flex flex-1 items-center gap-2">
|
<div className="min-w-0 flex flex-1 items-center gap-2">
|
||||||
<p className="truncate text-sm text-muted-foreground">
|
<p className="truncate text-sm text-muted-foreground">
|
||||||
{data?.title ?? (isLoading ? "Loading…" : `Chunk #${chunkId}`)}
|
{data?.title ?? (isLoading ? "Loading…" : `Chunk #${chunkId}`)}
|
||||||
|
|
|
||||||
|
|
@ -448,17 +448,22 @@ export function EditorPanelContent({
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{showDesktopHeader ? (
|
{showDesktopHeader ? (
|
||||||
<div className="shrink-0 border-b">
|
<div className="shrink-0">
|
||||||
<div className="flex h-14 items-center justify-between px-4">
|
<div className="shrink-0 flex h-12 items-center justify-between px-3 border-b">
|
||||||
<h2 className="text-lg font-medium text-muted-foreground select-none">File</h2>
|
<h2 className="select-none text-lg font-semibold">File</h2>
|
||||||
<div className="flex items-center gap-1 shrink-0">
|
<div className="flex items-center gap-1 shrink-0">
|
||||||
<Button variant="ghost" size="icon" onClick={onClose} className="size-7 shrink-0">
|
<Button
|
||||||
<XIcon className="size-4" />
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
onClick={onClose}
|
||||||
|
className="h-8 w-8 rounded-full shrink-0"
|
||||||
|
>
|
||||||
|
<XIcon className="h-4 w-4 text-muted-foreground" />
|
||||||
<span className="sr-only">Close editor panel</span>
|
<span className="sr-only">Close editor panel</span>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex h-10 items-center justify-between gap-2 border-t px-4">
|
<div className="flex h-10 items-center justify-between gap-2 border-b px-4">
|
||||||
<div className="min-w-0 flex flex-1 items-center gap-2">
|
<div className="min-w-0 flex flex-1 items-center gap-2">
|
||||||
<p className="truncate text-sm text-muted-foreground">{displayTitle}</p>
|
<p className="truncate text-sm text-muted-foreground">{displayTitle}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -667,7 +672,7 @@ export function EditorPanelContent({
|
||||||
placeholder="Start writing..."
|
placeholder="Start writing..."
|
||||||
editorVariant="default"
|
editorVariant="default"
|
||||||
allowModeToggle={false}
|
allowModeToggle={false}
|
||||||
reserveToolbarSpace
|
reserveToolbarSpace={isEditing}
|
||||||
defaultEditing={isEditing}
|
defaultEditing={isEditing}
|
||||||
className="**:[[role=toolbar]]:bg-sidebar!"
|
className="**:[[role=toolbar]]:bg-sidebar!"
|
||||||
// Render `[citation:N]` badges in view mode only.
|
// Render `[citation:N]` badges in view mode only.
|
||||||
|
|
|
||||||
|
|
@ -446,21 +446,26 @@ export function ReportPanelContent({
|
||||||
<>
|
<>
|
||||||
{showDesktopHeader ? (
|
{showDesktopHeader ? (
|
||||||
<>
|
<>
|
||||||
{/* Header — matches the editor panel "File" header pattern */}
|
{/* Header — matches the Documents panel header pattern */}
|
||||||
<div className="flex h-14 items-center justify-between px-4 shrink-0">
|
<div className="shrink-0 flex h-12 items-center justify-between px-3 border-b">
|
||||||
<h2 className="text-lg font-medium text-muted-foreground select-none">
|
<h2 className="select-none text-lg font-semibold">
|
||||||
{isResume ? "Resume" : "Report"}
|
{isResume ? "Resume" : "Report"}
|
||||||
</h2>
|
</h2>
|
||||||
{onClose && (
|
{onClose && (
|
||||||
<Button variant="ghost" size="icon" onClick={onClose} className="size-7 shrink-0">
|
<Button
|
||||||
<XIcon className="size-4" />
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
onClick={onClose}
|
||||||
|
className="h-8 w-8 rounded-full shrink-0"
|
||||||
|
>
|
||||||
|
<XIcon className="h-4 w-4 text-muted-foreground" />
|
||||||
<span className="sr-only">Close report panel</span>
|
<span className="sr-only">Close report panel</span>
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!isResume && (
|
{!isResume && (
|
||||||
<div className="flex h-10 items-center justify-between gap-2 border-t border-b px-4 shrink-0">
|
<div className="flex h-10 items-center justify-between gap-2 border-b px-4 shrink-0">
|
||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
<p className="truncate text-sm text-muted-foreground">
|
<p className="truncate text-sm text-muted-foreground">
|
||||||
{reportContent?.title || title}
|
{reportContent?.title || title}
|
||||||
|
|
@ -528,7 +533,7 @@ export function ReportPanelContent({
|
||||||
placeholder="Report content..."
|
placeholder="Report content..."
|
||||||
editorVariant="default"
|
editorVariant="default"
|
||||||
allowModeToggle={false}
|
allowModeToggle={false}
|
||||||
reserveToolbarSpace
|
reserveToolbarSpace={isEditing}
|
||||||
defaultEditing={isEditing}
|
defaultEditing={isEditing}
|
||||||
className="[&_[role=toolbar]]:!bg-sidebar"
|
className="[&_[role=toolbar]]:!bg-sidebar"
|
||||||
// Show citation badges in view mode; raw `[citation:N]`
|
// Show citation badges in view mode; raw `[citation:N]`
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export function FixedToolbar({
|
||||||
return (
|
return (
|
||||||
<Toolbar
|
<Toolbar
|
||||||
className={cn(
|
className={cn(
|
||||||
"scrollbar-hide sticky top-0 left-0 z-10 w-full justify-between overflow-x-auto border-b bg-background/95 p-1 backdrop-blur supports-backdrop-filter:bg-background/60",
|
"scrollbar-hide absolute top-0 left-0 z-[60] w-full justify-between overflow-x-auto border-b bg-background p-1",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue