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.
This commit is contained in:
Vito Sansevero
2026-10-29 17:44:37 -07:00
parent be1fea17f0
commit e42248afa4
3 changed files with 16 additions and 1 deletions
+2 -1
View File
@@ -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.
@@ -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');
});
+2
View File
@@ -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). */