From a7eccbf6e8da81b669310d67c9ce9776ecc2c5ee Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 17 Mar 2026 14:25:10 +0100 Subject: [PATCH] fix: restore repository_url as optional in ScriptCard, remove dead repo filters --- src/app/_components/DownloadedScriptsTab.tsx | 16 ---------------- src/app/_components/ScriptsGrid.tsx | 16 ---------------- src/types/script.ts | 2 ++ 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/src/app/_components/DownloadedScriptsTab.tsx b/src/app/_components/DownloadedScriptsTab.tsx index 78d3de4..3a38020 100644 --- a/src/app/_components/DownloadedScriptsTab.tsx +++ b/src/app/_components/DownloadedScriptsTab.tsx @@ -346,22 +346,6 @@ export function DownloadedScriptsTab({ }); } - // Filter by repositories - if (filters.selectedRepositories.length > 0) { - scripts = scripts.filter((script) => { - if (!script) return false; - const repoUrl = script.repository_url; - - // If script has no repository_url, exclude it when filtering by repositories - if (!repoUrl) { - return false; - } - - // Only include scripts from selected repositories - return filters.selectedRepositories.includes(repoUrl); - }); - } - // Apply sorting scripts.sort((a, b) => { if (!a || !b) return 0; diff --git a/src/app/_components/ScriptsGrid.tsx b/src/app/_components/ScriptsGrid.tsx index 1b95c53..071e823 100644 --- a/src/app/_components/ScriptsGrid.tsx +++ b/src/app/_components/ScriptsGrid.tsx @@ -344,22 +344,6 @@ export function ScriptsGrid({ onInstallScript }: ScriptsGridProps) { }); } - // Filter by repositories - if (filters.selectedRepositories.length > 0) { - scripts = scripts.filter((script) => { - if (!script) return false; - const repoUrl = script.repository_url; - - // If script has no repository_url, exclude it when filtering by repositories - if (!repoUrl) { - return false; - } - - // Only include scripts from selected repositories - return filters.selectedRepositories.includes(repoUrl); - }); - } - // Exclude newest scripts from main grid when no filters are active (they'll be shown in carousel) if (!hasActiveFilters) { const newestScriptSlugs = new Set( diff --git a/src/types/script.ts b/src/types/script.ts index 16a0e53..984e479 100644 --- a/src/types/script.ts +++ b/src/types/script.ts @@ -87,6 +87,8 @@ export interface ScriptCard { * Derived from the script type + slug convention. */ install_basenames?: string[]; + /** Repository URL – optional, only set for user-local JSON scripts. */ + repository_url?: string; is_dev?: boolean; is_disabled?: boolean; is_deleted?: boolean;