fix: DKC/CTL/ENC попадали в Other при режиме server

ASSIGNED_CATEGORIES пересобирался из отфильтрованного tab.categories,
поэтому категории скрытые для текущего типа конфигурации переставали
считаться «назначенными» и уходили в Other. Теперь используется
tab._allCategories (полный статический список) — категория принадлежит
вкладке независимо от видимости в текущем режиме.

Также убрал лишний .toUpperCase() в updateTabVisibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-06-26 10:29:32 +03:00
parent f70cc680f7
commit bb742d2f38

View File

@@ -1309,9 +1309,10 @@ function applyConfigTypeToTabs() {
}
});
// Rebuild assigned categories index
// Rebuild assigned categories index using the full static list (_allCategories),
// not the filtered one — hidden categories still belong to their tab, not to Other.
ASSIGNED_CATEGORIES = Object.values(TAB_CONFIG)
.flatMap(t => t.categories)
.flatMap(t => t._allCategories || t.categories)
.map(c => ciStr(c));
}
@@ -1323,8 +1324,7 @@ function updateTabVisibility() {
if (!btn) continue;
const hasComponents = getComponentsForTab(tabId).length > 0;
const hasCartItems = cart.some(item => {
const cat = (item.category || '').toUpperCase();
return getTabForCategory(cat) === tabId;
return getTabForCategory(item.category) === tabId;
});
const visible = hasComponents || hasCartItems;
btn.classList.toggle('hidden', !visible);