Merge pull request #6918 from redpersongpt/codex/memory-stale-category

fix(memory): reset category filter when its last entry disappears
This commit is contained in:
Alexandre Teixeira
2026-10-30 19:45:30 +00:00
committed by GitHub
+3 -1
View File
@@ -163,11 +163,13 @@ function buildCategoryChips() {
const container = document.getElementById('memory-category-filters');
if (!container) return;
const cats = new Set(memories.map(m => m.category || 'fact'));
if (activeCategory !== 'all' && !cats.has(activeCategory)) activeCategory = 'all';
// Hide the chip row entirely when there are no memories — no point showing
// an "all" chip with nothing to filter.
if (!memories.length) { container.innerHTML = ''; return; }
const cats = new Set(memories.map(m => m.category || 'fact'));
const sorted = ['all', ...Array.from(cats).sort()];
const counts = memories.reduce((result, memory) => {
const category = memory.category || 'fact';