From 3114e0ae7f77be4a6b91b67cd30169bfc577f1ba Mon Sep 17 00:00:00 2001 From: Max <33982882+maxboeer@users.noreply.github.com> Date: Mon, 1 Jun 2026 21:23:08 +0200 Subject: [PATCH] Overview should also use calculated equivalent counts --- compcount.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/compcount.lua b/compcount.lua index 06f4ac8..7759fc6 100644 --- a/compcount.lua +++ b/compcount.lua @@ -495,6 +495,17 @@ local function getEquivalentLevelCounts(baseId, pageItems, itemCounts) return equivalentCounts end +local function getEquivalentBaseCounts(baseIds, itemCounts) + local equivalentCounts = {} + + for i = 1, #baseIds do + local baseId = baseIds[i] + equivalentCounts[baseId] = getBaseEquivalentCount(baseId, itemCounts) + end + + return equivalentCounts +end + local function createGlobalCountRefreshJob() ensureChainsLoaded() @@ -1146,7 +1157,7 @@ drawOverview = function() local counts = getGlobalItemCounts() if next(counts) ~= nil then - overviewCachedCounts = counts + overviewCachedCounts = getEquivalentBaseCounts(items, counts) end return overviewCachedCounts @@ -1159,7 +1170,7 @@ drawOverview = function() overviewScrollTargetRow = targetRow end, getEntriesAndCountsFromCache = function() - overviewCachedCounts = getGlobalItemCounts() + overviewCachedCounts = getEquivalentBaseCounts(items, getGlobalItemCounts()) overviewCachedSortedItemIds = sortOverviewItems(overviewCachedCounts) return overviewCachedSortedItemIds, overviewCachedCounts end,