From 9ad9440b0faf4547fca37be8ea74f9f9558de445 Mon Sep 17 00:00:00 2001 From: auto-bot Date: Mon, 20 Oct 2025 16:03:29 +0200 Subject: [PATCH] fix: resolve script filtering count discrepancy - Map 'turnkey' script type to 'ct' category in filtering logic - Fixes issue where filtering by all 4 types showed 398/399 instead of 399/399 - Applied to both DownloadedScriptsTab and ScriptsGrid components - TurnKey script is LXC-related so mapping to 'ct' is appropriate --- src/app/_components/DownloadedScriptsTab.tsx | 6 +++++- src/app/_components/ScriptsGrid.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/_components/DownloadedScriptsTab.tsx b/src/app/_components/DownloadedScriptsTab.tsx index 24069f9..1d2f64c 100644 --- a/src/app/_components/DownloadedScriptsTab.tsx +++ b/src/app/_components/DownloadedScriptsTab.tsx @@ -275,7 +275,11 @@ export function DownloadedScriptsTab({ onInstallScript }: DownloadedScriptsTabPr scripts = scripts.filter(script => { if (!script) return false; const scriptType = (script.type ?? '').toLowerCase(); - return filters.selectedTypes.some(type => type.toLowerCase() === scriptType); + + // Map non-standard types to standard categories + const mappedType = scriptType === 'turnkey' ? 'ct' : scriptType; + + return filters.selectedTypes.some(type => type.toLowerCase() === mappedType); }); } diff --git a/src/app/_components/ScriptsGrid.tsx b/src/app/_components/ScriptsGrid.tsx index bfeb3ef..5d82e70 100644 --- a/src/app/_components/ScriptsGrid.tsx +++ b/src/app/_components/ScriptsGrid.tsx @@ -303,7 +303,11 @@ export function ScriptsGrid({ onInstallScript }: ScriptsGridProps) { scripts = scripts.filter(script => { if (!script) return false; const scriptType = (script.type ?? '').toLowerCase(); - return filters.selectedTypes.some(type => type.toLowerCase() === scriptType); + + // Map non-standard types to standard categories + const mappedType = scriptType === 'turnkey' ? 'ct' : scriptType; + + return filters.selectedTypes.some(type => type.toLowerCase() === mappedType); }); }