Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): align web app sidebar spacing (#41425)

yyh0b11d34d4baa
diff --git a/web/app/components/explore/installed-app-navigation/app-nav-item.tsx b/web/app/components/explore/installed-app-navigation/app-nav-item.tsx
index cda74ad5975..54b7371c4fb 100644
--- a/web/app/components/explore/installed-app-navigation/app-nav-item.tsx
+++ b/web/app/components/explore/installed-app-navigation/app-nav-item.tsx
@@ -33,7 +33,7 @@ export default function AppNavItem({
return (
<div
key={id}
- className="group flex h-8 items-center justify-between gap-2 rounded-lg py-0.5 pr-0.5 pl-2 transition-colors not-has-[>a[aria-current=page]]:hover:bg-state-base-hover has-[>a:focus-visible]:inset-ring-2 has-[>a:focus-visible]:inset-ring-state-accent-solid has-[>a[aria-current=page]]:bg-state-base-active"
+ className="group flex h-7 items-center justify-between gap-2 rounded-lg py-0.5 pr-0.5 pl-2 transition-colors not-has-[>a[aria-current=page]]:hover:bg-state-base-hover has-[>a:focus-visible]:inset-ring-2 has-[>a:focus-visible]:inset-ring-state-accent-solid has-[>a[aria-current=page]]:bg-state-base-active"
>
<Link
href={url}
diff --git a/web/app/components/explore/installed-app-navigation/pagination-skeleton.tsx b/web/app/components/explore/installed-app-navigation/pagination-skeleton.tsx
index 5500f171636..918e4348aa1 100644
--- a/web/app/components/explore/installed-app-navigation/pagination-skeleton.tsx
+++ b/web/app/components/explore/installed-app-navigation/pagination-skeleton.tsx
@@ -3,7 +3,7 @@ const skeletonClassName = 'rounded bg-text-quaternary opacity-20'
export const InstalledAppPaginationSkeleton = () => (
<div
aria-hidden
- className="flex h-8 animate-pulse items-center gap-2 px-2 py-0.5 motion-reduce:animate-none"
+ className="flex h-7 animate-pulse items-center gap-2 px-2 py-0.5 motion-reduce:animate-none"
>
<div className={`${skeletonClassName} size-5 shrink-0 rounded-md`} />
<div className={`${skeletonClassName} h-3 w-24`} />
diff --git a/web/app/components/main-nav/components/web-apps-section.tsx b/web/app/components/main-nav/components/web-apps-section.tsx
index 01779defcbe..e86f63bee3f 100644
--- a/web/app/components/main-nav/components/web-apps-section.tsx
+++ b/web/app/components/main-nav/components/web-apps-section.tsx
@@ -44,9 +44,9 @@ import { hasPermission } from '@/utils/permission'
const emptyInstalledApps: InstalledAppResponse[] = []
-const appNavItemHeight = 32
-const appNavItemGap = 2
-const appNavSeparatorHeight = 16.5
+const appNavItemHeight = 28
+const appNavItemGap = 1
+const appNavSeparatorHeight = 12
const getPreloadDistance = (scrollContainer: Element) =>
Math.max(160, Math.min(scrollContainer.clientHeight * 0.25, 320))
@@ -124,7 +124,7 @@ const WebAppsSectionContent = () => {
getItemKey: getWebAppRowKey,
getScrollElement: () => scrollRef.current,
overscan: 6,
- paddingEnd: 8,
+ paddingEnd: installedAppsQuery.hasNextPage ? 0 : 8,
})
const canLoadMore = !installedAppsQuery.isFetching && !installedAppsQuery.error
@@ -186,7 +186,13 @@ const WebAppsSectionContent = () => {
/>
)
const renderRow = (row: WebAppListRow) => {
- if (row.kind === 'separator') return <Divider />
+ if (row.kind === 'separator') {
+ return (
+ <div className="flex h-3 items-center px-1">
+ <Divider className="m-0 h-px bg-divider-subtle" />
+ </div>
+ )
+ }
return renderAppNavItem(row.app)
}