📄 2026-04-28-dashboard-fix.md 2,215 bytes Apr 28, 2026 📋 Raw

2026-04-28 — Dashboard Card Fixes

Issues Found

1. Event Graph Card — No HTMX Polling

Problem: The Event Graph card was static HTML with no hx-get trigger. It only rendered when /api/today returned data, but there was no polling mechanism to load events independently.

Fix: Added HTMX attributes to poll /api/today every 30s:

<section class="card" id="events-card" aria-label="Event Graph"
         hx-get="/api/today"
         hx-trigger="load, every 30s"
         hx-target="#events-content"
         hx-swap="innerHTML"
         hx-indicator="#events-loading">

2. IMAP Card — Auth Required on Dashboard Fragment

Problem: The IMAP dashboard fragment had hx-get="/imap/dashboard" which requires authentication. When loaded on the public-facing dashboard, it returned 401.

Fix:
- Added public endpoint: GET /api/public/imap/dashboard
- Updated HTML to use: hx-get="/api/public/imap/dashboard"
- Updated router HTML generation to match

3. Server Restart

Problem: Code changes weren't reflected because server was running old code.

Fix: Killed old process, restarted uvicorn.

Verification

Check Result
GET /api/public/imap/status {"status": "not_configured"}
GET /api/public/imap/dashboard ✅ Returns HTML fragment
GET /api/public/imap/metrics ✅ Returns metrics JSON
CSS loaded ✅ 1202 lines of CSS
Dashboard HTML ✅ Returns login page (auth required)

Files Modified

  • shared/project-docs/dashboard/templates/index.html
  • Added HTMX polling to Event Graph card
  • Fixed IMAP card to use public endpoint

  • workspace-socrates/hoffdesk-api/imap_proxy/dashboard_router.py

  • Added @public_router.get("/dashboard") endpoint
  • Updated HTML generation to use /api/public/imap/dashboard

Status

Dashboard structure is correct. Cards are wired properly. The dashboard requires authentication (by design), so public testing is limited. Once logged in:
- Event Graph card polls /api/today every 30s
- IMAP card polls /api/public/imap/dashboard every 10s
- Both render with Daedalus' polished CSS

Pending: Matt to test on iPad after login.