From e42248afa40662c839e26c2566ac87719d091ee0 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Thu, 29 Oct 2026 17:44:37 -0700 Subject: [PATCH] fix(images): a category or tags chosen in Show removed images ends the view (#498 review) The toolbar's Category and Refine's Tags stayed usable in the removed view, and the listing then refused the combination with a page error. Choosing one now leaves the view, as a removed file has neither. --- TESTING.md | 3 ++- tests/browser/workspace-images-removed.spec.mjs | 12 ++++++++++++ web/js/workspace/images.mjs | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/TESTING.md b/TESTING.md index 9b2c292b..6e6fa152 100644 --- a/TESTING.md +++ b/TESTING.md @@ -2498,7 +2498,8 @@ files to the system trash. **No code path unlinks or overwrites a media file.** removed=1`, refused with `favorites`, `collection`, `category`, `tags` or `sort=rating`; a cursor never crosses views) lists only files a removal mark hides, each card with a "Removed" `.chip` and without the star or Tag action; the caption reads "N removed images · files on disk, hidden from Images", the empty view "No removed images." / - "No removed images match.". Entering clears Category and Tags. A card's image and Info both inspect (the viewer is + "No removed images match.". Entering clears Category and Tags; choosing a category or tags while it is on + (toolbar, Refine this view) ends the view. A card's image and Info both inspect (the viewer is not opened: its Collections… and Delete… would write); the panel shows Return to library in Delete…'s place and no Collections… or tag-filter chips. The bar reads "N selected", Return to library, Clear. The view is never saved or restored: leaving the page, Browse or a saved view ends it, and a return that leaves N = 0 ends it too. diff --git a/tests/browser/workspace-images-removed.spec.mjs b/tests/browser/workspace-images-removed.spec.mjs index 5fd204f3..c1ed410b 100644 --- a/tests/browser/workspace-images-removed.spec.mjs +++ b/tests/browser/workspace-images-removed.spec.mjs @@ -129,3 +129,15 @@ test('the removed view is never saved and ends when the page is left', async ({ await expect(toggle(page)).toHaveAttribute('aria-pressed', 'false'); await expect(page.locator('#result-count')).not.toContainText('removed'); }); + +test('choosing a category in the removed view ends the view and lists the category', async ({ page }) => { + await openImages(page); + await removeFromLibrary(page, 1); + await toggle(page).click(); + await expect(toggle(page)).toHaveAttribute('aria-pressed', 'true'); + await page.getByRole('combobox', { name: 'Filter by category', exact: true }).selectOption('Landscapes'); + // A removed file has no category: the view ends instead of refusing the listing. + await expect(toggle(page)).toHaveAttribute('aria-pressed', 'false'); + await expect(page.locator(CARDS).first()).toBeVisible(); + await expect(page.locator('#result-count')).not.toContainText('removed'); +}); diff --git a/web/js/workspace/images.mjs b/web/js/workspace/images.mjs index a46da282..354a7895 100644 --- a/web/js/workspace/images.mjs +++ b/web/js/workspace/images.mjs @@ -722,6 +722,8 @@ export function mountImages(main, api, parentScope, {embedded = false, fetchPage if (savedScopePending && !discoverySettled) { updateScope(); return; } settleSavedScope(); updateScope(); + // #498: a removed file has no category or tags, so choosing one (toolbar, Refine, a tag chip) ends the view. + if (filters.removed && (filters.category || filters.tags.length)) filters.removed = false; stream.reset(filters, {load:!recovering}); } /** A saved view's Source and Folder apply only while the discovered sources still list them (#249 D16). */