From 2c5309e0d6a5bebb97d9cd1237f078d764f8ae7e Mon Sep 17 00:00:00 2001 From: aGallea Date: Mon, 30 Mar 2026 15:12:13 +0300 Subject: [PATCH 1/2] fix(frontend): remove duplicated plot sidebar labels Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- frontend/e2e/search.spec.ts | 39 +++++++++++++++++++ frontend/src/components/plot/PlotControls.tsx | 5 +-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/frontend/e2e/search.spec.ts b/frontend/e2e/search.spec.ts index c2c7f30..2eab99f 100644 --- a/frontend/e2e/search.spec.ts +++ b/frontend/e2e/search.spec.ts @@ -208,3 +208,42 @@ test.describe('Semantic Search', () => { }) }) + +test.describe('Plot Sidebar', () => { + test('plot sidebar does not duplicate visible labels', async ({ page }) => { + // Mock the API calls so we don't need real ChromaDB data + await page.route('**/api/collections', async route => { + await route.fulfill({ json: [{ name: 'fashionimageUrl', count: 100 }] }) + }) + await page.route('**/api/collections/fashionimageUrl', async route => { + await route.fulfill({ + json: { name: 'fashionimageUrl', count: 100, metadata_fields: ['productDisplayName', 'imageUrl'] } + }) + }) + + // Navigate with collection param + await page.goto('/plot?collection=fashionimageUrl') + + // Wait for the collection dropdown to be populated with options + await expect( + page.locator('select option:not([value=""])').first() + ).toBeAttached({ timeout: 10_000 }) + + const sidebar = page.getByTestId('plot-sidebar') + + await expect(sidebar.getByRole('button', { name: 'Collection', exact: true })).toBeVisible({ timeout: 5_000 }) + + const displayFieldsBtn = sidebar.getByRole('button', { name: 'Display Fields', exact: true }) + const imageFieldBtn = sidebar.getByRole('button', { name: 'Image Field', exact: true }) + + await displayFieldsBtn.click() + await imageFieldBtn.click() + + await expect(sidebar.locator('label').filter({ hasText: /^Collection$/ })).toHaveCount(0) + await expect(sidebar.locator('label').filter({ hasText: /^Display Fields$/ })).toHaveCount(0) + await expect(sidebar.locator('label').filter({ hasText: /^Image Field$/ })).toHaveCount(0) + + await expect(sidebar.getByRole('combobox', { name: 'Collection' })).toBeVisible() + await expect(sidebar.getByRole('combobox', { name: 'Image Field' })).toBeVisible() + }) +}) diff --git a/frontend/src/components/plot/PlotControls.tsx b/frontend/src/components/plot/PlotControls.tsx index b4bea7a..74b1e17 100644 --- a/frontend/src/components/plot/PlotControls.tsx +++ b/frontend/src/components/plot/PlotControls.tsx @@ -130,8 +130,8 @@ export default function PlotControls({ onCompute, isComputing }: PlotControlsPro {/* Collection Selection */}
- setImageField(e.target.value)} From 26dd726cf2d2ce568910271612d518dca4ae00d5 Mon Sep 17 00:00:00 2001 From: aGallea Date: Mon, 30 Mar 2026 15:19:09 +0300 Subject: [PATCH 2/2] fix(frontend): remove remaining duplicated sidebar labels --- frontend/src/components/plot/PlotControls.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/plot/PlotControls.tsx b/frontend/src/components/plot/PlotControls.tsx index 74b1e17..c02d164 100644 --- a/frontend/src/components/plot/PlotControls.tsx +++ b/frontend/src/components/plot/PlotControls.tsx @@ -174,9 +174,6 @@ export default function PlotControls({ onCompute, isComputing }: PlotControlsPro {/* Reduction Algorithm */}
-
{(['tsne', 'umap', 'pca'] as const).map((algo) => (