diff --git a/web/app/components/explore/sidebar/app-nav-item/__tests__/index.spec.tsx b/web/app/components/explore/sidebar/app-nav-item/__tests__/index.spec.tsx
index 8f65d525abf..f21cdaa52bc 100644
--- a/web/app/components/explore/sidebar/app-nav-item/__tests__/index.spec.tsx
+++ b/web/app/components/explore/sidebar/app-nav-item/__tests__/index.spec.tsx
@@ -28,11 +28,19 @@ describe('AppNavItem', () => {
expect(screen.getByTestId('item-operation-trigger')).toBeInTheDocument()
})
- it('should use responsive selectors for compact sidebar content', () => {
+ it('should use responsive selectors for mobile content', () => {
render()
- expect(screen.getByText('My App')).toHaveClass('hidden', 'pc:block', 'group-data-folded/explore-sidebar:hidden')
- expect(screen.getByTestId('item-operation-trigger').parentElement).toHaveClass('hidden', 'pc:block', 'group-data-folded/explore-sidebar:hidden')
+ expect(screen.getByText('My App')).toHaveClass('hidden', 'pc:block')
+ expect(screen.getByTestId('item-operation-trigger').parentElement).toHaveClass('hidden', 'pc:block')
+ })
+
+ it('should render icon-only content when folded', () => {
+ render()
+
+ expect(screen.getByRole('link', { name: 'My App' })).toBeInTheDocument()
+ expect(screen.queryByText('My App')).not.toBeInTheDocument()
+ expect(screen.queryByTestId('item-operation-trigger')).not.toBeInTheDocument()
})
})
diff --git a/web/app/components/explore/sidebar/app-nav-item/index.tsx b/web/app/components/explore/sidebar/app-nav-item/index.tsx
index e64e0b117ac..f8251114cd9 100644
--- a/web/app/components/explore/sidebar/app-nav-item/index.tsx
+++ b/web/app/components/explore/sidebar/app-nav-item/index.tsx
@@ -9,6 +9,7 @@ import ItemOperation from '@/app/components/explore/item-operation'
import Link from '@/next/link'
type IAppNavItemProps = {
+ isFolded?: boolean
variant?: 'default' | 'mainNav'
name: string
id: string
@@ -24,6 +25,7 @@ type IAppNavItemProps = {
}
export default function AppNavItem({
+ isFolded = false,
variant = 'default',
name,
id,
@@ -39,6 +41,7 @@ export default function AppNavItem({
}: IAppNavItemProps) {
const url = buildInstalledAppPath(id)
const isMainNav = variant === 'mainNav'
+ const shouldRenderFolded = !isMainNav && isFolded
return (
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'
- : 'group flex h-8 items-center justify-between rounded-lg px-2 system-sm-medium text-sm font-normal text-components-menu-item-text group-data-folded/explore-sidebar:justify-center group-data-folded/explore-sidebar:px-1 not-has-[>a[aria-current=page]]:hover:bg-state-base-hover not-has-[>a[aria-current=page]]:hover:text-components-menu-item-text-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 has-[>a[aria-current=page]]:text-components-menu-item-text-active mobile:justify-center mobile:px-1 pc:w-full pc:justify-start',
+ : cn(
+ 'group flex h-8 items-center rounded-lg system-sm-medium text-sm font-normal text-components-menu-item-text transition-colors not-has-[>a[aria-current=page]]:hover:bg-state-base-hover not-has-[>a[aria-current=page]]:hover:text-components-menu-item-text-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 has-[>a[aria-current=page]]:text-components-menu-item-text-active',
+ shouldRenderFolded ? 'justify-center px-1' : 'justify-between px-2 mobile:justify-center mobile:px-1 pc:w-full pc:justify-start',
+ ),
)}
>
-
-
-
{name}
-
-
- onDelete(id)}
- />
-
+ {shouldRenderFolded
+ ? (
+
+
+
+ )
+ : (
+ <>
+
+
+
{name}
+
+
+ onDelete(id)}
+ />
+
+ >
+ )}
)
}
diff --git a/web/app/components/explore/sidebar/index.tsx b/web/app/components/explore/sidebar/index.tsx
index 7e3accb9b19..57b609885f5 100644
--- a/web/app/components/explore/sidebar/index.tsx
+++ b/web/app/components/explore/sidebar/index.tsx
@@ -60,6 +60,7 @@ const SideBar = () => {
const installedAppItems = installedApps.map(({ id, is_pinned, uninstallable, app: { name, icon_type, icon, icon_url, icon_background } }, index) => (
- {
))
return (
-