🔴 Kahani Magic Issues
Known issues, priorities, and fix status
Last Updated: January 21, 2026
Priority Legend
- 🔴 Critical - Broken core functionality, must fix
- 🟡 High - Significantly impacts UX, should fix soon
- 🟢 Medium - Nice to have, can wait
- ⚪ Low - Minor improvements
Critical Issues (Week 1)
| # | Issue | Component | Root Cause | Fix | Hours |
|---|-------|-----------|------------|-----|-------|
| 1 | ~~No TTS timestamps~~ | /generate-audio | Gemini/ElevenLabs don't return timing | ✅ ElevenLabs with_timestamps | 2h |
| 2 | ~~Heuristic word timing~~ | /align-text | No actual alignment | ✅ Deepgram transcription | 0.5h |
| 3 | ~~languageCode not passed~~ | Multiple APIs | UI→API flow broken | ✅ Fixed in all layers | 0.5h |
| 4 | Kinetic array mismatch | /generate-kinetic | AI returns wrong count | Validate/sync with text | 1h |
| 5 | Text edit clears animations | useEditMode.ts | No auto-regeneration | Trigger regen on edit | 2h |
Total: ~6 hours
High Priority Issues (Week 2)
| # | Issue | Component | Root Cause | Fix | Hours |
|---|-------|-----------|------------|-----|-------|
| 6 | No image editing | Image asset | No API | Add inpainting API | 8h |
| 7 | Caption timing drift | CaptionTypography | Uses heuristic timing | Link to audio timestamps | 2h |
| 8 | BGM not preloaded | bgmService.ts | Loads on first play | Preload on story load | 2h |
| 9 | Hinglish audio is English | /generate-audio | Language not passed | Fix languageCode flow | 1h |
Total: ~13 hours
Medium Priority Issues (Week 3+)
| # | Issue | Component | Fix | Hours | |---|-------|-----------|-----|-------| | 10 | No PDF export | Export feature | Add PDF generation | 8h | | 11 | No image sequence export | Export feature | Add batch download | 4h | | 12 | No embed code | TopControls | Generate iframe snippet | 4h | | 13 | No social sharing | TopControls | Add share buttons | 4h | | 14 | useAudioPlayer too large | BookReader hooks | Split into modules | 4h | | 15 | No audio waveform | AudioControls | Add visualization | 4h |
Low Priority Issues
| # | Issue | Component | Fix | Hours | |---|-------|-----------|-----|-------| | 16 | No per-word animation edit | Kinetic | Add editor UI | 8h | | 17 | No manual timing adjust | WordHighlighter | Add timing editor | 8h | | 18 | Limited BGM moods | bgmService | Expand library | 4h | | 19 | SFX caching basic | sfxService | Improve cache | 2h | | 20 | No image filters | Image asset | Add post-processing | 4h |
Combo Editor Issues (Critical)
Video Editor integrated with Kahani Magic
Plans Created: January 22, 2026
| # | Issue | Component | Root Cause | Status |
|---|-------|-----------|------------|--------|
| C1 | Media tabs empty | media-panel/panel/*.tsx | Missing API routes | 🔴 Plan created |
| C2 | JSON parse error | All media panels | APIs return 404 HTML | 🔴 Plan created |
| C3 | Captions behind images | combo/page.tsx | Layer ordering broken | 🔴 Plan created |
| C4 | Shapes not working | elements.tsx | Handler broken | 🔴 Plan created |
| C5 | Filters not applying | effects.tsx | Pixi.js not connected | 🔴 Plan created |
| C6 | Transitions broken | transition.tsx | Clip creation issue | 🔴 Plan created |
| C7 | Kahani story sync | Kahani integration | One-way only | 🟡 Partial |
| C8 | Caption disconnected | Caption system | No sync with Kahani | 🟡 Plan created |
Missing API Routes
/api/pexels → Stock images/videos
/api/audio/music → Background music
/api/audio/sfx → Sound effects
/api/audio/voiceover → TTS generation
Detailed Plans
See: C:\Users\anshu\.gemini\antigravity\brain\c6ec6927-fe76-4219-8b58-8c0dcbd934db\plans\
module_1_layer_system.md- Layer fixmodule_2_media_apis.md- Missing APIsmodule_3_kahani_integration.md- Sync improvementsmodule_4_captions.md- Caption enhancementsmodule_5_shapes_elements.md- Shape fixmodule_6_effects_filters.md- Filter implementationmodule_7_transitions.md- Transition fixmodule_8_ai_enhancements.md- AI features
Issue Details
Issue #1: No TTS Timestamps
Current Flow:
text → Gemini TTS → audio (no timing)
→ heuristic division → word timings (inaccurate)
Fixed Flow:
text → ElevenLabs TTS (with_timestamps) → audio + timings
OR
text → Gemini TTS → audio → Deepgram transcription → timings
Files to Modify:
src/app/api/kahani-magic/generate-audio/route.tssrc/lib/ai/elevenlabs-tts.ts
Issue #3: languageCode Not Passed
Trace:
PresetSelector (languageCode selected)
↓
page.tsx generateStory()
↓
/api/kahani-magic/generate-audio ← languageCode missing in some paths
↓
Gemini TTS uses wrong pronunciation
Files to Check:
src/app/studio/kahani-magic/page.tsxsrc/app/studio/kahani-magic/components/BookReader/hooks/useGeneration.tssrc/app/api/kahani-magic/generate-audio/route.ts
Issue #5: Text Edit Clears Animations
Current Behavior:
User edits text → text updated → animations cleared → no regeneration
Expected Behavior:
User edits text → text updated → auto-trigger animation regen → update complete
Fix Location: useEditMode.ts line ~200
Fixed Issues Log
| Date | Issue | Fix | PR |
|------|-------|-----|-----|
| 2026-01-23 | Video gen 400 error (missing prompt) | Added generateDefaultVideoPrompt() in adapter | - |
| 2026-01-19 | Audio export corruption | Handle base64 in Remotion | - |
| 2026-01-18 | Caption sync drift | Added TTS_SPEED_FACTOR | - |
| 2026-01-17 | SFX not playing | Fixed ElevenLabs soundPrompt | - |
Verification Checklist
After fixing critical issues:
- [ ] Hindi story generates with Hindi audio
- [ ] Word highlighting syncs with narration
- [ ] Captions appear at correct time
- [ ] Kinetic animations match word count
- [ ] Text edit preserves animations
Update this file when issues are fixed or discovered