From 155b7496c50565dec2a70c9c14719ea881bcb889 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 11 May 2026 14:29:48 +0800 Subject: [PATCH] chore: templates item ui and learn dify --- .../explore/app-card/__tests__/index.spec.tsx | 9 ++++- web/app/components/explore/app-card/index.tsx | 35 ++++++++++++------- web/app/components/explore/app-list/index.tsx | 2 +- .../explore/app-list/style.module.css | 10 ++---- .../main-nav/__tests__/index.spec.tsx | 8 +++-- .../main-nav/components/help-menu.tsx | 31 ++++++++-------- 6 files changed, 52 insertions(+), 43 deletions(-) diff --git a/web/app/components/explore/app-card/__tests__/index.spec.tsx b/web/app/components/explore/app-card/__tests__/index.spec.tsx index 68cb802acf..e69dc274a8 100644 --- a/web/app/components/explore/app-card/__tests__/index.spec.tsx +++ b/web/app/components/explore/app-card/__tests__/index.spec.tsx @@ -90,7 +90,14 @@ describe('AppCard', () => { renderComponent({ app: createApp({ description: 'Very long description text' }) }) const descWrapper = screen.getByText('Very long description text') - expect(descWrapper).toHaveClass('line-clamp-4') + expect(descWrapper).toHaveClass('line-clamp-2') + }) + + it('should render category badges', () => { + renderComponent({ app: createApp({ categories: ['Search', 'Productivity'] }) }) + + expect(screen.getByText('Search')).toBeInTheDocument() + expect(screen.getByText('Productivity')).toBeInTheDocument() }) }) diff --git a/web/app/components/explore/app-card/index.tsx b/web/app/components/explore/app-card/index.tsx index 3a6d4962e2..749d834c01 100644 --- a/web/app/components/explore/app-card/index.tsx +++ b/web/app/components/explore/app-card/index.tsx @@ -1,10 +1,8 @@ 'use client' import type { App } from '@/models/explore' import type { TryAppSelection } from '@/types/try-app' -import { PlusIcon } from '@heroicons/react/20/solid' import { Button } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' -import { RiInformation2Line } from '@remixicon/react' import { useSuspenseQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import { trackEvent } from '@/app/components/base/amplitude' @@ -44,8 +42,8 @@ const AppCard = ({ } return ( -
-
+
+
-
-
+
+
{appBasicInfo.name}
-
+
{appBasicInfo.mode === AppModeEnum.ADVANCED_CHAT &&
{t('types.advanced', { ns: 'app' }).toUpperCase()}
} {appBasicInfo.mode === AppModeEnum.CHAT &&
{t('types.chatbot', { ns: 'app' }).toUpperCase()}
} {appBasicInfo.mode === AppModeEnum.AGENT_CHAT &&
{t('types.agent', { ns: 'app' }).toUpperCase()}
} @@ -73,24 +71,35 @@ const AppCard = ({
-
-
+
+
{app.description}
+
+
+ {app.categories.slice(0, 2).map(category => ( +
+ + {category} +
+ ))} +
+
+
{isExplore && (canCreate || isTrialApp) && (