feat: Voice Interaction and Integrated Explanatory Video — Student Space - #278
feat: Voice Interaction and Integrated Explanatory Video — Student Space#278MaryamAjahoud wants to merge 4 commits into
Conversation
… Video US7 — Voice Interaction with AI: - Add VoiceRecording component with real-time waveform visualizer (AudioContext) - Integrate Web Speech API (SpeechRecognition) with FR/EN language support - Add SpeechSynthesis TTS for AI responses via 🔊 button in ResponseMessage - Add FR/EN language toggle persisted in settings (quizLanguage) - Inject language override on every AI message for strict lang compliance US8 — Integrated Explanatory Video in Chat: - Add YouTube search backend router (gateway/http/routers/youtube.py) via scraping - Add inline video player in PedagogicalShortcuts with Lite Embed (youtube-nocookie) - Add dedicated voice mic inside video search panel → fills videoSearchQuery - Lock main chat input with banner overlay when video panel is active - Hide mic, + and send buttons when video panel is open (UI safety) - Parse [YOUTUBE: ID] tags in ResponseMessage for AI-suggested videos - Implement setView() helper to prevent accidental dispatch on mount UX & Pedagogical fixes: - Add ChatHistorySidebar with search, date grouping and bulk-delete - Fix history navigation: use window.location.href to avoid avatar flash - Fix autoSend bug: change !== false to === true in handleShortcut - Rewrite quiz_prompt.json: remove unsolicited greeting rule - Force avatar off synchronously for historical chats - Add EXPLANATION MODE override to prevent quiz generation on shortcuts Documentation: - Add docs/uml_diagrams.md with class, activity and sequence diagrams (US7 & US8) - Add docs/uml_preview.html: standalone Mermaid viewer with pedagogical explanations - Add docs/technical_documentation.md: full technical reference
|
Hi @MaryamAjahoud Strong work on technical_documentation.md Missing:
Please add the user guide and fix items 2-3 before approval. |
|
Hi @Oumaima-elkhoummassi! Thank you for the review.
Please let me know if anything else needs adjustment! |
|
Hi, thk for contuning dev. |
|
Salam @MaryamAjahoud, |
Resolves conflicts introduced by upstream's domain refactor and router-registration rewrite (register_api_routes) against the US7/US8 voice + video branch. Kept this branch's video search, audio settings init, quiz-mode language injection, and chat history sidebar features; kept upstream's api_routes registration pattern and added the youtube router import to it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Thanks @MaryamAjahoud for the follow-ups on the docs/description — those three items from @Oumaima-elkhoummassi's review are all clearly addressed. The design-style comment also looks handled by the latest commit. Main thing I found: the new backend route for video search has a few real problems. 1. This will break CI outright. 2. The endpoint has no auth and blocks the event loop. 3. No service layer, no tests. The scraping + regex parsing lives directly in the router, skipping the repository/service pattern the rest of the app follows for new domains. And there's no 4. Raw exceptions leak to the client. L47-48: 5. Smaller stuff, not blocking:
Good bones on the voice/video UX itself (the lite-embed thumbnail-then-iframe pattern is a nice touch to avoid loading cross-origin iframes eagerly). It's really the new backend surface that needs work before this can merge. |
🎯 Overview
This PR implements two new features for the student learning space:
🎤 Voice Interaction with AI
What was implemented
SpeechRecognition) — FR/EN supportSpeechSynthesis APIScreenshots
Mic button + waveform visualizer:

🎥 Integrated Explanatory Video in Chat
What was implemented
youtube-nocookie.comiframe on click (avoids CORS)[YOUTUBE: ID]tag parsed automatically in AI responsesScreenshots
Video search panel with mic button:

Video playing inline in the chat:

📚 Documentation Added
docs/uml_diagrams.md— UML diagrams (class, activity, sequence)docs/uml_preview.html— Interactive HTML diagram viewer with explanationsdocs/technical_documentation.md— Full technical reference✅ Manual Tests