From 63946d829e817978961a9764a814499b8507a64a Mon Sep 17 00:00:00 2001 From: KVOJJJin Date: Fri, 15 May 2026 15:43:44 +0800 Subject: [PATCH] fix(web): web app description missing (#36209) --- .../text-generation/__tests__/info-modal.spec.tsx | 7 ++++--- .../share/text-generation/info-modal.tsx | 15 +++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/web/app/components/share/text-generation/__tests__/info-modal.spec.tsx b/web/app/components/share/text-generation/__tests__/info-modal.spec.tsx index 972c22dfcea..63a15604c25 100644 --- a/web/app/components/share/text-generation/__tests__/info-modal.spec.tsx +++ b/web/app/components/share/text-generation/__tests__/info-modal.spec.tsx @@ -72,10 +72,10 @@ describe('InfoModal', () => { expect(screen.getByText('Test App')).toBeInTheDocument() }) - it('should render copyright when provided', async () => { + it('should render copyright in the full rights reserved format when provided', async () => { const siteInfoWithCopyright: SiteInfo = { ...baseSiteInfo, - copyright: 'Dify Inc.', + copyright: 'Dify AI', } await renderModal( @@ -86,7 +86,8 @@ describe('InfoModal', () => { />, ) - expect(screen.getByText(/Dify Inc./)).toBeInTheDocument() + const currentYear = new Date().getFullYear().toString() + expect(screen.getByText(`Copyright © ${currentYear} Dify AI. All Rights Reserved.`)).toBeInTheDocument() }) it('should render current year in copyright', async () => { diff --git a/web/app/components/share/text-generation/info-modal.tsx b/web/app/components/share/text-generation/info-modal.tsx index b8516106616..894ca8781ee 100644 --- a/web/app/components/share/text-generation/info-modal.tsx +++ b/web/app/components/share/text-generation/info-modal.tsx @@ -16,6 +16,8 @@ const InfoModal = ({ onClose, data, }: Props) => { + const [currentYear] = React.useState(() => new Date().getFullYear()) + return ( - +
@@ -35,15 +37,20 @@ const InfoModal = ({ background={data?.icon_background || appDefaultIconBackground} imageUrl={data?.icon_url} /> -
{data?.title}
+
+
{data?.title}
+
{data?.description}
+
{/* copyright */} {data?.copyright && (
- © - {(new Date()).getFullYear()} + Copyright © + {' '} + {currentYear} {' '} {data?.copyright} + . All Rights Reserved.
)} {data?.custom_disclaimer && (