PWA Install Prompt:
- Suppress in development (process.env.NODE_ENV === 'development')
- Remember dismissal for 7 days (localStorage 'pwa_prompt_dismissed')
- Delay showing by 30 seconds in production to avoid interrupting users
Onboarding Tour:
- Now respects 'Dont Show Again' checkbox (isDontShowAgain check added)
- 1-second delay before showing (smoother UX)
- Won't appear if user previously checked 'Dont show again'
WebSocket Connection:
- Removed console.log/warn for connect/disconnect/error events
- Increased reconnection delay from 1s to 5s (less spam)
- Reduced reconnection attempts from 10 to 3
- Increased timeout from 10s to 15s
- Errors now silently fail (WebSocket is optional for real-time collaboration)
- Changed notebook editor container from min-h-screen to h-[calc(100vh-8rem)]
This constrains the editor to the available viewport height
- Added overflow-hidden to the container to prevent content spilling
- Fixed page list ScrollArea: max-h-[calc(100vh-350px)] with min-h-0
for proper flex shrinking within the editor
- Added overflow-y-auto to main content area in app-layout
Allows scroll when content exceeds viewport without breaking layout
Access Control:
- AI Studio view checks user role: only SCHOOL_ADMIN, SUPER_ADMIN, TEACHER, VICE_PRINCIPAL
- Students and parents see 'Kein Zugriff' (No Access) message
- AI Studio removed from student navigation
- API routes (/api/ai/snapgen, /api/ai/perchance, /api/ai/lesson-plan, /api/ai/agent) enforce role checks
New Features:
- 'Save to Lesson' dialog in Video and Image generation tabs
- Pick Subject > Topic > Lesson from existing curriculum
- Saves AI video/image URL to SubjectLesson record
- Stores prompt, provider, timestamp, and teacher who generated
- Students will see this content in homework and lesson materials
- AI Lesson Plan API route (/api/ai/lesson-plan)
- AI Agent Chat API route (/api/ai/agent) with context-aware system prompts
- SubjectLesson model: Added aiVideoUrl, aiImageUrl, aiThumbnailUrl, aiPrompt, aiProvider, aiGeneratedAt, aiGeneratedBy
- Homework model: Added aiLessonId, aiVideoUrl, aiImageUrl for linking AI content
Navigation:
- Removed duplicate AI Studio entry from teacher nav
- Removed AI Studio from student nav (students can't access)
Features:
- AI Studio module with 4 tabs: Video Generation, Image Generation, Lesson Plan, AI Agent Chat
- SnapGen AI API integration for video lesson generation (https://api.snapgen.ai/uapi/v1/generate)
- Educational prompt enhancement with subject/topic/language context
- Async polling for video generation status
- Fallback to z-ai-web-dev-sdk if SnapGen not configured
- Perchance AI API integration for image generation (https://perchance.org/text-to-image-plugin)
- Multiple styles: realistic, cartoon, watercolor, pixel, sketch, 3D
- Fallback to z-ai-web-dev-sdk if Perchance not configured
- Agentic AI chat with teacher assistant context
- AI lesson plan generation
Fixes:
- Fix duplicate close button in onboarding tour (removed default Dialog close, kept custom one)
- Add SnapGen and Perchance fields to AISettings model
Navigation:
- AI Studio added to Insights section (teachers) and Student nav
- Digital Notebook confirmed available for both students and teachers
- seed-demo.ts now finds any existing school (from seed.ts) instead of creating a separate 'Demo Schule'
- This ensures demo accounts have access to the seeded data (classes, students, etc.)
- Falls back to creating a school if none exists
- Added schoolId field and school relation to ClassMessagingLock model
- Added escalationPoliciesOverridden to User model
- Added classMessagingLocksLocked to User model
- Added classMessagingLocks relation to ClassGroup model
- Added relation names to avoid ambiguity