Skip to content

ui: marine status line in ChatShell (existing endpoints)#105

Open
Cheewye wants to merge 1 commit intomainfrom
feat/chat-shell-marine-status
Open

ui: marine status line in ChatShell (existing endpoints)#105
Cheewye wants to merge 1 commit intomainfrom
feat/chat-shell-marine-status

Conversation

@Cheewye
Copy link
Owner

@Cheewye Cheewye commented Jan 23, 2026

Summary

Adds compact "Marine Status" line in ChatShell header when in "🌊 iURi Mar" mode. Displays AIS and SignalK status from existing backend endpoints without creating new routes or pages.

Files changed

  • frontend/src/components/chat/ChatShell.tsx - Added marine status fetching and display

Implementation

Status endpoints used (existing)

  • AIS: /api/v1/vessels/realtime/status - Checks service_running field
  • SignalK: /api/v1/marine/signalk/vessels - Uses vessels endpoint as health check (200 = ok, 503/404 = down)

Status display

  • Location: Compact line below header (when chatMode === 'marine')
  • Format: "Marine Status: AIS: OK/DOWN/UNKNOWN SignalK: OK/DOWN/UNKNOWN"
  • Colors:
    • OK: emerald (green)
    • DOWN: rose (red)
    • UNKNOWN: slate (gray)
  • Polling: Fetches on mount + every 30s (with cleanup on unmode/mount)

Behavior

  • Only visible when chatMode === 'marine'
  • Fetches status immediately when mode switches to marine
  • Polls every 30 seconds while in marine mode
  • Cleans up interval on unmount or mode switch
  • Shows "unknown" if endpoint doesn't exist or fetch fails (no spam)

Verification

  • cd frontend && npm ci && npm run buildPASS (✓ built in 7.93s)
  • python tools/guardian_scope_check.py --base origin/mainPASS (scope check: ok)

Notes

  • No new routes added
  • No new pages created
  • Uses only existing frontend API client (api from services/api.ts)
  • Uses only existing backend endpoints (no backend work)
  • No secrets, no transcript logging
  • SSOT message flow unchanged
  • 📋 Checklist de Seguridad iURi

Protección del Módulo Marino

  • NO se modifica ni borra src/components/marine/*
  • NO se introduce react-leaflet (usar MapLibre o Leaflet directo)
  • Si hay WebSocket :8000 → está detrás de VITE_USE_IURI_WS flag
  • NO se renombran vars: VITE_SIGNALK_WS, VITE_MQTT_WS, VITE_VESSEL_ID

Arquitectura General

  • Sidebar/rutas: sin cambios (salvo que sea el objetivo del PR)
  • i18n actualizado en todos los idiomas (es/pt/en/...)
  • No se introducen dependencias de Three.js sin lazy-load y feature flag

Pruebas Locales

  • npm run dev abre /dashboard sin errores en consola
  • (Si stack marino levantado) scripts/sanity_stack.sh OK
  • (Obligatorio) scripts/premerge_guard.sh PASS
  • (Obligatorio) scripts/llm_diff_review.sh ejecutado (adjuntar salida)

Capturas


🧠 Salida del Guardián IA Local

Ollama LLM Diff Review
<!-- Pegar aquí la salida de: MODEL=llama3.2 bash scripts/llm_diff_review.sh -->

📝 Descripción de Cambios

🔗 Relacionado

Fixes #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant