mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-12 22:42:13 +02:00
fix(sidebar): adjust button sizes and layout for improved UI consistency
- Reduced button sizes in EmbeddedDocumentsMenu and EmbeddedImportMenu for better alignment. - Updated layout spacing in SidebarButton to enhance visual clarity and consistency. - Added a new badge to the Sidebar component to indicate new items, improving user awareness.
This commit is contained in:
parent
58b26af1e0
commit
cd4eb18981
4 changed files with 27 additions and 17 deletions
|
|
@ -1014,13 +1014,13 @@ const ConnectedScraperIcons: FC<{ workspaceId: number }> = ({ workspaceId }) =>
|
||||||
return (
|
return (
|
||||||
<div className="hidden items-center gap-1 sm:flex">
|
<div className="hidden items-center gap-1 sm:flex">
|
||||||
<div aria-hidden className="h-5 w-px shrink-0 bg-border" />
|
<div aria-hidden className="h-5 w-px shrink-0 bg-border" />
|
||||||
<div className="flex items-center gap-0.5" aria-label="Connected data sources">
|
<ul className="m-0 flex list-none items-center gap-0.5 p-0" aria-label="Connected data sources">
|
||||||
{platforms.map((platform, i) => {
|
{platforms.map((platform, i) => {
|
||||||
const Icon = platform.icon;
|
const Icon = platform.icon;
|
||||||
return (
|
return (
|
||||||
<Tooltip key={platform.id}>
|
<Tooltip key={platform.id}>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<motion.span
|
<motion.li
|
||||||
initial={{ opacity: 0, y: reduceMotion ? 0 : 4 }}
|
initial={{ opacity: 0, y: reduceMotion ? 0 : 4 }}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
transition={{
|
transition={{
|
||||||
|
|
@ -1031,13 +1031,13 @@ const ConnectedScraperIcons: FC<{ workspaceId: number }> = ({ workspaceId }) =>
|
||||||
className="flex size-5 items-center justify-center"
|
className="flex size-5 items-center justify-center"
|
||||||
>
|
>
|
||||||
<Icon className="size-3.5" />
|
<Icon className="size-3.5" />
|
||||||
</motion.span>
|
</motion.li>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent side="bottom">{platform.label} · Connected</TooltipContent>
|
<TooltipContent side="bottom">{platform.label} · Connected</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -145,10 +145,10 @@ export function EmbeddedDocumentsMenu({
|
||||||
type="button"
|
type="button"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
className="relative h-7 w-7 text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
className="relative h-6 w-6 text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||||
aria-label="Document actions"
|
aria-label="Document actions"
|
||||||
>
|
>
|
||||||
<SlidersVertical className="h-3.5 w-3.5" />
|
<SlidersVertical className="size-3.5" />
|
||||||
{activeTypes.length > 0 ? (
|
{activeTypes.length > 0 ? (
|
||||||
<span className="absolute right-0.5 top-0.5 h-1.5 w-1.5 rounded-full bg-primary" />
|
<span className="absolute right-0.5 top-0.5 h-1.5 w-1.5 rounded-full bg-primary" />
|
||||||
) : null}
|
) : null}
|
||||||
|
|
@ -284,10 +284,10 @@ export function EmbeddedImportMenu({
|
||||||
type="button"
|
type="button"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
className="h-7 w-7 text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
className="h-6 w-6 text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
||||||
aria-label="Import documents"
|
aria-label="Import documents"
|
||||||
>
|
>
|
||||||
<FolderInput className="h-3.5 w-3.5" />
|
<FolderInput className="size-3.5" />
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="end" className="w-56">
|
<DropdownMenuContent align="end" className="w-56">
|
||||||
|
|
@ -1267,7 +1267,7 @@ function AuthenticatedDocumentsSidebarBase({
|
||||||
defaultOpen={true}
|
defaultOpen={true}
|
||||||
contentClassName="px-0"
|
contentClassName="px-0"
|
||||||
persistentAction={
|
persistentAction={
|
||||||
<div className="flex items-center gap-0.5">
|
<div className="flex items-center gap-1.5">
|
||||||
<EmbeddedImportMenu onFolderWatched={refreshWatchedIds} />
|
<EmbeddedImportMenu onFolderWatched={refreshWatchedIds} />
|
||||||
<EmbeddedDocumentsMenu
|
<EmbeddedDocumentsMenu
|
||||||
typeCounts={typeCounts}
|
typeCounts={typeCounts}
|
||||||
|
|
@ -1443,7 +1443,7 @@ function AnonymousDocumentsSidebar({ embedded = false }: DocumentsSidebarProps)
|
||||||
defaultOpen={true}
|
defaultOpen={true}
|
||||||
contentClassName="px-0"
|
contentClassName="px-0"
|
||||||
persistentAction={
|
persistentAction={
|
||||||
<div className="flex items-center gap-0.5">
|
<div className="flex items-center gap-1.5">
|
||||||
<EmbeddedImportMenu gate={gate} />
|
<EmbeddedImportMenu gate={gate} />
|
||||||
<EmbeddedDocumentsMenu
|
<EmbeddedDocumentsMenu
|
||||||
typeCounts={hasDoc ? { FILE: 1 } : {}}
|
typeCounts={hasDoc ? { FILE: 1 } : {}}
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,14 @@ export function Sidebar({
|
||||||
onClick={() => onNavItemClick?.(playgroundItem)}
|
onClick={() => onNavItemClick?.(playgroundItem)}
|
||||||
isCollapsed={isCollapsed}
|
isCollapsed={isCollapsed}
|
||||||
isActive={playgroundItem.isActive}
|
isActive={playgroundItem.isActive}
|
||||||
|
badge={
|
||||||
|
<Badge
|
||||||
|
variant="secondary"
|
||||||
|
className="h-5 shrink-0 rounded-sm border-0 bg-popover-foreground/10 px-1.5 text-[11px] text-popover-foreground hover:bg-popover-foreground/10"
|
||||||
|
>
|
||||||
|
New
|
||||||
|
</Badge>
|
||||||
|
}
|
||||||
tooltipContent={isCollapsed ? playgroundItem.title : undefined}
|
tooltipContent={isCollapsed ? playgroundItem.title : undefined}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -73,17 +73,19 @@ export function SidebarButton({
|
||||||
isCollapsed ? "max-w-0 opacity-0 ml-0" : "max-w-[260px] flex-1 opacity-100 ml-2"
|
isCollapsed ? "max-w-0 opacity-0 ml-0" : "max-w-[260px] flex-1 opacity-100 ml-2"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<span className="block truncate">{label}</span>
|
<span className="flex min-w-0 items-center gap-1.5">
|
||||||
|
<span className="truncate">{label}</span>
|
||||||
|
{!isCollapsed && badge && typeof badge !== "string" ? badge : null}
|
||||||
|
{!isCollapsed && badge && typeof badge === "string" ? (
|
||||||
|
<span className="inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white">
|
||||||
|
{badge}
|
||||||
|
</span>
|
||||||
|
) : null}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{!isCollapsed && trailingContent}
|
{!isCollapsed && trailingContent}
|
||||||
{!isCollapsed && badge && typeof badge !== "string" ? badge : null}
|
|
||||||
{!isCollapsed && badge && typeof badge === "string" ? (
|
|
||||||
<span className="ml-1 inline-flex items-center justify-center min-w-4 h-4 px-1 rounded-full bg-red-500 text-white text-[10px] font-medium">
|
|
||||||
{badge}
|
|
||||||
</span>
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
{collapsedOverlay && (
|
{collapsedOverlay && (
|
||||||
<span
|
<span
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue