diff --git a/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.test.tsx b/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.test.tsx index c099cb5e72..de2ac354a4 100644 --- a/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.test.tsx +++ b/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.test.tsx @@ -108,19 +108,40 @@ describe("LighthouseV2ConfigPage", () => { updateConfigurationMock.mockResolvedValue({ data: configurations[0] }); }); - it("renders provider readiness, statuses, and the active provider", () => { + it("renders provider statuses and the active provider without the readiness summary card", () => { // Given / When - renderPage(); + const { container } = renderPage(); // Then expect( - screen.getByRole("heading", { name: "Lighthouse readiness" }), - ).toBeInTheDocument(); - expect(screen.getByText("1 connected")).toBeInTheDocument(); - expect(screen.getByText("1 failed")).toBeInTheDocument(); - expect(screen.getByText("1 not tested")).toBeInTheDocument(); + screen.queryByRole("heading", { name: "Lighthouse readiness" }), + ).not.toBeInTheDocument(); + expect(screen.queryByText("1 connected")).not.toBeInTheDocument(); + expect(screen.queryByText("1 failed")).not.toBeInTheDocument(); + expect(screen.queryByText("1 not tested")).not.toBeInTheDocument(); const openAIProvider = screen.getByRole("button", { name: "OpenAI" }); + const settingsCard = screen.getByRole("region", { + name: "Lighthouse settings", + }); + const settingsSeparator = container.querySelector( + '[data-slot="settings-separator"]', + ); + + expect(settingsCard).toHaveAttribute("data-slot", "card"); + expect(settingsCard).toHaveClass( + "min-h-[calc(100dvh-6.5rem)]", + "w-full", + "gap-0", + "overflow-hidden", + ); + expect(settingsCard).not.toHaveClass("mx-auto", "max-w-7xl"); + expect(settingsSeparator).toHaveClass( + "border-t", + "xl:border-t-0", + "xl:border-l", + ); + expect(settingsCard).toContainElement(openAIProvider); expect(openAIProvider).toHaveAttribute("aria-pressed", "true"); expect(within(openAIProvider).getByText("Connected")).toBeInTheDocument(); diff --git a/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.tsx b/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.tsx index 9c6e852fca..37b7428b5f 100644 --- a/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.tsx +++ b/ui/components/lighthouse-v2/config/lighthouse-v2-config-page.tsx @@ -150,7 +150,6 @@ export function LighthouseV2ConfigPage({ modelsByProvider[selectedProviderDefinition.id] ? modelsByProvider[selectedProviderDefinition.id] : []; - const readiness = getReadinessSummary(providers, localConfigurations); const handleConfigurationSaved = ( configuration: LighthouseV2Configuration, @@ -183,121 +182,55 @@ export function LighthouseV2ConfigPage({ } return ( -
- - + {feedback && ( - router.refresh()} - onClose={() => setFeedback(null)} - /> +
+ router.refresh()} + onClose={() => setFeedback(null)} + /> +
)} -
- { - setSelectedProvider(provider); - setFeedback(null); - }} - /> - - -
-
- ); -} - -function LighthouseV2ReadinessHeader({ - readiness, -}: { - readiness: ReadinessSummary; -}) { - const ready = - readiness.connected > 0 - ? "Ready for chat" - : readiness.failed > 0 - ? "Needs attention" - : "Setup required"; - - return ( -
-
-
-
- -
-
-
-

- Lighthouse readiness -

- 0 ? "success" : "warning"}> - {ready} - -
-

- Manage the model providers Lighthouse can use for Cloud analysis. - Connected providers are available in chat; failed or untested - providers stay blocked until tested cleanly. -

-
+
+
+ { + setSelectedProvider(provider); + setFeedback(null); + }} + />
-
- - -
-
- ); -} - -function ReadinessMetric({ - label, - value, - status, -}: { - label: string; - value: number; - status: ConnectionStatus; -}) { - return ( -
-
- - - {value} - -
-

- {value} {label} -

-
+ ); } @@ -539,7 +472,7 @@ function LighthouseV2ConfigurationForm({ }; return ( -
+
@@ -1011,47 +944,6 @@ function StatusBadge({ status }: { status: ConnectionStatus }) { ); } -function StatusDot({ status }: { status: ConnectionStatus }) { - return ( - - ); -} - -interface ReadinessSummary { - connected: number; - failed: number; - notTested: number; -} - -function getReadinessSummary( - providers: LighthouseV2SupportedProvider[], - configurations: LighthouseV2Configuration[], -): ReadinessSummary { - return providers.reduce( - (summary, provider) => { - const config = configurations.find( - (item) => item.providerType === provider.id, - ); - const status = getConnectionStatus(config); - if (status === CONNECTION_STATUS.CONNECTED) { - return { ...summary, connected: summary.connected + 1 }; - } - if (status === CONNECTION_STATUS.FAILED) { - return { ...summary, failed: summary.failed + 1 }; - } - return { ...summary, notTested: summary.notTested + 1 }; - }, - { connected: 0, failed: 0, notTested: 0 }, - ); -} - function getConnectionStatus( configuration?: LighthouseV2Configuration, ): ConnectionStatus {