fix(dashboard): Fix production plans and reasoning modal issues

1. **Fix "Sin Plan" (No Production Planned)**:
   - Updated BASE_REFERENCE_DATE from Nov 25 to Nov 27 to match current date
   - Production batches were being filtered out because they were dated for Nov 25
   - The get_todays_batches() method filters for batches scheduled TODAY

2. **Fix "Ver razonamiento" Button Not Opening Modal**:
   - Changed handleOpenReasoning() to always emit 'reasoning:show' event
   - Previous logic tried to navigate to PO/batch detail pages instead
   - Now keeps user on dashboard and shows reasoning modal inline
   - Passes all metadata (action_id, po_id, batch_id, reasoning) in event

This ensures production progress shows correctly and users can view
AI reasoning without leaving the dashboard.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Urtzi Alfaro
2025-11-27 11:02:59 +01:00
parent ddf841bd70
commit b545d05d23
2 changed files with 679 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ from typing import Optional
# Base reference date for all demo seed data
# All seed scripts should use this as the "logical seed date"
# Updated to November 2025 to show recent orchestration runs
BASE_REFERENCE_DATE = datetime(2025, 11, 25, 12, 0, 0, tzinfo=timezone.utc)
BASE_REFERENCE_DATE = datetime(2025, 11, 27, 12, 0, 0, tzinfo=timezone.utc)
def adjust_date_for_demo(