Phillip Tarrant
20cb279793
fix: resolve NPC chat database persistence and modal targeting
Fixed two critical bugs in NPC chat functionality:
1. Database Persistence - Metadata serialization bug
- Empty dict {} was falsy, preventing JSON conversion
- Changed to unconditional serialization in ChatMessageService
- Messages now successfully save to chat_messages collection
2. Modal Targeting - HTMX targeting lost during polling
- poll_job() wasn't preserving hx-target/hx-swap parameters
- Pass targeting params through query string in polling cycle
- Responses now correctly load in modal instead of main panel
Files modified:
- api/app/services/chat_message_service.py
- public_web/templates/game/partials/job_polling.html
- public_web/app/views/game_views.py