feat(glossary): restructure page with tabs, direct translate redirects and dynamic mapping
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m39s

This commit is contained in:
2026-06-20 18:43:02 +02:00
parent c17dd2c6e1
commit d78f08e24f
2 changed files with 394 additions and 304 deletions

View File

@@ -83,9 +83,30 @@ export function useTranslationConfig(hasFile: boolean): UseTranslationConfigRetu
// Reset glossary selection when source language changes
// (multilingual glossaries are compatible with any target language)
useEffect(() => {
// If there is a query param, do not reset it on first load
const params = new URLSearchParams(typeof window !== 'undefined' ? window.location.search : '');
if (params.get('glossaryId') === glossaryId) return;
setGlossaryId(null);
}, [sourceLang]); // eslint-disable-line react-hooks/exhaustive-deps
// Pre-select glossary and LLM provider from query parameter
useEffect(() => {
if (typeof window === 'undefined' || isLoadingProviders || availableProviders.length === 0) return;
const params = new URLSearchParams(window.location.search);
const qGlossaryId = params.get('glossaryId');
if (qGlossaryId) {
setGlossaryId(qGlossaryId);
const p = availableProviders.find((ap) => ap.id === provider);
if (!p || p.mode !== 'llm') {
const firstLlm = availableProviders.find((ap) => ap.mode === 'llm');
if (firstLlm) {
setProvider(firstLlm.id);
}
}
}
}, [isLoadingProviders, availableProviders, provider]);
// Fetch available (admin-configured) providers
useEffect(() => {
const controller = new AbortController();