From 9678d61b3fa79ca6cf1e405206ede384a60387ef Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Wed, 21 Oct 2026 20:43:59 +0530 Subject: [PATCH 1/9] feat(website): read capability from the Hub workflow list URL The workflow list now reads `capability` on load, shows it as a chip, filters the results by it, and keeps it in the URL when the search, sort or other filters change. Removing the chip or pressing Clear drops it from the URL. On the server-filtered list, a capability the catalog does not know stays in the URL and the list shows the empty result with its chip and a Clear button. On the static list, a capability that no workflow has is dropped, so the full list shows. --- .../workshop/WorkflowCatalogue.test.ts | 90 +++++++++++++++++++ .../components/workshop/WorkflowCatalogue.vue | 47 ++++++++-- 2 files changed, 130 insertions(+), 7 deletions(-) diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.test.ts b/apps/website/src/components/workshop/WorkflowCatalogue.test.ts index 2479c4698d5..006e76fbdb7 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.test.ts +++ b/apps/website/src/components/workshop/WorkflowCatalogue.test.ts @@ -278,4 +278,94 @@ describe('workflow catalogue ordering and shared links', () => { '/models/workflows/connect/' ]) }) + + it('restores a known capability from a shared URL and drops one no workflow has', async () => { + history.replaceState( + null, + '', + '/hub/workflows/?capability=Upscale&capability=Unknown' + ) + render(WorkflowCatalogue, { + props: { + models: [ + { ...models[0], capabilities: ['Upscale'] }, + ...models.slice(1) + ] + } + }) + await waitFor(() => + expect(screen.getByTestId('workshop-filter-chips')).toHaveTextContent( + 'Upscale' + ) + ) + expect(screen.getByTestId('workshop-filter-chips')).not.toHaveTextContent( + 'Unknown' + ) + expect(visibleOutcomes()).toEqual(['/models/workflows/restore/']) + }) +}) + +describe('workflow catalogue capability address on the server-filtered list', () => { + const serverPage = { + mode: 'cursor' as const, + page: 1, + pageSize: 24, + count: 2, + hasPrevious: false, + hasNext: false + } + const serverFacets = { categories: [], models: [] } + + it('opens the capability and search from the address as results, and keeps both in sync', async () => { + const user = userEvent.setup() + const { emitted } = render(WorkflowCatalogue, { + props: { + models: [models[1], models[2]], + initialSearch: '?q=flux&capability=Image+Edit', + serverPage, + serverFacets + } + }) + await waitFor(() => + expect(screen.getByTestId('workshop-filter-chips')).toHaveTextContent( + 'Image Edit' + ) + ) + expect(screen.getByRole('searchbox')).toHaveValue('flux') + expect(screen.getByTestId('workflow-search-results')).toBeInTheDocument() + + await user.click(screen.getByTestId('workshop-sort')) + await user.click(screen.getByTestId('sort-name')) + await waitFor(() => + expect(emitted('search').at(-1)).toEqual([ + 'q=flux&capability=Image+Edit&sort=name' + ]) + ) + + await user.click(screen.getByRole('button', { name: 'Remove Image Edit' })) + await waitFor(() => + expect(emitted('search').at(-1)).toEqual(['q=flux&sort=name']) + ) + }) + + it('shows the empty result for a capability the server does not know, and clears it', async () => { + const user = userEvent.setup() + const { emitted } = render(WorkflowCatalogue, { + props: { + models: [], + initialSearch: '?capability=Not+A+Capability', + serverPage: { ...serverPage, count: 0 }, + serverFacets + } + }) + expect( + await screen.findByText('No workflows match your search and filters.') + ).toBeInTheDocument() + expect(screen.getByTestId('workshop-filter-chips')).toHaveTextContent( + 'Not A Capability' + ) + + await user.click(screen.getByRole('button', { name: 'Clear' })) + await waitFor(() => expect(emitted('search').at(-1)).toEqual([''])) + }) }) diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.vue b/apps/website/src/components/workshop/WorkflowCatalogue.vue index ccefd27f774..6efcc213419 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.vue +++ b/apps/website/src/components/workshop/WorkflowCatalogue.vue @@ -65,6 +65,7 @@ const { t } = translationsFor(locale) const query = ref('') const selected = ref([]) const runsOn = ref([]) +const capabilities = ref([]) const sort = ref('popular') const filterMenu = useTemplateRef>('filterMenu') @@ -123,6 +124,13 @@ function readAddress(search: string, preserveQuery = false) { ? serverFacets.models.some((model) => model.value === name) : models.some((model) => model.models?.includes(name)) ) + capabilities.value = params + .getAll('capability') + .filter((value) => + serverPage + ? value.trim() + : models.some((model) => model.capabilities.includes(value)) + ) if (serverPage) sort.value = params.get('sort') === 'name' ? 'name' : 'popular' } @@ -150,17 +158,26 @@ watch( } ) watch( - [query, selected, runsOn, sort], + [query, selected, runsOn, capabilities, sort], () => { if (!serverPage || !searchReady) return clearTimeout(searchTimer) searchTimer = setTimeout(() => { const params = new URLSearchParams(initialSearch ?? location.search) - for (const key of ['q', 'category', 'model', 'sort', 'p', 'cursor']) + for (const key of [ + 'q', + 'category', + 'model', + 'capability', + 'sort', + 'p', + 'cursor' + ]) params.delete(key) if (query.value) params.set('q', query.value) for (const value of selected.value) params.append('category', value) for (const value of runsOn.value) params.append('model', value) + for (const value of capabilities.value) params.append('capability', value) if (sort.value !== 'popular') params.set('sort', sort.value) const search = params.toString() const current = new URLSearchParams(initialSearch ?? location.search) @@ -231,11 +248,19 @@ const modelOptions = computed(() => { const matchingCategories = computed(() => rows.value.flatMap((category) => !selected.value.length || selected.value.includes(category.id) - ? category.models.filter( - (model) => - !runsOn.value.length || - model.models?.some((name) => runsOn.value.includes(name)) - ) + ? category.models + .filter( + (model) => + !runsOn.value.length || + model.models?.some((name) => runsOn.value.includes(name)) + ) + .filter( + (model) => + !capabilities.value.length || + model.capabilities.some((value) => + capabilities.value.includes(value) + ) + ) : [] ) ) @@ -256,6 +281,7 @@ const browsing = computed( !query.value.trim() && !selected.value.length && !runsOn.value.length && + !capabilities.value.length && !browseAll.value ) const featured = computed(() => @@ -279,6 +305,10 @@ const chips = computed(() => [ modelOptions.value.find((option) => option.value === name)?.label ?? name }) + })), + ...capabilities.value.map((value) => ({ + key: `capability:${value}`, + label: value })) ]) @@ -287,12 +317,15 @@ function removeChip(key: string) { const value = rest.join(':') if (kind === 'use') selected.value = selected.value.filter((id) => id !== value) + else if (kind === 'capability') + capabilities.value = capabilities.value.filter((name) => name !== value) else runsOn.value = runsOn.value.filter((name) => name !== value) } function clearFilters() { selected.value = [] runsOn.value = [] + capabilities.value = [] } function clear() { From b42b104afbca7d4eb70f02dfd755b6491240447d Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Wed, 21 Oct 2026 20:53:27 +0530 Subject: [PATCH 2/9] refactor(website): move the workflow list address into its own function The debounced watch now calls filterAddress, which builds the list URL from the search, filters and sort. The pre-push complexity audit flagged the larger callback. --- .../components/workshop/WorkflowCatalogue.vue | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.vue b/apps/website/src/components/workshop/WorkflowCatalogue.vue index 6efcc213419..7234affd6f3 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.vue +++ b/apps/website/src/components/workshop/WorkflowCatalogue.vue @@ -134,6 +134,25 @@ function readAddress(search: string, preserveQuery = false) { if (serverPage) sort.value = params.get('sort') === 'name' ? 'name' : 'popular' } +function filterAddress() { + const params = new URLSearchParams(initialSearch ?? location.search) + for (const key of [ + 'q', + 'category', + 'model', + 'capability', + 'sort', + 'p', + 'cursor' + ]) + params.delete(key) + if (query.value) params.set('q', query.value) + for (const value of selected.value) params.append('category', value) + for (const value of runsOn.value) params.append('model', value) + for (const value of capabilities.value) params.append('capability', value) + if (sort.value !== 'popular') params.set('sort', sort.value) + return params.toString() +} let searchReady = false let requestedQuery: string | undefined let searchTimer: ReturnType | undefined @@ -163,23 +182,7 @@ watch( if (!serverPage || !searchReady) return clearTimeout(searchTimer) searchTimer = setTimeout(() => { - const params = new URLSearchParams(initialSearch ?? location.search) - for (const key of [ - 'q', - 'category', - 'model', - 'capability', - 'sort', - 'p', - 'cursor' - ]) - params.delete(key) - if (query.value) params.set('q', query.value) - for (const value of selected.value) params.append('category', value) - for (const value of runsOn.value) params.append('model', value) - for (const value of capabilities.value) params.append('capability', value) - if (sort.value !== 'popular') params.set('sort', sort.value) - const search = params.toString() + const search = filterAddress() const current = new URLSearchParams(initialSearch ?? location.search) current.delete('p') current.delete('cursor') From 77c11eb9bed42e36f40eb18a15550269463f55b9 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Wed, 21 Oct 2026 21:51:34 +0530 Subject: [PATCH 3/9] refactor(website): share one catalogue address writer between the lists The new catalogueAddress function in models-catalogue.ts builds the list URL from a base search, the search text, the sort and a map of filter values. WorkshopModelsGrid now calls it in place of its own delete loop and appendSelectedFilters. A table test covers the kept keys, the dropped defaults and the filter order. --- .../workshop/WorkshopModelsGrid.vue | 37 +++++----------- .../src/config/models-catalogue.test.ts | 43 +++++++++++++++++++ apps/website/src/config/models-catalogue.ts | 22 ++++++++++ 3 files changed, 76 insertions(+), 26 deletions(-) diff --git a/apps/website/src/components/workshop/WorkshopModelsGrid.vue b/apps/website/src/components/workshop/WorkshopModelsGrid.vue index 83b5e53ef57..933a479d326 100644 --- a/apps/website/src/components/workshop/WorkshopModelsGrid.vue +++ b/apps/website/src/components/workshop/WorkshopModelsGrid.vue @@ -22,6 +22,7 @@ import type { import { parseCatalogSearch, USE_CASES, + catalogueAddress, countByUseCase, sortOrdersFor, sortWorkshopModels @@ -237,22 +238,16 @@ watch( if (!serverPage || !scrollReady) return clearTimeout(searchTimer) searchTimer = setTimeout(() => { - const params = new URLSearchParams(initialSearch ?? location.search) - for (const key of [ - 'q', - 'useCase', - 'modality', - 'provider', - 'capability', - 'sort', - 'p', - 'cursor' - ]) - params.delete(key) - if (query.value) params.set('q', query.value) - appendSelectedFilters(params) - if (sort.value !== 'popular') params.set('sort', sort.value) - const search = params.toString() + const search = catalogueAddress(initialSearch ?? location.search, { + query: query.value, + sort: sort.value, + filters: { + useCase: selectedUseCases.value, + modality: legacyModalities.value, + provider: legacyProviders.value, + capability: legacyCapabilities.value + } + }) const current = new URLSearchParams(initialSearch ?? location.search) current.delete('p') current.delete('cursor') @@ -264,16 +259,6 @@ watch( }, { deep: true } ) -function appendSelectedFilters(params: URLSearchParams) { - const filters = { - useCase: selectedUseCases.value, - modality: legacyModalities.value, - provider: legacyProviders.value, - capability: legacyCapabilities.value - } - for (const [key, values] of Object.entries(filters)) - for (const value of values) params.append(key, value) -} onBeforeUnmount(() => clearTimeout(searchTimer)) watch(inSection, (value) => emit('section', value), { immediate: true }) // Inside a category the tabs give up the row, and the search takes it. diff --git a/apps/website/src/config/models-catalogue.test.ts b/apps/website/src/config/models-catalogue.test.ts index 92f502a92e6..0d362d7bb1f 100644 --- a/apps/website/src/config/models-catalogue.test.ts +++ b/apps/website/src/config/models-catalogue.test.ts @@ -18,6 +18,7 @@ import { countByFacet, countByUseCase, catalogSearch, + catalogueAddress, filterWorkshopModels, parseCatalogSearch, isRouterModel, @@ -554,3 +555,45 @@ describe('summaryFor', () => { expect(summaryFor([])).toBeUndefined() }) }) + +describe('catalogueAddress', () => { + it.for<{ + name: string + base: string + address: Parameters[1] + expected: string + }>([ + { + name: 'replaces the list keys and keeps the others', + base: '?q=old&category=a&p=3&cursor=x§ion=workflows', + address: { + query: 'flux', + sort: 'name', + filters: { category: ['b'] } + }, + expected: 'section=workflows&q=flux&category=b&sort=name' + }, + { + name: 'drops an empty search and the default sort', + base: '?q=old&sort=name&capability=a', + address: { + query: '', + sort: 'popular', + filters: { capability: [] } + }, + expected: '' + }, + { + name: 'appends every value of each filter in order', + base: '', + address: { + query: '', + sort: 'popular', + filters: { model: ['x', 'y'], capability: ['Image Edit'] } + }, + expected: 'model=x&model=y&capability=Image+Edit' + } + ])('$name', ({ base, address, expected }) => { + expect(catalogueAddress(base, address)).toBe(expected) + }) +}) diff --git a/apps/website/src/config/models-catalogue.ts b/apps/website/src/config/models-catalogue.ts index 3001b6c989e..d9721fd4445 100644 --- a/apps/website/src/config/models-catalogue.ts +++ b/apps/website/src/config/models-catalogue.ts @@ -459,6 +459,28 @@ export function catalogSearch(filter: CatalogLocation): string { return search ? `?${search}` : '' } +export function catalogueAddress( + base: string, + { + query, + sort, + filters + }: { + query: string + sort: SortOrder + filters: Readonly> + } +): string { + const params = new URLSearchParams(base) + for (const key of ['q', ...Object.keys(filters), 'sort', 'p', 'cursor']) + params.delete(key) + if (query) params.set('q', query) + for (const [key, values] of Object.entries(filters)) + for (const value of values) params.append(key, value) + if (sort !== 'popular') params.set('sort', sort) + return params.toString() +} + export function parseCatalogSearch(search: string): ParsedCatalogLocation { const params = new URLSearchParams(search) const useCase = params.get('useCase') From ecd3137f8253463616ea843b4a2dfcc75813d1fd Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Wed, 21 Oct 2026 22:00:24 +0530 Subject: [PATCH 4/9] fix(website): track, trim and dedupe the workflow list capability The workflow list now reports a capability change as a hub_filter_changed event with the new capability filter. It trims each capability from the URL, drops blank values and shows a repeated value one time. The list writes its URL with catalogueAddress. --- .../WorkflowCatalogue.analytics.test.ts | 32 ++++++++++++++ .../workshop/WorkflowCatalogue.test.ts | 24 +++++++++++ .../components/workshop/WorkflowCatalogue.vue | 43 ++++++++----------- .../website/src/scripts/workshop-analytics.ts | 8 +++- 4 files changed, 81 insertions(+), 26 deletions(-) diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.analytics.test.ts b/apps/website/src/components/workshop/WorkflowCatalogue.analytics.test.ts index 5b897acb05b..aaad73dbf67 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.analytics.test.ts +++ b/apps/website/src/components/workshop/WorkflowCatalogue.analytics.test.ts @@ -110,6 +110,38 @@ describe('WorkflowCatalogue analytics', () => { ]) }) + it('reports a capability the visitor removes but not the one a shared link sets', async () => { + history.replaceState(null, '', '/hub/workflows/?capability=Upscale') + const user = userEvent.setup() + render(WorkflowCatalogue, { + props: { + models: [ + { ...models[0], capabilities: ['Upscale'] }, + ...models.slice(1) + ] + } + }) + const remove = await screen.findByRole('button', { + name: 'Remove Upscale' + }) + vi.advanceTimersByTime(SEARCH_SETTLE_MS) + expect(captureWorkshopEvent).not.toHaveBeenCalled() + + await user.click(remove) + + expect(events('hub_filter_changed')).toEqual([ + { + name: 'hub_filter_changed', + properties: { + surface: 'workflows', + filter: 'capability', + value: 'all', + previous_value: 'Upscale' + } + } + ]) + }) + it('reports a workflow opened from the featured banner', async () => { const user = userEvent.setup() const highlighted = models.map((model) => ({ diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.test.ts b/apps/website/src/components/workshop/WorkflowCatalogue.test.ts index 006e76fbdb7..2aa14b7f9e4 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.test.ts +++ b/apps/website/src/components/workshop/WorkflowCatalogue.test.ts @@ -348,6 +348,30 @@ describe('workflow catalogue capability address on the server-filtered list', () ) }) + it('trims, drops blank and merges repeated capabilities from the address', async () => { + const user = userEvent.setup() + const { emitted } = render(WorkflowCatalogue, { + props: { + models: [models[1]], + initialSearch: '?capability=+&capability=+b+&capability=b', + serverPage, + serverFacets + } + }) + await waitFor(() => + expect(screen.getAllByRole('button', { name: /^Remove / })).toHaveLength( + 1 + ) + ) + expect(screen.getByRole('button', { name: 'Remove b' })).toBeInTheDocument() + + await user.click(screen.getByTestId('workshop-sort')) + await user.click(screen.getByTestId('sort-name')) + await waitFor(() => + expect(emitted('search').at(-1)).toEqual(['capability=b&sort=name']) + ) + }) + it('shows the empty result for a capability the server does not know, and clears it', async () => { const user = userEvent.setup() const { emitted } = render(WorkflowCatalogue, { diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.vue b/apps/website/src/components/workshop/WorkflowCatalogue.vue index 7234affd6f3..0a2eecf2e4e 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.vue +++ b/apps/website/src/components/workshop/WorkflowCatalogue.vue @@ -18,7 +18,7 @@ import type { WorkflowWorkshopModel, WorkshopModel } from '@/config/models-catalogue' -import { sortWorkshopModels } from '@/config/models-catalogue' +import { catalogueAddress, sortWorkshopModels } from '@/config/models-catalogue' import { searchWorkshopModels } from '@/config/models-search' import type { CatalogListPages, @@ -86,6 +86,7 @@ const { submitSearch, quietly } = useHubCatalogueTracking('workflows', { filters: [ ['category', () => selected.value], ['model', () => runsOn.value], + ['capability', () => capabilities.value], ['sort', () => sort.value] ] }) @@ -124,34 +125,26 @@ function readAddress(search: string, preserveQuery = false) { ? serverFacets.models.some((model) => model.value === name) : models.some((model) => model.models?.includes(name)) ) - capabilities.value = params - .getAll('capability') - .filter((value) => - serverPage - ? value.trim() - : models.some((model) => model.capabilities.includes(value)) - ) + capabilities.value = [ + ...new Set(params.getAll('capability').map((value) => value.trim())) + ].filter((value) => + serverPage + ? value + : models.some((model) => model.capabilities.includes(value)) + ) if (serverPage) sort.value = params.get('sort') === 'name' ? 'name' : 'popular' } function filterAddress() { - const params = new URLSearchParams(initialSearch ?? location.search) - for (const key of [ - 'q', - 'category', - 'model', - 'capability', - 'sort', - 'p', - 'cursor' - ]) - params.delete(key) - if (query.value) params.set('q', query.value) - for (const value of selected.value) params.append('category', value) - for (const value of runsOn.value) params.append('model', value) - for (const value of capabilities.value) params.append('capability', value) - if (sort.value !== 'popular') params.set('sort', sort.value) - return params.toString() + return catalogueAddress(initialSearch ?? location.search, { + query: query.value, + sort: sort.value, + filters: { + category: selected.value, + model: runsOn.value, + capability: capabilities.value + } + }) } let searchReady = false let requestedQuery: string | undefined diff --git a/apps/website/src/scripts/workshop-analytics.ts b/apps/website/src/scripts/workshop-analytics.ts index 76a137f0ea5..b81047e9c12 100644 --- a/apps/website/src/scripts/workshop-analytics.ts +++ b/apps/website/src/scripts/workshop-analytics.ts @@ -54,7 +54,13 @@ export type HubItemSource = | 'app_row' | 'results_grid' -export type HubFilter = 'catalogue' | 'use_case' | 'category' | 'model' | 'sort' +export type HubFilter = + | 'catalogue' + | 'use_case' + | 'category' + | 'model' + | 'capability' + | 'sort' export type WorkshopCheckoutFailureStage = 'balance' | 'credential' | 'checkout' From ccfd08b6724e24e4685c41035ad552c59c14014c Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Thu, 22 Oct 2026 10:08:06 +0530 Subject: [PATCH 5/9] test: server catalog load sends capability trimmed, once and never blank --- apps/website/src/lib/cms/catalog-list.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/website/src/lib/cms/catalog-list.test.ts b/apps/website/src/lib/cms/catalog-list.test.ts index a6475783bde..16ddf0bc89d 100644 --- a/apps/website/src/lib/cms/catalog-list.test.ts +++ b/apps/website/src/lib/cms/catalog-list.test.ts @@ -127,6 +127,19 @@ describe('bounded website catalog transport', () => { } ) + it('sends each capability from the address trimmed, once and never blank', async () => { + const upstream = setup() + const result = await loadSiteCatalogList( + undefined, + 'en', + 'workflows', + new URLSearchParams('capability=+&capability=+b+&capability=b') + ) + assert.isTrue(result.ok) + const url = new URL(String(upstream.mock.calls[0][0])) + expect(url.searchParams.getAll('capability')).toEqual(['b']) + }) + it('keeps authored details out of the serialized card model', async () => { const response = page() Object.assign(response.items[0].data, { From de91d99b694734b45ab40016c0ff6c72acd725c2 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Thu, 22 Oct 2026 10:20:38 +0530 Subject: [PATCH 6/9] fix: trim, dedupe and drop blank capability values before the server catalog fetch --- apps/website/src/config/models-catalogue.ts | 11 +++++++++++ apps/website/src/lib/cms/catalog-list.ts | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/website/src/config/models-catalogue.ts b/apps/website/src/config/models-catalogue.ts index d9721fd4445..6edbd9451c2 100644 --- a/apps/website/src/config/models-catalogue.ts +++ b/apps/website/src/config/models-catalogue.ts @@ -459,6 +459,17 @@ export function catalogSearch(filter: CatalogLocation): string { return search ? `?${search}` : '' } +export function addressCapabilities(params: URLSearchParams): string[] { + return [ + ...new Set( + params + .getAll('capability') + .map((value) => value.trim()) + .filter(Boolean) + ) + ] +} + export function catalogueAddress( base: string, { diff --git a/apps/website/src/lib/cms/catalog-list.ts b/apps/website/src/lib/cms/catalog-list.ts index ee5587ab1c4..262613e97be 100644 --- a/apps/website/src/lib/cms/catalog-list.ts +++ b/apps/website/src/lib/cms/catalog-list.ts @@ -4,7 +4,7 @@ import type { } from '@comfyorg/ingest-types' import { zListCccWebsiteCardsQuery } from '@comfyorg/ingest-types/zod' -import { USE_CASES } from '@/config/models-catalogue' +import { USE_CASES, addressCapabilities } from '@/config/models-catalogue' import type { UseCase, SortOrder } from '@/config/models-catalogue' import { modelSchema } from '@/config/models-catalogue-data' import { workflowCategoryLabel } from '@/lib/workshop/workflow-category-label' @@ -75,7 +75,7 @@ function cardQuery( ), modality: params.getAll('modality'), provider: params.getAll('provider'), - capability: params.getAll('capability') + capability: addressCapabilities(params) }) } From c3b415a0dd2df7fa66a2a427945312b61cf30cef Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Thu, 22 Oct 2026 10:31:09 +0530 Subject: [PATCH 7/9] fix: read capability from the address only on the CMS workflow list --- .../components/workshop/WorkflowCatalogue.test.ts | 13 ++++++++----- .../src/components/workshop/WorkflowCatalogue.vue | 14 ++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.test.ts b/apps/website/src/components/workshop/WorkflowCatalogue.test.ts index 2aa14b7f9e4..e00addf49df 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.test.ts +++ b/apps/website/src/components/workshop/WorkflowCatalogue.test.ts @@ -279,11 +279,11 @@ describe('workflow catalogue ordering and shared links', () => { ]) }) - it('restores a known capability from a shared URL and drops one no workflow has', async () => { + it('ignores capability on the static list and keeps the other filters', async () => { history.replaceState( null, '', - '/hub/workflows/?capability=Upscale&capability=Unknown' + '/hub/workflows/?capability=Upscale&model=SeedVR2' ) render(WorkflowCatalogue, { props: { @@ -295,13 +295,16 @@ describe('workflow catalogue ordering and shared links', () => { }) await waitFor(() => expect(screen.getByTestId('workshop-filter-chips')).toHaveTextContent( - 'Upscale' + 'SeedVR2' ) ) expect(screen.getByTestId('workshop-filter-chips')).not.toHaveTextContent( - 'Unknown' + 'Upscale' ) - expect(visibleOutcomes()).toEqual(['/models/workflows/restore/']) + expect(visibleOutcomes()).toEqual([ + '/models/workflows/connect/', + '/models/workflows/restore/' + ]) }) }) diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.vue b/apps/website/src/components/workshop/WorkflowCatalogue.vue index 0a2eecf2e4e..5863ad1de5d 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.vue +++ b/apps/website/src/components/workshop/WorkflowCatalogue.vue @@ -18,7 +18,11 @@ import type { WorkflowWorkshopModel, WorkshopModel } from '@/config/models-catalogue' -import { catalogueAddress, sortWorkshopModels } from '@/config/models-catalogue' +import { + addressCapabilities, + catalogueAddress, + sortWorkshopModels +} from '@/config/models-catalogue' import { searchWorkshopModels } from '@/config/models-search' import type { CatalogListPages, @@ -125,13 +129,7 @@ function readAddress(search: string, preserveQuery = false) { ? serverFacets.models.some((model) => model.value === name) : models.some((model) => model.models?.includes(name)) ) - capabilities.value = [ - ...new Set(params.getAll('capability').map((value) => value.trim())) - ].filter((value) => - serverPage - ? value - : models.some((model) => model.capabilities.includes(value)) - ) + capabilities.value = serverPage ? addressCapabilities(params) : [] if (serverPage) sort.value = params.get('sort') === 'name' ? 'name' : 'popular' } From 4670bdbbecfa62e4cb0565431eebf901d36b50d8 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Thu, 22 Oct 2026 10:45:18 +0530 Subject: [PATCH 8/9] refactor: name the model chip kind and document catalogueAddress --- apps/website/src/components/workshop/WorkflowCatalogue.vue | 3 ++- apps/website/src/config/models-catalogue.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.vue b/apps/website/src/components/workshop/WorkflowCatalogue.vue index 5863ad1de5d..56b715c533d 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.vue +++ b/apps/website/src/components/workshop/WorkflowCatalogue.vue @@ -313,7 +313,8 @@ function removeChip(key: string) { selected.value = selected.value.filter((id) => id !== value) else if (kind === 'capability') capabilities.value = capabilities.value.filter((name) => name !== value) - else runsOn.value = runsOn.value.filter((name) => name !== value) + else if (kind === 'model') + runsOn.value = runsOn.value.filter((name) => name !== value) } function clearFilters() { diff --git a/apps/website/src/config/models-catalogue.ts b/apps/website/src/config/models-catalogue.ts index 6edbd9451c2..32a16e159bb 100644 --- a/apps/website/src/config/models-catalogue.ts +++ b/apps/website/src/config/models-catalogue.ts @@ -470,6 +470,11 @@ export function addressCapabilities(params: URLSearchParams): string[] { ] } +/** + * Rewrites the filters in `base` and drops `p` and `cursor`. Unlike + * `catalogSearch`, it returns no leading `?`. Callers compare the result to + * the current search as a string, so the key order of `filters` matters. + */ export function catalogueAddress( base: string, { From 9e7e9bde97488c7d391b3ae1b7efe7f9318f0326 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Thu, 22 Oct 2026 11:04:59 +0530 Subject: [PATCH 9/9] test: report a removed capability on the server-filtered workflow list --- .../workshop/WorkflowCatalogue.analytics.test.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/website/src/components/workshop/WorkflowCatalogue.analytics.test.ts b/apps/website/src/components/workshop/WorkflowCatalogue.analytics.test.ts index aaad73dbf67..d438154fa91 100644 --- a/apps/website/src/components/workshop/WorkflowCatalogue.analytics.test.ts +++ b/apps/website/src/components/workshop/WorkflowCatalogue.analytics.test.ts @@ -111,14 +111,20 @@ describe('WorkflowCatalogue analytics', () => { }) it('reports a capability the visitor removes but not the one a shared link sets', async () => { - history.replaceState(null, '', '/hub/workflows/?capability=Upscale') const user = userEvent.setup() render(WorkflowCatalogue, { props: { - models: [ - { ...models[0], capabilities: ['Upscale'] }, - ...models.slice(1) - ] + models: [{ ...models[0], capabilities: ['Upscale'] }], + initialSearch: '?capability=Upscale', + serverPage: { + mode: 'cursor', + page: 1, + pageSize: 24, + count: 1, + hasPrevious: false, + hasNext: false + }, + serverFacets: { categories: [], models: [] } } }) const remove = await screen.findByRole('button', {