From 42a9b9c459506e0903042f1d6703b879a122051c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Karaaslan?= Date: Tue, 15 Sep 2026 13:01:46 +0300 Subject: [PATCH 1/3] fix(web): make memory count tag-aware --- web/src/lib/memory-count.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/lib/memory-count.ts b/web/src/lib/memory-count.ts index 0cd15f2a..a0833330 100644 --- a/web/src/lib/memory-count.ts +++ b/web/src/lib/memory-count.ts @@ -1,7 +1,8 @@ export function getDisplayedMemoryCount( isSearching: boolean, - searchTotal: number, + tagFilterActive: boolean, + resultTotal: number, storeTotal: number ): number { - return isSearching ? searchTotal : storeTotal; + return isSearching || tagFilterActive ? resultTotal : storeTotal; } From 3c596c83fd00347933ae40af8d1ce879863ad0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Karaaslan?= Date: Tue, 15 Sep 2026 13:01:57 +0300 Subject: [PATCH 2/3] test(web): cover tag-filtered memory count --- tests/memory-count.test.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/memory-count.test.ts b/tests/memory-count.test.ts index 67e8a953..b2c83d3e 100644 --- a/tests/memory-count.test.ts +++ b/tests/memory-count.test.ts @@ -3,11 +3,16 @@ import { getDisplayedMemoryCount } from "../web/src/lib/memory-count"; describe("getDisplayedMemoryCount", () => { test("shows matched results while search is active", () => { - expect(getDisplayedMemoryCount(true, 3, 120)).toBe(3); - expect(getDisplayedMemoryCount(true, 0, 120)).toBe(0); + expect(getDisplayedMemoryCount(true, false, 3, 120)).toBe(3); + expect(getDisplayedMemoryCount(true, false, 0, 120)).toBe(0); }); - test("restores the store total when search is cleared", () => { - expect(getDisplayedMemoryCount(false, 3, 120)).toBe(120); + test("shows filtered results while a tag filter is active", () => { + expect(getDisplayedMemoryCount(false, true, 3, 120)).toBe(3); + expect(getDisplayedMemoryCount(false, true, 0, 120)).toBe(0); + }); + + test("restores the store total when search and tag filter are cleared", () => { + expect(getDisplayedMemoryCount(false, false, 3, 120)).toBe(120); }); }); From c95a0f4eae2f8fb7083b90a009e5c21d8e6307b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Karaaslan?= Date: Tue, 15 Sep 2026 13:02:47 +0300 Subject: [PATCH 3/3] fix(web): use filtered total for active tag --- web/src/App.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/App.tsx b/web/src/App.tsx index 0cf37a3b..5d5fa2c0 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -147,6 +147,7 @@ export default function App() { {t("text-total", { count: getDisplayedMemoryCount( explorer.isSearching, + explorer.selectedTag !== "", explorer.totalItems, explorer.statsTotal ),