feat(ui): connect Lighthouse v2 to Cloud backend#11690
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
|
Please add an entry to the corresponding |
🔒 Container Security ScanImage: ✅ No Vulnerabilities DetectedThe container image passed all security checks. No known CVEs were found.📋 Resources:
|
Move actions/components/lib/types for lighthouse v2 into
app/(prowler)/lighthouse/_{actions,components,lib,types}, matching the
co-located feature architecture used by /alerts. Update importers
(page, settings, sidebar) and add an _actions barrel.
Scope AI Elements per version: keep the legacy primitives under
components/lighthouse-v1/ai-elements, and add clean v2 copies under
_components/ai-elements (no memo/useMemo, per React Compiler).
Add a same-origin Next.js route handler that reverse-proxies the Django SSE stream, so the browser EventSource connects same-origin (no CORS) and the access token stays server-side. Drop the unused per-message stream URL and stop revalidating /lighthouse on session create (the force-dynamic route would otherwise remount the chat and tear down the EventSource).
Collapse the chain-of-thought by default with a pulsing Thinking header, summarize tool calls as 'N tools called', and hide success outcomes. Add a copy button and hover timestamps under each message (agent left, user right). Stream client: subscribe before POST without the open-event gate (avoids a deadlock) and set the session URL with history.replaceState instead of router.push (avoids remounting mid-stream).
Context
This PR consolidates the OSS UI side of the Lighthouse v2 migration. OSS keeps the current Lighthouse as v1, while Cloud routes can render Lighthouse v2 backed by the Django Cloud API.
Depends on Cloud backend PR: https://github.com/prowler-cloud/prowler-cloud/pull/4796
Description
lighthouse-v1namespaces and keep OSS behavior intact./api/lighthouse/analystroute importing only v1 code.Steps to review
/lighthouse,/lighthouse/config, findings CTA, and banners still use Lighthouse v1./lighthouse/configand/lighthouserender v2 and route throughui/actions/lighthouse-v2.Checklist
Community Checklist
SDK/CLI
UI
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.