Commit Graph
12 Commits
Author SHA1 Message Date
Z User 13fce9d906 Fix UX issues: Suppress PWA in dev, respect onboarding preference, silence WS warnings
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)
2026-08-10 20:51:24 +00:00
Z User 0c7a69ffe0 Add calendar event filter tabs and grading analytics view
Calendar Enhancement:
- Added event filter tabs to ProfessionalCalendar:
  'Alle' | 'Prüfungen' | 'Veranstaltungen' | 'Ferien'
  These replace the removed exam-calendar and school-events nav entries
- Added filteredEvents useMemo for efficient filtering
- Localized view tabs to German (Monat/Woche/Agenda)

Grading Enhancement:
- Added Analytics view to UnifiedGradingPanel (3rd view mode)
  This replaces the removed grade-analytics nav entry
- Shows: Durchschnitt, Bestehensquote, Noten gesamt, Fächer
- Subject breakdown with progress bars
- Grade distribution histogram (5 buckets)
- Added ListIcon and TrendingUp icons to view switcher
2026-08-10 20:36:02 +00:00
Z User af0b0a5272 Cleanup: Remove dead nav items, orphaned i18n keys, and stale ViewName entries
Student Navigation:
- Removed 6 teacher-only items from studentNavSections:
  grade-analytics, ai-tests, seating-chart, school-newsletter,
  school-transport, substitute-teacher
- Added 9 student-relevant views to studentViews:
  counseling, report-cards, student-wellness, student-career,
  school-library, announcements, peer-assessment, student-achievements,
  student-study-planner

Parent Navigation:
- Removed 2 student-only items from parentNavSections:
  student-study-planner, peer-assessment
- Added 8 parent-relevant views to parentViews:
  parents, grading, attendance, report-cards, school-library,
  student-achievements, student-career, competitions

i18n Cleanup:
- Removed 92 orphaned tablet_grading.* translation keys (47 DE + 45 EN)
  These were for features in the deleted tablet-grading-view.tsx component

ViewName Type:
- Removed 'tablet-grading', 'exam-calendar', 'school-events' from ViewName union
  (nav entries and renderView cases were already removed in previous commit)
2026-08-10 19:10:39 +00:00
Z User 1af01dd304 Architecture audit fixes: Fix broken APIs, remove duplicates, clean dead code
Critical Fixes:
- UnifiedGradingPanel: Fixed API calls from non-existent /api/v1/grades* to /api/assessments
  - Added data transformation from Assessment objects to Grade interface
  - Handle nested subject objects (subject.name instead of subject string)
  - Added empty state when no grades exist
- ProfessionalCalendar: Fixed API call from /api/v1/calendar/events to /api/calendar-events
  - Changed from startDate/endDate params to month param (YYYY-MM format)

Removed Duplicates:
- Removed 'tablet-grading' nav entry (was duplicate of 'grading', variant='tablet' was a no-op)
- Removed 'exam-calendar' nav entry (was duplicate of 'calendar', identical props)
- Removed 'school-events' nav entry (was duplicate of 'calendar', identical props)
- Removed corresponding renderView cases for all 3

Deleted Orphan Files:
- src/components/grading-panel.tsx (never imported, called non-existent /api/v1/assessments/*)
- src/components/notification-hub.tsx (never imported, called non-existent /api/v1/notifications/*)
- src/components/unified-nav-menu.tsx (never imported, depended on deleted navigation-config.ts)
- src/lib/navigation-config.ts (stale, unused - app uses inline arrays in app-layout.tsx)

Fixed Role Access:
- Added 'settings' to parentViews, studentViews, and teacherViews
- Added notebooks, homework, attendance, grading, flower, subjects, resources,
  competitions, portfolio to studentViews
- Added notebooks, drawing, portfolio, peer-assessment, subjects, competitions,
  parents, announcements, school-library, school-transport, counseling,
  student-wellness, student-career, ai-tests, ai-studio, data-import-export
  to teacherViews
- Removed 'tablet-grading' and 'exam-calendar' from teacherViews (nav entries removed)
2026-08-10 17:46:37 +00:00
Z User 411ff146a7 Fix: Digitale Hefte modal/editor sizing - fits within viewport
- 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
2026-08-10 17:12:42 +00:00
Z User fe3eb4a272 Restrict AI Studio to teachers/admins only + Save to Lesson feature
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)
2026-08-10 16:47:05 +00:00
Z User 763ebef22b Add AI Studio with agentic system, SnapGen video gen, Perchance image gen
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
2026-08-10 16:33:23 +00:00
Z User c078ec36aa Update worklog: Phase 10 - navigation consolidation, DB setup, schema fixes 2026-08-10 16:17:23 +00:00
Z User 688a91ae47 Refactor: Consolidate sidebar navigation into 5 top-level sections
Per TODO.md navigation consolidation requirements:
- Home: Dashboard, Notifications
- Teach: Classes, Progress, Assessments, Grading, Reports, Attendance, Homework, Lesson Plans, Resources, Notebooks, Drawing, Portfolio, Rubrics, Comments, Peer Assessment, Tablet Grading, Seating, Subjects, Competitions
- School Life: Calendar, Communication, Announcements, Events, Newsletter, Library, Transport, Counseling, Wellness, Career, Discipline, Behavior, Illness, Substitutes, Timetable, Exam Calendar, Parents
- Insights: Competence Flower, Mastery Matrix, Analytics, Coverage, Grade Analytics, Reports, AI Tests, Data Import/Export
- Administration: Competencies, Districts, Settings

Added i18n keys for new section labels (DE + EN).
2026-08-10 16:15:48 +00:00
Z User 9f26c6da38 Fix: seed-demo now links demo accounts to existing school
- 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
2026-08-10 16:09:51 +00:00
Z User f63326c29b 67035726-b299-4494-aaa3-415fa685af72 2026-08-10 15:47:21 +00:00
Z User 9b9115cb73 Fix: Prisma schema - add missing relation fields for ClassMessagingLock and EscalationPolicy
- 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
2026-08-10 15:46:49 +00:00