From 9b354befe3223551a2dbadebda92dc53fe73d61f Mon Sep 17 00:00:00 2001 From: sepehr Date: Sat, 20 Jun 2026 19:07:30 +0200 Subject: [PATCH] fix(glossary): hide create section by default when glossaries exist - only shown on demand via toggle button --- .../src/app/dashboard/glossaries/page.tsx | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/dashboard/glossaries/page.tsx b/frontend/src/app/dashboard/glossaries/page.tsx index 48e370e..3c708ed 100644 --- a/frontend/src/app/dashboard/glossaries/page.tsx +++ b/frontend/src/app/dashboard/glossaries/page.tsx @@ -153,6 +153,7 @@ export default function GlossariesPage() { const [searchQuery, setSearchQuery] = useState(''); const [importingPresetId, setImportingPresetId] = useState(null); const [activeTab, setActiveTab] = useState<'glossaries' | 'context'>('glossaries'); + const [showCreateSection, setShowCreateSection] = useState(false); const isPro = user?.tier === 'pro'; const isLoading = isLoadingUser || isLoadingGlossaries; @@ -583,17 +584,41 @@ export default function GlossariesPage() { )} + {/* ── Bouton Ajouter (visible seulement si l'utilisateur a déjà des glossaires) ── */} + {glossaries.length > 0 && !showCreateSection && ( +
+ +
+ )} + {/* ── Section 2 : Créer ou Importer ─────────────────────────── */} + {(glossaries.length === 0 || showCreateSection) && (
-
- -

- {t('glossaries.presets.whatForBold') || 'Créer un nouveau glossaire'} -

+
+
+ +

+ Ajouter un glossaire +

+
+ {showCreateSection && ( + + )}

- {t('glossaries.presets.whatForDesc') || 'Choisissez un modèle professionnel pré-rempli ou importez vos propres termes.'} + Choisissez un modèle professionnel, importez un fichier CSV ou créez manuellement.

@@ -699,6 +724,7 @@ export default function GlossariesPage() {
+ )} )}