Refactor email encryption handling in user and contact message models: Introduce utility functions for encoding and decoding encrypted values, simplifying the encryption process. Update the registerUser and handleForgotPassword functions to support multiple encrypted email formats. Enhance the VocabCourseView and VocabLessonView components with new methods for managing language assistant interactions, improving user experience.

This commit is contained in:
Torsten Schulz (local)
2026-03-25 17:41:10 +01:00
parent 95c9e7c036
commit 09141d9e55
5 changed files with 97 additions and 39 deletions

View File

@@ -31,7 +31,7 @@
<button
v-if="assistantAvailable && currentLesson"
type="button"
@click="openLesson(currentLesson.id)"
@click="openLessonAssistant(currentLesson.id)"
>
{{ $t('socialnetwork.vocab.courses.languageAssistantOpenLesson') }}
</button>
@@ -319,6 +319,9 @@ export default {
openLesson(lessonId) {
this.$router.push(`/socialnetwork/vocab/courses/${this.courseId}/lessons/${lessonId}`);
},
openLessonAssistant(lessonId) {
this.$router.push(`/socialnetwork/vocab/courses/${this.courseId}/lessons/${lessonId}?assistant=1`);
},
editCourse() {
this.$router.push(`/socialnetwork/vocab/courses/${this.courseId}/edit`);
},

View File

@@ -101,7 +101,7 @@
</div>
</div>
<div class="didactic-card language-assistant-card">
<div ref="assistantCard" class="didactic-card language-assistant-card" :class="{ 'language-assistant-card--focused': isAssistantFocused }">
<div class="language-assistant-card__header">
<div>
<h4>{{ $t('socialnetwork.vocab.courses.languageAssistantTitle') }}</h4>
@@ -696,6 +696,7 @@ export default {
assistantInput: '',
assistantError: '',
assistantMode: 'practice',
isAssistantFocused: false,
nextLessonId: null,
showCompletionDialog: false,
showErrorDialog: false,
@@ -979,11 +980,19 @@ export default {
if (tabParam === 'learn') {
this.activeTab = 'learn';
}
if (this.$route.query.assistant) {
this.activeTab = 'learn';
}
try {
const res = await apiClient.get(`/api/vocab/lessons/${this.lessonId}`);
this.lesson = res.data;
debugLog('[VocabLessonView] Geladene Lektion:', this.lesson?.id, this.lesson?.title);
if (this.$route.query.assistant) {
this.$nextTick(() => {
this.focusAssistantCard();
});
}
// Initialisiere mit effectiveExercises (für Review: reviewVocabExercises, sonst: grammarExercises)
this.$nextTick(async () => {
const exercises = this.effectiveExercises;
@@ -1002,6 +1011,17 @@ export default {
this.loading = false;
}
},
focusAssistantCard() {
const target = this.$refs.assistantCard;
if (!target || typeof target.scrollIntoView !== 'function') {
return;
}
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
this.isAssistantFocused = true;
window.setTimeout(() => {
this.isAssistantFocused = false;
}, 2200);
},
async loadAssistantSettings() {
this.assistantLoading = true;
try {
@@ -1793,6 +1813,11 @@ export default {
gap: 14px;
}
.language-assistant-card--focused {
border-color: var(--color-primary-orange);
box-shadow: 0 0 0 3px rgba(248, 162, 43, 0.18);
}
.language-assistant-card__header {
display: flex;
justify-content: space-between;