From be05fd4d14bffe218ce991a000e508001d2548cd Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Mon, 28 Sep 2026 23:06:26 +0000 Subject: [PATCH 1/4] feat(website): link each workshop app to its GitHub repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cinematic Studio and Re-shoot show a "View on GitHub" button beside their title. Until an app's repository is published it reads "GitHub · Coming soon" and is not a link; adding the URL to workshopAppRepo turns it on. --- .../cinematic-studio/AppRepoLink.test.ts | 26 ++++++++++ .../workshop/cinematic-studio/AppRepoLink.vue | 48 +++++++++++++++++++ .../cinematic-studio/CinematicFirstRun.vue | 3 ++ .../cinematic-studio/CinematicStudioPanel.vue | 9 +++- .../reshoot/ReshootHeader.vue | 19 ++++++-- apps/website/src/lib/workshop/apps.ts | 7 +++ .../src/lib/workshop/cinematic-studio/copy.ts | 8 ++++ 7 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 apps/website/src/components/workshop/cinematic-studio/AppRepoLink.test.ts create mode 100644 apps/website/src/components/workshop/cinematic-studio/AppRepoLink.vue diff --git a/apps/website/src/components/workshop/cinematic-studio/AppRepoLink.test.ts b/apps/website/src/components/workshop/cinematic-studio/AppRepoLink.test.ts new file mode 100644 index 00000000000..f7bf4cfada7 --- /dev/null +++ b/apps/website/src/components/workshop/cinematic-studio/AppRepoLink.test.ts @@ -0,0 +1,26 @@ +import { render, screen } from '@testing-library/vue' +import { describe, expect, it } from 'vitest' + +import AppRepoLink from './AppRepoLink.vue' + +describe('AppRepoLink', () => { + it('opens the app repository on GitHub in a new tab', () => { + render(AppRepoLink, { + props: { repo: 'https://github.com/Comfy-Org/comfy-examples' } + }) + + const link = screen.getByRole('link', { name: 'View on GitHub' }) + expect(link).toHaveAttribute( + 'href', + 'https://github.com/Comfy-Org/comfy-examples' + ) + expect(link).toHaveAttribute('target', '_blank') + }) + + it('says the code is coming soon, without a link, until the repository exists', () => { + render(AppRepoLink, { props: { locale: 'zh-CN' } }) + + expect(screen.getByText('GitHub · 即将推出')).toBeInTheDocument() + expect(screen.queryByRole('link')).toBeNull() + }) +}) diff --git a/apps/website/src/components/workshop/cinematic-studio/AppRepoLink.vue b/apps/website/src/components/workshop/cinematic-studio/AppRepoLink.vue new file mode 100644 index 00000000000..243508ddd91 --- /dev/null +++ b/apps/website/src/components/workshop/cinematic-studio/AppRepoLink.vue @@ -0,0 +1,48 @@ + + + diff --git a/apps/website/src/components/workshop/cinematic-studio/CinematicFirstRun.vue b/apps/website/src/components/workshop/cinematic-studio/CinematicFirstRun.vue index 46cc2356eba..1001a79ad5f 100644 --- a/apps/website/src/components/workshop/cinematic-studio/CinematicFirstRun.vue +++ b/apps/website/src/components/workshop/cinematic-studio/CinematicFirstRun.vue @@ -1,8 +1,10 @@