From c8a3219e0e570785a43cea89aecb9b3a707ddbd5 Mon Sep 17 00:00:00 2001 From: Sadeq Abu-Hattem Date: Fri, 20 Nov 2026 00:14:14 +0200 Subject: [PATCH] Draw dropdowns' shown value from the selection, so it follows the language Reka's SelectValue copies the chosen option's text when it first draws and keeps it, so after a language switch four dropdowns went on showing the old language: the Audit entity filter, the Media type and sort filters, the language direction, and the product editor's category (category names are content, read again in the new language). Each now renders its value from the model, as the product category filter and the language picker already did. An e2e test switches to Arabic with the Audit entity filter on screen; it fails on the old code and passes now. Co-Authored-By: Claude Opus 5.5 --- clients/dashboard/app/components/ProductEditor.vue | 5 ++++- clients/dashboard/app/components/audit/Filters.vue | 3 ++- .../dashboard/app/components/languages/FormModal.vue | 3 ++- clients/dashboard/app/components/media/Filters.vue | 5 +++-- clients/dashboard/test/e2e/smoke.e2e.ts | 12 ++++++++++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/clients/dashboard/app/components/ProductEditor.vue b/clients/dashboard/app/components/ProductEditor.vue index 4229cb4..f68fcaf 100644 --- a/clients/dashboard/app/components/ProductEditor.vue +++ b/clients/dashboard/app/components/ProductEditor.vue @@ -162,7 +162,10 @@ async function save() { - + + {{ directions.find(item => item.value === state.direction)?.label }} diff --git a/clients/dashboard/app/components/media/Filters.vue b/clients/dashboard/app/components/media/Filters.vue index 775ede8..30673aa 100644 --- a/clients/dashboard/app/components/media/Filters.vue +++ b/clients/dashboard/app/components/media/Filters.vue @@ -135,7 +135,8 @@ function onSort(value: SortValue) { - + {{ sorts.find(item => item.value === sort)?.label }} diff --git a/clients/dashboard/test/e2e/smoke.e2e.ts b/clients/dashboard/test/e2e/smoke.e2e.ts index 3fb0fd9..359f1de 100644 --- a/clients/dashboard/test/e2e/smoke.e2e.ts +++ b/clients/dashboard/test/e2e/smoke.e2e.ts @@ -118,6 +118,18 @@ test('Arabic turns the page right-to-left', async ({ page, goto }) => { await expect(heading(page)).toHaveText('نظرة عامة') }) +test('a filter on screen follows the language, rather than keeping the words it was drawn in', async ({ page, goto }) => { + await goto('/audit') + + await expect(page.getByRole('combobox', { name: 'Entity' })).toHaveText('Any entity') + + await page.getByRole('combobox', { name: 'Reading language' }).click() + await page.getByRole('option', { name: /العربية/ }).click() + + // A select copies its chosen option's text when it is drawn; this one is drawn from its value. + await expect(page.getByRole('combobox', { name: 'الكيان' })).toHaveText('أي كيان') +}) + test('a media entry shows its operation beside the action', async ({ page, goto }) => { await goto('/audit')