From f145df55d1a300831782c2903a6140b4fb43638e Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Wed, 16 Sep 2026 18:18:03 +0000 Subject: [PATCH 1/2] fix(models): name the filter after what it filters by The catalogue offers one facet, and the sheet hides a lone group's name, so a button reading "Filter" was the only label a reader got and it said nothing about what the filter does. It takes the group's own name while there is only one, and goes back to "Filter" as soon as there are more. The card also gives its title and chips a little more room: at the old gap the two rows read as one block. --- .../components/workshop/WorkshopFilterMenu.test.ts | 2 +- .../src/components/workshop/WorkshopFilterMenu.vue | 14 ++++++++++---- .../src/components/workshop/WorkshopModelCard.vue | 2 +- .../components/workshop/WorkshopModelsGrid.test.ts | 12 ++++++------ 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/apps/website/src/components/workshop/WorkshopFilterMenu.test.ts b/apps/website/src/components/workshop/WorkshopFilterMenu.test.ts index 34f65a2206b..13049025472 100644 --- a/apps/website/src/components/workshop/WorkshopFilterMenu.test.ts +++ b/apps/website/src/components/workshop/WorkshopFilterMenu.test.ts @@ -34,7 +34,7 @@ describe('WorkshopFilterMenu', () => { it('closes on Escape from inside the filter panel and restores trigger focus', async () => { const user = userEvent.setup() mountMenu() - const trigger = screen.getByRole('button', { name: 'Filter' }) + const trigger = screen.getByRole('button', { name: 'Use cases' }) await user.click(trigger) const dialog = await screen.findByRole('dialog') const useCase = within(dialog).getByRole('button', { diff --git a/apps/website/src/components/workshop/WorkshopFilterMenu.vue b/apps/website/src/components/workshop/WorkshopFilterMenu.vue index b760bd45d94..c34b70c8aee 100644 --- a/apps/website/src/components/workshop/WorkshopFilterMenu.vue +++ b/apps/website/src/components/workshop/WorkshopFilterMenu.vue @@ -72,6 +72,12 @@ const selectedCount = computed(() => groups.value.reduce((total, group) => total + group.selected.length, 0) ) +const filterLabel = computed(() => + groups.value.length === 1 + ? groups.value[0].label + : t('workshop.filter.label', locale) +) + function toggle(_facet: string, value: string) { const useCase = useCaseOptions.find((option) => option.value === value)?.value if (!useCase) return @@ -85,7 +91,7 @@ function clearAll() { } const sheetLabels = computed(() => ({ - title: t('workshop.filter.label', locale), + title: filterLabel.value, search: t('workshop.filter.search', locale), noMatches: t('workshop.filter.noMatches', locale), applied: t('workshop.filter.applied', locale), @@ -103,7 +109,7 @@ const sheetLabels = computed(() => ({ type="button" data-testid="workshop-filter" :aria-expanded="open" - :aria-label="t('workshop.filter.label', locale)" + :aria-label="filterLabel" :class=" cn( 'relative inline-flex h-11 cursor-pointer items-center gap-2 rounded-2xl bg-transparency-white-t4 px-4 text-sm font-medium transition-colors outline-none hover:bg-transparency-white-t8 focus-visible:ring-3 focus-visible:ring-primary-comfy-yellow/50 max-sm:size-10 max-sm:justify-center max-sm:rounded-xl max-sm:bg-white/8 max-sm:px-0', @@ -116,7 +122,7 @@ const sheetLabels = computed(() => ({ >