From 0b7b0b9650c7351b7e74933538542c29e471285c Mon Sep 17 00:00:00 2001 From: ajnart Date: Tue, 18 Aug 2026 20:04:01 +0200 Subject: [PATCH] refactor(docker): use accordion for setup suggestions --- .../tools/docker/docker-reconciliation.tsx | 224 ++++++++---------- packages/translation/src/lang/en.json | 2 - 2 files changed, 101 insertions(+), 125 deletions(-) diff --git a/apps/nextjs/src/app/[locale]/manage/tools/docker/docker-reconciliation.tsx b/apps/nextjs/src/app/[locale]/manage/tools/docker/docker-reconciliation.tsx index c8b9b592b..2c8e7562f 100644 --- a/apps/nextjs/src/app/[locale]/manage/tools/docker/docker-reconciliation.tsx +++ b/apps/nextjs/src/app/[locale]/manage/tools/docker/docker-reconciliation.tsx @@ -2,6 +2,7 @@ import { useEffect, useId, useState } from "react"; import { + Accordion, ActionIcon, Alert, Avatar, @@ -183,7 +184,7 @@ export const DockerReconciliation = () => { {reconciliation.data.candidates.length === 0 ? t("empty") : t("emptyFilter")} ) : ( - + {candidates.map((candidate) => ( { } /> ))} - + )} @@ -228,9 +229,6 @@ const DockerReconciliationCandidate = ({ const target = getCandidateTarget(candidate, validatedUrl ?? ""); const actionNeedsUrl = target.kind === "createApp" || target.kind === "setupIntegration"; const isActionDisabled = actionNeedsUrl && validatedUrl === null; - const detailsId = useId(); - const [detailsOpen, setDetailsOpen] = useState(isActionDisabled || candidate.representation.signals.ambiguous); - const detailsLabel = detailsOpen ? t("action.hideDetails") : t("action.showDetails"); useEffect(() => { setSelectedCandidateId(initialUrlCandidate?.id ?? null); @@ -238,9 +236,9 @@ const DockerReconciliationCandidate = ({ }, [initialUrlCandidate?.id, initialUrlCandidate?.url]); return ( - - - + + + {candidate.container.name.at(0)?.toUpperCase()} @@ -259,130 +257,110 @@ const DockerReconciliationCandidate = ({ - + + + {target.kind === "createApp" ? ( - {target.kind === "createApp" ? ( - - ) : ( - - )} - - - - - - + ) : ( + + )} + + + + + + - - - - {candidate.match && ( - - - {candidate.match.kind} - - - {t("match", { confidence: t(`confidence.${candidate.match.confidence}`) })} - + + + {candidate.match && ( + + + {candidate.match.kind} + + + {t("match", { confidence: t(`confidence.${candidate.match.confidence}`) })} + + + )} + + {candidate.representation.signals.ambiguous && ( + }> + {t("ambiguous")} + + )} + + {health && ( +
+ + {t("health.title")} + + + {health.layers.map((layer) => ( + + {t(`health.layer.${layer.layer}`)}: {t(`health.status.${layer.status}`)} + + ))} - )} +
+ )} - {candidate.representation.signals.ambiguous && ( - }> - {t("ambiguous")} - - )} - - {health && ( -
- - {t("health.title")} - - - {health.layers.map((layer) => ( - - {t(`health.layer.${layer.layer}`)}: {t(`health.status.${layer.status}`)} - - ))} - -
- )} - - {actionNeedsUrl && ( - - ({ + value: item.id, + label: item.url || t("url.manual"), + }))} + onChange={(value) => { + setSelectedCandidateId(value); + setUrl(candidate.urlCandidates.find(({ id }) => id === value)?.url ?? ""); + }} + /> + setUrl(event.currentTarget.value)} + /> + + )} +
+
+ ); }; diff --git a/packages/translation/src/lang/en.json b/packages/translation/src/lang/en.json index e7608d348..a73395c88 100644 --- a/packages/translation/src/lang/en.json +++ b/packages/translation/src/lang/en.json @@ -7140,8 +7140,6 @@ "action": { "review": "Review", "hide": "Hide", - "showDetails": "Details", - "hideDetails": "Hide details", "refresh": "Refresh", "retry": "Try again", "dismiss": "Dismiss",