Skip to content

EDM-4145: Common helperText for unique Name field#704

Merged
celdrake merged 2 commits into
flightctl:mainfrom
celdrake:EDM-4145-name-display-helper-text
Jun 29, 2026
Merged

EDM-4145: Common helperText for unique Name field#704
celdrake merged 2 commits into
flightctl:mainfrom
celdrake:EDM-4145-name-display-helper-text

Conversation

@celdrake

@celdrake celdrake commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Show a unified helperText in the "Name" field.
Add a clarification for CatalogItem's "Display Name".

Areas Affected

libs/ui-components/ (Shared UI Components)

  • Shared helper text behavior for “Name” fields via the reusable form components:
    • components/form/NameField.tsx
    • components/form/RichValidationTextField.tsx
  • Catalog item “Display name” field UI clarification in the Add Catalog Item wizard/modals:
    • components/Catalog/AddCatalogItemWizard/CreateCatalogModal.tsx
    • components/Catalog/AddCatalogItemWizard/steps/GeneralInfoStep.tsx
    • components/Catalog/AddCatalogItemWizard/steps/TypeConfigStep.tsx
  • Minor accessibility/props consistency updates for “Display name” related fields:
    • components/ImagePromotion/ImagePromotionForm.tsx
  • Removes duplicated/inline helper text from a consumer:
    • components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx

Cross-cutting Implications

  • Changes to shared UI components (NameField, RichValidationTextField) affect any app surfaces that consume ui-components (e.g., both standalone and any OCP plugin usage).

Summary of Changes

This PR centralizes and unifies helper-text rendering for “Name” fields across the UI component library and clarifies “CatalogItem” “Display name” labeling.

Core component updates

  • NameField
    • Adds support for a helperText prop and forwards it to RichValidationTextField.
    • Updates NameFieldWrapper so it always supplies the translated “A unique system identifier. Cannot be changed after creation.” helper text (replacing the prior conditional behavior where helper text was only rendered when provided/disabled).
    • Keeps the existing disabled/editability logic intact.
  • RichValidationTextField
    • Adds an optional helperText?: React.ReactNode prop.
    • Renders the helper text via DefaultHelperText alongside existing input/validation UI.

Consumer updates

  • Auth provider form: removes the redundant “can’t change after it’s created” helper text from the NameField usage so it relies on the centralized NameField behavior.
  • Catalog item wizard (“Display name”)
    • Clarifies labeling for the “Display name” concept (including changing “Name”/accessibility text to “Display name” in the Type/Config step).
    • Removes the previous “Optional display name” helper text where applicable.
    • Reworks some JSX formatting and ensures relevant props (e.g., aria-label, helperText, isDisabled) are consistently applied.
  • Image promotion form
    • Ensures “Display name” fields include appropriate aria-label, helper text, and explicit disabled handling; also adds an aria-label for the “Readme” field.

Internationalization

  • The unified “Name” helper text is sourced from the i18n/translated message used by the shared helper rendering path (DefaultHelperText), ensuring consistent wording across the app.

Non-goals / Explicitly out of scope

  • No changes reported to libs/types/, libs/i18n/ (beyond consuming existing translation wiring in the shared UI components), libs/cypress/, apps/*, Go auth proxy, container builds, packaging, or CI/workflow configuration.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: a6625b3a-5a1e-4117-8b7d-3b1a0b1758e6

📥 Commits

Reviewing files that changed from the base of the PR and between d1cddc7 and 6882310.

⛔ Files ignored due to path filters (1)
  • libs/i18n/locales/en/translation.json is excluded by !libs/i18n/locales/en/translation.json
📒 Files selected for processing (7)
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/CreateCatalogModal.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/GeneralInfoStep.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/TypeConfigStep.tsx
  • libs/ui-components/src/components/ImagePromotion/ImagePromotionForm.tsx
  • libs/ui-components/src/components/form/NameField.tsx
  • libs/ui-components/src/components/form/RichValidationTextField.tsx

Walkthrough

RichValidationTextField now renders optional helper text. NameField always supplies translated system-identifier helper text through the shared field component. Several form fields also update labels, aria text, and helper text usage.

Changes

Helper text and field text updates

Layer / File(s) Summary
RichValidationTextField helper text
libs/ui-components/src/components/form/RichValidationTextField.tsx
RichValidationTextFieldProps adds helperText?: React.ReactNode, the component destructures it, and DefaultHelperText renders it inside the form group.
NameField helper text wiring
libs/ui-components/src/components/form/NameField.tsx
NameField forwards helperText to RichValidationTextField, and NameFieldWrapper always supplies the translated system-identifier helper text in both disabled and enabled branches.
Call site label and accessibility updates
libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx, libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/TypeConfigStep.tsx, libs/ui-components/src/components/ImagePromotion/ImagePromotionForm.tsx, libs/ui-components/src/components/Catalog/AddCatalogItemWizard/CreateCatalogModal.tsx, libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/GeneralInfoStep.tsx
AuthProviderForm removes inline helper text, TypeConfigStep renames artifact name text to “Display name” and removes its helper text, ImagePromotionForm adds aria labels and helper text, and the catalog display-name text fields are reformatted.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

ui-components

Suggested reviewers

  • jkilzi

Poem

A helper text now finds its home,
Through shared fields it likes to roam.
Labels shift and aria sings,
Small UI polish on steady wings.

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Unchecked-Errors ⚠️ Warning proxy/bridge/handler.go and terminal.go ignore returned errors (json.Marshal, WriteControl) without any justification comments. Handle or log these errors, or add explicit comments and lint suppressions if ignoring them is intentional and safe.
I18n-Compliance ⚠️ Warning CreateAuthProviderForm.tsx still has raw aria-label="Enabled help text" in JSX; it isn’t wrapped in t(). No dynamic t() keys were found. Wrap that button label with t(...), and keep all user-visible .tsx strings and t() keys as hardcoded translation literals.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: introducing shared helper text for the unique Name field.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets found; touched files only add helper text/labels and form fields, with no credential literals, base64 blobs, or embedded URL creds.
No-Weak-Crypto ✅ Passed Touched files are UI-only; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret/token comparisons were introduced.
No-Injection-Vectors ✅ Passed Touched files and helper-text components contain no eval/exec/dangerouslySetInnerHTML/yaml.load; helper copy is rendered as ReactNode, not raw HTML.
Container-Privileges ✅ Passed The PR only touches UI TSX files; a repo scan found no privileged container/K8s settings in manifests.
No-Sensitive-Data-In-Logs ✅ Passed No new console/logger calls or debug output were added in the touched files; the changes only adjust helper text and labels.
Resource-Leaks ✅ Passed PR only changes ui-components TSX files; no Go files under proxy/ were touched, so the resource-leak check is not applicable.
Ai-Attribution ✅ Passed HEAD commit includes acceptable Made-with: Cursor trailer; no Co-Authored-By AI attribution found.
Generated-Files-Not-Hand-Edited ✅ Passed Only libs/ui-components/src/components/form/NameField.tsx changed; no files under libs/types/** or libs/i18n/locales/en/translation.json were edited.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/ui-components/src/components/form/NameField.tsx`:
- Around line 17-20: The NameFieldHelperText component currently wraps the
translated helper text in a DefaultHelperText component, but this component is
then passed as the helperText prop to RichValidationTextField which wraps it
again in DefaultHelperText, causing double-wrapping that breaks PatternFly
styling. Modify NameFieldHelperText to return only the translated text string
(without the DefaultHelperText wrapper), allowing RichValidationTextField to
apply the wrapper once. This change affects both the NameFieldHelperText
function definition and where it is used as the helperText prop in
RichValidationTextField.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 17c669b4-3457-4f25-95b8-e283adfe6b98

📥 Commits

Reviewing files that changed from the base of the PR and between 66e5e62 and d1cddc7.

⛔ Files ignored due to path filters (1)
  • libs/i18n/locales/en/translation.json is excluded by !libs/i18n/locales/en/translation.json
📒 Files selected for processing (7)
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/CreateCatalogModal.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/GeneralInfoStep.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/TypeConfigStep.tsx
  • libs/ui-components/src/components/ImagePromotion/ImagePromotionForm.tsx
  • libs/ui-components/src/components/form/NameField.tsx
  • libs/ui-components/src/components/form/RichValidationTextField.tsx
💤 Files with no reviewable changes (1)
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx

Comment thread libs/ui-components/src/components/form/NameField.tsx Outdated
@celdrake celdrake force-pushed the EDM-4145-name-display-helper-text branch from d1cddc7 to ad6d36a Compare June 16, 2026 08:27
@celdrake celdrake requested a review from jkilzi June 16, 2026 11:37

@jkilzi jkilzi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good intent — standardising the helper text is the right call. One prop-ordering bug needs fixing before merge.

Accessibility wins — the additions in and friends are a nice bonus.

Nit — drops the "Optional display name" helper text from the artifact name field while also relabelling it "Display name". If the field is optional, some hint to that effect would still be helpful for users.

validations={validations}
resourceType={resourceType}
helperText={t('A unique system identifier. Cannot be changed after creation.')}
{...rest}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{...rest} is spread after the explicit helperText prop, so any caller that passes helperText through rest will override the standardised string — defeating the purpose of this PR.

Move {...rest} before helperText so the hardcoded text always wins:

<NameField
  name={name}
  validations={validations}
  resourceType={resourceType}
  {...rest}
  helperText={t('A unique system identifier. Cannot be changed after creation.')}
/>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, fixed now.

@celdrake celdrake force-pushed the EDM-4145-name-display-helper-text branch from ad6d36a to 6882310 Compare June 29, 2026 09:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx`:
- Around line 57-65: The Button in CreateAuthProviderForm uses a hardcoded
user-facing aria-label, so it should be localized like the rest of the
component. Update the aria-label on the Button in CreateAuthProviderForm to use
t(...) instead of the literal "Enabled help text", keeping the label
context-aware and matching the existing translation patterns in this form.

In `@libs/ui-components/src/components/form/RichValidationTextField.tsx`:
- Line 157: The new helper text rendered by DefaultHelperText is not associated
with the input, so TextInput’s aria-describedby target does not resolve. Update
RichValidationTextField so the helper text element gets the same helper id
expected by TextInput (the fieldId-based helper identifier), ensuring the
guidance is exposed to screen readers. Use the existing symbols TextInput,
DefaultHelperText, and helperText/fieldId wiring to keep the association
consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: a6625b3a-5a1e-4117-8b7d-3b1a0b1758e6

📥 Commits

Reviewing files that changed from the base of the PR and between d1cddc7 and 6882310.

⛔ Files ignored due to path filters (1)
  • libs/i18n/locales/en/translation.json is excluded by !libs/i18n/locales/en/translation.json
📒 Files selected for processing (7)
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/CreateCatalogModal.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/GeneralInfoStep.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/TypeConfigStep.tsx
  • libs/ui-components/src/components/ImagePromotion/ImagePromotionForm.tsx
  • libs/ui-components/src/components/form/NameField.tsx
  • libs/ui-components/src/components/form/RichValidationTextField.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx`:
- Around line 57-65: The Button in CreateAuthProviderForm uses a hardcoded
user-facing aria-label, so it should be localized like the rest of the
component. Update the aria-label on the Button in CreateAuthProviderForm to use
t(...) instead of the literal "Enabled help text", keeping the label
context-aware and matching the existing translation patterns in this form.

In `@libs/ui-components/src/components/form/RichValidationTextField.tsx`:
- Line 157: The new helper text rendered by DefaultHelperText is not associated
with the input, so TextInput’s aria-describedby target does not resolve. Update
RichValidationTextField so the helper text element gets the same helper id
expected by TextInput (the fieldId-based helper identifier), ensuring the
guidance is exposed to screen readers. Use the existing symbols TextInput,
DefaultHelperText, and helperText/fieldId wiring to keep the association
consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: a6625b3a-5a1e-4117-8b7d-3b1a0b1758e6

📥 Commits

Reviewing files that changed from the base of the PR and between d1cddc7 and 6882310.

⛔ Files ignored due to path filters (1)
  • libs/i18n/locales/en/translation.json is excluded by !libs/i18n/locales/en/translation.json
📒 Files selected for processing (7)
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/CreateCatalogModal.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/GeneralInfoStep.tsx
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/TypeConfigStep.tsx
  • libs/ui-components/src/components/ImagePromotion/ImagePromotionForm.tsx
  • libs/ui-components/src/components/form/NameField.tsx
  • libs/ui-components/src/components/form/RichValidationTextField.tsx
🛑 Comments failed to post (2)
libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx (1)

57-65: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Translate the new button aria-label.

aria-label="Enabled help text" is user-facing copy in a .tsx file, so it should go through t(...) like the rest of this component. As per coding guidelines, **/*.tsx: "Flag user-visible strings in .tsx files that are not wrapped in the t() translation function." As per path instructions, {libs,apps}/*/src/**/*.{ts,tsx}: "All user-visible strings must use the t() translation function."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx`
around lines 57 - 65, The Button in CreateAuthProviderForm uses a hardcoded
user-facing aria-label, so it should be localized like the rest of the
component. Update the aria-label on the Button in CreateAuthProviderForm to use
t(...) instead of the literal "Enabled help text", keeping the label
context-aware and matching the existing translation patterns in this form.

Sources: Coding guidelines, Path instructions

libs/ui-components/src/components/form/RichValidationTextField.tsx (1)

157-157: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Associate the new helper text with the input.

This renders the helper copy visually, but TextInput still points aria-describedby at ${fieldId}-helper while DefaultHelperText does not render that id. Screen readers will miss the new guidance.

Suggested fix
-        <DefaultHelperText helperText={helperText} />
+        <DefaultHelperText id={`${fieldId}-helper`} helperText={helperText} />
-export const DefaultHelperText = ({ helperText }: DefaultHelperTextProps) => {
+export const DefaultHelperText = ({ id, helperText }: DefaultHelperTextProps) => {
   return helperText ? (
-    <FormHelperText>
+    <FormHelperText id={id}>
       <HelperText>
         <HelperTextItem variant="default">{helperText}</HelperTextItem>
       </HelperText>
     </FormHelperText>
   ) : null;
};
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

        <DefaultHelperText id={`${fieldId}-helper`} helperText={helperText} />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/ui-components/src/components/form/RichValidationTextField.tsx` at line
157, The new helper text rendered by DefaultHelperText is not associated with
the input, so TextInput’s aria-describedby target does not resolve. Update
RichValidationTextField so the helper text element gets the same helper id
expected by TextInput (the fieldId-based helper identifier), ensuring the
guidance is exposed to screen readers. Use the existing symbols TextInput,
DefaultHelperText, and helperText/fieldId wiring to keep the association
consistent.

@celdrake celdrake requested a review from jkilzi June 29, 2026 10:30
@celdrake celdrake merged commit f32ea6c into flightctl:main Jun 29, 2026
10 checks passed
@celdrake celdrake deleted the EDM-4145-name-display-helper-text branch June 29, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants