From 4c44fd7ca83165fa9a7c5a4c9a6cd821452f0df2 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 27 Mar 2026 15:15:16 +0800 Subject: [PATCH] feat: add sandbox corner mark --- .../apps/__tests__/app-card.spec.tsx | 12 ++ web/app/components/apps/app-card.tsx | 8 ++ .../plugins/card/base/corner-mark.tsx | 2 +- .../__tests__/file-picker-block.spec.tsx | 132 ++++++++++++++++++ .../__tests__/component.spec.tsx | 91 ++++++++++++ web/i18n/en-US/app.json | 1 + 6 files changed, 245 insertions(+), 1 deletion(-) create mode 100644 web/app/components/workflow/skill/editor/skill-editor/plugins/__tests__/file-picker-block.spec.tsx create mode 100644 web/app/components/workflow/skill/editor/skill-editor/plugins/file-reference-block/__tests__/component.spec.tsx diff --git a/web/app/components/apps/__tests__/app-card.spec.tsx b/web/app/components/apps/__tests__/app-card.spec.tsx index 97e841264e..13df967e71 100644 --- a/web/app/components/apps/__tests__/app-card.spec.tsx +++ b/web/app/components/apps/__tests__/app-card.spec.tsx @@ -352,6 +352,18 @@ describe('AppCard', () => { expect(screen.getByTestId('app-type-icon')).toBeInTheDocument() }) + it('should render the sandbox corner mark when the app uses sandboxed runtime', () => { + renderAppCard({ runtime_type: 'sandboxed' }) + + expect(screen.getByText('app.sandboxBadge')).toBeInTheDocument() + }) + + it('should not render the sandbox corner mark for classic runtime apps', () => { + renderAppCard({ runtime_type: 'classic' }) + + expect(screen.queryByText('app.sandboxBadge')).not.toBeInTheDocument() + }) + it('should call getRedirection when the main card button is clicked', () => { const { app } = renderAppCard() diff --git a/web/app/components/apps/app-card.tsx b/web/app/components/apps/app-card.tsx index bebeab17f9..434da40243 100644 --- a/web/app/components/apps/app-card.tsx +++ b/web/app/components/apps/app-card.tsx @@ -31,6 +31,7 @@ import { import { toast } from '@/app/components/base/ui/toast' import { Tooltip, TooltipContent, TooltipTrigger } from '@/app/components/base/ui/tooltip' import { UserAvatarList } from '@/app/components/base/user-avatar-list' +import CornerMark from '@/app/components/plugins/card/base/corner-mark' import { NEED_REFRESH_APP_LIST_KEY } from '@/config' import { useAppContext } from '@/context/app-context' import { useGlobalPublicStore } from '@/context/global-public-context' @@ -441,11 +442,18 @@ const AppCard = ({ app, onRefresh, onlineUsers = [] }: AppCardProps) => { .filter(user => !!user.id) }, [onlineUsers]) + const isSandboxApp = app.runtime_type === 'sandboxed' + return ( <>
+ {isSandboxApp && ( +
+ +
+ )}