From 67a28664a96a5e14f24a35df10c24daf87a4c624 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Wed, 1 Apr 2026 06:01:58 +0000 Subject: [PATCH] feat: default script library to 'All Scripts' tab showing all accessible scripts Added 'All Scripts' as the first/default tab (no mine/shared filter) so the page opens with every script the user can access. My Scripts and Team Scripts tabs remain for filtered views. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/pages/ScriptLibraryPage.tsx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/ScriptLibraryPage.tsx b/frontend/src/pages/ScriptLibraryPage.tsx index 21ee359e..04ce5c39 100644 --- a/frontend/src/pages/ScriptLibraryPage.tsx +++ b/frontend/src/pages/ScriptLibraryPage.tsx @@ -11,13 +11,13 @@ import { ParameterizeAndSavePanel } from '@/components/scripts/ParameterizeAndSa import { scriptsApi } from '@/api' import type { ScriptParameter } from '@/types' -type LibraryTab = 'mine' | 'team' +type LibraryTab = 'all' | 'mine' | 'team' export default function ScriptLibraryPage() { const [paneMode, setPaneMode] = useState<'browse' | 'configure'>('browse') // inputValue owned here so it survives Configure ↔ Browse transitions const [inputValue, setInputValue] = useState('') - const [activeTab, setActiveTab] = useState('mine') + const [activeTab, setActiveTab] = useState('all') const loadCategories = useScriptGeneratorStore(s => s.loadCategories) const loadTemplates = useScriptGeneratorStore(s => s.loadTemplates) @@ -52,13 +52,19 @@ export default function ScriptLibraryPage() { parameters_schema: payload.parameters_schema, }) setShowImportPanel(false) - const filters = activeTab === 'mine' ? { mine: true } : { shared: true } + const filters = + activeTab === 'mine' ? { mine: true } : + activeTab === 'team' ? { shared: true } : + {} loadTemplates(filters) } useEffect(() => { loadCategories().then(() => { - const filters = activeTab === 'mine' ? { mine: true } : { shared: true } + const filters = + activeTab === 'mine' ? { mine: true } : + activeTab === 'team' ? { shared: true } : + {} loadTemplates(filters) }) }, [loadCategories, loadTemplates, activeTab]) @@ -132,6 +138,13 @@ export default function ScriptLibraryPage() { {/* Tab bar */}
+