From 4395c3afdbaf6b3237ff99b53ca96514757e9cfb Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Sat, 12 Sep 2026 12:19:17 +0000 Subject: [PATCH 01/12] fix(models): the review pass from the design side One way back from a model page, to the shelf it was opened from, replacing the breadcrumb that sent people to comfy.org. A run in flight asks before a reload throws it away. The search field keeps its place when the rows swap for a grid and back. Examples fill the row they sit in. A video result opens full screen like a still. Credits say Add, not Buy, wherever they are offered. --- .../workshop/CatalogueBackLink.test.ts | 31 ++++++++++++++ .../components/workshop/CatalogueBackLink.vue | 42 +++++++++++++++++++ .../src/components/workshop/ExamplesTab.vue | 4 +- .../components/workshop/HeaderAccount.test.ts | 2 +- .../components/workshop/ModelDetail.test.ts | 18 ++++---- .../src/components/workshop/ModelDetail.vue | 9 +++- .../workshop/PlaygroundOutput.test.ts | 4 +- .../components/workshop/PlaygroundOutput.vue | 17 +++++++- .../workshop/WorkshopModelsGrid.vue | 33 ++++++++------- apps/website/src/i18n/translations.ts | 11 +++-- apps/website/src/lib/workshop/shelf-memory.ts | 31 ++++++++++++++ .../src/lib/workshop/use-case-label.ts | 18 ++++++++ apps/website/src/routes/models/[slug].astro | 19 +-------- 13 files changed, 187 insertions(+), 52 deletions(-) create mode 100644 apps/website/src/components/workshop/CatalogueBackLink.test.ts create mode 100644 apps/website/src/components/workshop/CatalogueBackLink.vue create mode 100644 apps/website/src/lib/workshop/shelf-memory.ts create mode 100644 apps/website/src/lib/workshop/use-case-label.ts diff --git a/apps/website/src/components/workshop/CatalogueBackLink.test.ts b/apps/website/src/components/workshop/CatalogueBackLink.test.ts new file mode 100644 index 00000000000..d36d5f2be41 --- /dev/null +++ b/apps/website/src/components/workshop/CatalogueBackLink.test.ts @@ -0,0 +1,31 @@ +// @vitest-environment happy-dom +import { render, screen, waitFor } from '@testing-library/vue' +import { afterEach, describe, expect, it } from 'vitest' + +import { rememberShelf } from '../../lib/workshop/shelf-memory' +import CatalogueBackLink from './CatalogueBackLink.vue' + +afterEach(() => { + sessionStorage.clear() +}) + +describe('CatalogueBackLink', () => { + it('offers the whole catalogue when no shelf was left behind', () => { + render(CatalogueBackLink) + + const link = screen.getByTestId('model-back') + expect(link.textContent.trim()).toBe('Back to all models') + expect(link.getAttribute('href')).toBe('/models') + }) + + it('offers the shelf the visitor came from', async () => { + rememberShelf('generate-videos') + render(CatalogueBackLink) + + await waitFor(() => { + const link = screen.getByTestId('model-back') + expect(link.textContent.trim()).toBe('Back to Generate videos') + expect(link.getAttribute('href')).toBe('/models?useCase=generate-videos') + }) + }) +}) diff --git a/apps/website/src/components/workshop/CatalogueBackLink.vue b/apps/website/src/components/workshop/CatalogueBackLink.vue new file mode 100644 index 00000000000..b33892ae832 --- /dev/null +++ b/apps/website/src/components/workshop/CatalogueBackLink.vue @@ -0,0 +1,42 @@ + + + diff --git a/apps/website/src/components/workshop/ExamplesTab.vue b/apps/website/src/components/workshop/ExamplesTab.vue index 8e6162a5921..d7b2960cbda 100644 --- a/apps/website/src/components/workshop/ExamplesTab.vue +++ b/apps/website/src/components/workshop/ExamplesTab.vue @@ -73,7 +73,7 @@ function actionFor(example: PlaygroundExample, active = false) { they fit in a row of their own. -->