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 */}
+