From dd6ddf6e2a2f9f8ea01e95a86d53321de36af31e Mon Sep 17 00:00:00 2001 From: John Swanke Date: Wed, 22 Apr 2026 16:43:31 -0400 Subject: [PATCH] backup Signed-off-by: John Swanke --- .../src/review/ReviewStep.tsx | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx b/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx index 275648f8d0f..bf3f91d8c05 100644 --- a/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx +++ b/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx @@ -466,7 +466,10 @@ function renderCollapsedBadgesFromNodes( const collapsedInputContent = child.error ? ( child.label ?? child.path ) : child.value === true ? ( - + + + {reviewBooleanCheckCompanionText(child)} + ) : ( renderReviewInputDescriptionContent(child) ) @@ -712,6 +715,39 @@ function isReviewValueUnset(value: unknown): boolean { return false } +/** Collapsed review badge only: text beside the checkmark for boolean or unset inputs (short label, else path-derived). */ +function reviewBooleanCheckCompanionText(node: WizardInputDomNode): string { + const { path, label, value } = node + if (!(typeof value === 'boolean' || isReviewValueUnset(value))) { + return label ?? path + } + if (label && label.length < 32) { + return label + } + if (!path) { + return label ?? '' + } + const hashKeyMatch = path.match(/#\[([^=]+)=([^\]]+)\]\s*$/) + if (hashKeyMatch) { + return hashKeyMatch[1]! + } + const semicolonIdMatch = path.match(/;([^;=]+)=([^;]+)$/) + if (semicolonIdMatch) { + return semicolonIdMatch[2]! + } + const segments = path.split('.') + const lastSeg = segments[segments.length - 1] ?? path + if (lastSeg === 'enabled' || lastSeg === 'disabled') { + const parent = segments.length >= 2 ? segments[segments.length - 2]! : '' + const valuePart = typeof value === 'boolean' ? String(value) : '' + if (parent) { + return valuePart ? `${parent}.${lastSeg} = ${valuePart}` : `${parent}.${lastSeg}` + } + return valuePart ? `${lastSeg} = ${valuePart}` : lastSeg + } + return lastSeg +} + /** True when the review row should be omitted: no user-visible value (still show rows with errors). */ function isReviewInputRowValueHidden(value: unknown): boolean { if (value === false) return true