diff --git a/frontend/src/app/layout/app-header.tsx b/frontend/src/app/layout/app-header.tsx index 7b55eed9..a9e3f9cd 100644 --- a/frontend/src/app/layout/app-header.tsx +++ b/frontend/src/app/layout/app-header.tsx @@ -509,6 +509,8 @@ const marketingRegisterEntry = `/?${new URLSearchParams({ returnTo: '/workspace', })}` +const githubRepository = 'https://github.com/1024XEngineer/Windup' + /** * 公开主页只换导航内容,沿用产品顶栏的布局、触控尺寸和视觉表面。 * 这样两套入口在手机上不会因为各自维护断点而逐渐错位。 @@ -570,6 +572,14 @@ function MarketingHeaderView({ session, wave, onWave }: MarketingHeaderViewProps aria-label="账号" className="relative ml-auto flex shrink-0 items-center gap-1 sm:gap-6" > + + GitHub + {session.state.status === 'booting' ? ( { ['制作流程', '#workflow'], ['资产工作台', '#workspace'], ] as const + const marketingNavigation = screen.getByRole('navigation', { name: '宣传页导航' }) for (const [name, href] of sectionLinks) { - expect(screen.getByRole('link', { name }).getAttribute('href')).toBe(href) + expect(within(marketingNavigation).getByRole('link', { name }).getAttribute('href')).toBe( + href, + ) expect(document.querySelector(href)).not.toBeNull() } expect(screen.getByRole('heading', { name: '角色做出来,还要留下来、跑起来。' })).toBeTruthy() @@ -115,4 +118,33 @@ describe('LandingPage', () => { expect(document.querySelector('img[src*="workflow-editor"]')).toBeNull() expect(document.querySelector('source[srcset*="workflow-editor"]')).toBeNull() }) + + it('在收尾插画之后提供真实的开源项目入口', async () => { + render( + + + + + , + ) + + const footer = await screen.findByRole('contentinfo') + const header = screen.getByRole('navigation', { name: '宣传页导航' }).closest('header') + + expect(header).not.toBeNull() + expect(within(header!).getByRole('link', { name: 'GitHub' }).getAttribute('href')).toBe( + 'https://github.com/1024XEngineer/Windup', + ) + expect(within(footer).getByText('Windup 是一个开源的 2D 角色资产工作台。')).toBeTruthy() + expect(within(footer).getByRole('link', { name: 'GitHub 仓库' }).getAttribute('href')).toBe( + 'https://github.com/1024XEngineer/Windup', + ) + expect(within(footer).getByRole('link', { name: 'Issues' }).getAttribute('href')).toBe( + 'https://github.com/1024XEngineer/Windup/issues', + ) + expect(within(footer).getByRole('link', { name: 'Contributors' }).getAttribute('href')).toBe( + 'https://github.com/1024XEngineer/Windup/graphs/contributors', + ) + expect(within(footer).queryByText(/隐私政策|服务条款|备案/)).toBeNull() + }) }) diff --git a/frontend/src/pages/landing/index.tsx b/frontend/src/pages/landing/index.tsx index bb3ce2e4..e295f95c 100644 --- a/frontend/src/pages/landing/index.tsx +++ b/frontend/src/pages/landing/index.tsx @@ -16,6 +16,8 @@ const creationEntry = `/?${new URLSearchParams({ returnTo: '/workspace', })}` +const githubRepository = 'https://github.com/1024XEngineer/Windup' + const productCapabilities = [ { outcome: @@ -686,6 +688,78 @@ export function LandingPage() { + + ) }