From 2f05caacda28c190a31325ea3aab5af534bb8805 Mon Sep 17 00:00:00 2001 From: John Swanke Date: Tue, 21 Apr 2026 14:34:06 -0400 Subject: [PATCH 1/5] finish Signed-off-by: John Swanke --- .../react-form-wizard/src/inputs/Input.ts | 4 + .../src/review/ReviewStep.css | 17 +++- .../src/review/ReviewStep.tsx | 99 ++++++++++++++++--- .../src/review/ReviewStepContexts.tsx | 3 + .../src/review/ReviewStepNavigation.tsx | 16 ++- 5 files changed, 121 insertions(+), 18 deletions(-) diff --git a/frontend/packages/react-form-wizard/src/inputs/Input.ts b/frontend/packages/react-form-wizard/src/inputs/Input.ts index 982d7359719..3dcd79b905e 100644 --- a/frontend/packages/react-form-wizard/src/inputs/Input.ts +++ b/frontend/packages/react-form-wizard/src/inputs/Input.ts @@ -40,6 +40,8 @@ export type InputCommonProps = { disabledInEditMode?: boolean /** When true, this input is omitted from the review step navigation / registry. */ hideFromReviewStep?: boolean + /** When true, the review step masks the value until the user chooses to reveal it. */ + secret?: boolean inputValueToPathValue?: (inputValue: unknown, pathValue: unknown) => unknown pathValueToInputValue?: (pathValue: unknown) => unknown @@ -179,6 +181,7 @@ export function useInput(props: InputCommonProps, options?: { isArrayInput?: boo value, label: props.label, error: error ?? undefined, + secret: props.secret, type: isArrayInput ? InputReviewMeta.ARRAY_INPUT : InputReviewMeta.INPUT, }) bumpReviewDomTree?.() @@ -192,6 +195,7 @@ export function useInput(props: InputCommonProps, options?: { isArrayInput?: boo registrationPath, value, props.label, + props.secret, error, isArrayInput, bumpReviewDomTree, diff --git a/frontend/packages/react-form-wizard/src/review/ReviewStep.css b/frontend/packages/react-form-wizard/src/review/ReviewStep.css index 1395947b46b..dc4eb8c1c47 100644 --- a/frontend/packages/react-form-wizard/src/review/ReviewStep.css +++ b/frontend/packages/react-form-wizard/src/review/ReviewStep.css @@ -130,6 +130,12 @@ gap: var(--pf-t--global--spacer--xs, 0.25rem); } +/* Value text grows so trailing controls (reveal / pen / YAML) stay on the right. */ +.wizard-review-inline-value-body { + flex: 1 1 auto; + min-width: 0; +} + /* Full width of the value cell so pen controls can sit at the far right. */ .wizard-review-pen-hover-zone.wizard-review-inline-value, .wizard-review-pen-hover-zone--dl-group-row .wizard-review-inline-value { @@ -138,9 +144,14 @@ min-width: 0; } +/* Match description-list term baseline; keep reveal + pen + arrow on one typographic line. */ +.wizard-review-pen-hover-zone--dl-group-row .wizard-review-inline-value { + align-items: baseline; +} + .wizard-review-pen-controls { display: inline-flex; - align-items: center; + align-items: baseline; flex-shrink: 0; margin-left: auto; gap: var(--pf-t--global--spacer--xs, 0.25rem); @@ -181,7 +192,9 @@ /* One flex child so .wizard-review-inline-value gap does not sit between each match span */ .wizard-review-inline-value > .wizard-review-find-inline-body, -.wizard-review-inline-value > .wizard-review-find-value-with-trailing-icon { +.wizard-review-inline-value > .wizard-review-find-value-with-trailing-icon, +.wizard-review-inline-value-body > .wizard-review-find-inline-body, +.wizard-review-inline-value-body > .wizard-review-find-value-with-trailing-icon { flex: 1 1 auto; min-width: 0; } diff --git a/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx b/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx index 0d5c02debc7..b0f17de0667 100644 --- a/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx +++ b/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx @@ -1,6 +1,7 @@ /* Copyright Contributors to the Open Cluster Management project */ import { Badge, + Button, DescriptionList, DescriptionListDescription, DescriptionListGroup, @@ -17,7 +18,7 @@ import { } from '@patternfly/react-core' import { css } from '@patternfly/react-styles' import titleStyles from '@patternfly/react-styles/css/components/Title/title' -import { CheckIcon, ExclamationCircleIcon } from '@patternfly/react-icons' +import { CheckIcon, ExclamationCircleIcon, EyeIcon, EyeSlashIcon } from '@patternfly/react-icons' import { Fragment, type ComponentProps, @@ -706,6 +707,60 @@ function renderReviewInputDescriptionContent(node: WizardInputDomNode): ReactNod return <> } +function useReviewSecretMaskState(value: unknown) { + const [showSecrets, setShowSecrets] = useState(() => isReviewValueUnset(value)) + const hasValue = !isReviewValueUnset(value) + const masked = !showSecrets && hasValue + const displayContent = formatReviewValue(value) + const maskedText = masked ? '****************' : displayContent + const revealButton = hasValue ? ( + ) : null} + + ) + + const controls = ( + + {beforePenControls} + {editButtons} ) @@ -356,7 +366,7 @@ export function ReviewPenHoverZone({ {descriptionListTerm} - {children} + {children} {controls} From dc43ca535a9716f95a8afd9371b07eb656262475 Mon Sep 17 00:00:00 2001 From: John Swanke Date: Tue, 21 Apr 2026 15:19:25 -0400 Subject: [PATCH 2/5] rabbit stew Signed-off-by: John Swanke --- frontend/packages/react-form-wizard/src/review/ReviewStep.tsx | 4 +++- 1 file changed, 3 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 b0f17de0667..f07d1f44a51 100644 --- a/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx +++ b/frontend/packages/react-form-wizard/src/review/ReviewStep.tsx @@ -717,8 +717,10 @@ function useReviewSecretMaskState(value: unknown) {