Skip to content

MGMT-21261: keep link to pull secret visible#3138

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
ElayAharoni:Keep-link-to-pull-secret-visible-at-all-times
Aug 26, 2025
Merged

MGMT-21261: keep link to pull secret visible#3138
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
ElayAharoni:Keep-link-to-pull-secret-visible-at-all-times

Conversation

@ElayAharoni
Copy link
Contributor

@ElayAharoni ElayAharoni commented Aug 26, 2025

https://issues.redhat.com/browse/MGMT-21261

image

Summary by CodeRabbit

  • Bug Fixes

    • TextArea fields now display error messages more clearly with an error icon.
    • Helper text and error messages are shown separately for improved clarity and consistency.
    • More reliable rendering of helper/error states across forms.
  • Refactor

    • Simplified internal rendering logic for helper and error messages to improve maintainability without changing public APIs.

Signed-off-by: Elay Aharoni <elayaha@gmail.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 26, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 26, 2025

@ElayAharoni: This pull request references MGMT-21261 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.20.0" version, but no target version was set.

Details

In response to this:

https://issues.redhat.com/browse/MGMT-21261

image

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from ammont82 and celdrake August 26, 2025 12:17
@coderabbitai
Copy link

coderabbitai bot commented Aug 26, 2025

Walkthrough

Refactors TextAreaField helper text rendering: splits the previous single conditional HelperTextItem into two independent conditionals. Renders an error HelperTextItem when errorMessage exists and a default HelperTextItem when helperText exists. aria-describedby remains set to ${fieldId}-helper. No public API/signature changes.

Changes

Cohort / File(s) Summary
Formik TextArea helper text refactor
libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx
Replace ternary-based single HelperTextItem with two conditionally rendered items: error item (ExclamationCircleIcon, variant "error", id ${fieldId}-helper-error, content errorMessage) and default item (variant "default", id ${fieldId}-helper, content helperText). Preserve aria-describedby=${fieldId}-helper. No export/signature changes.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant C as TextAreaField
  participant H as HelperTextItem

  U->>C: Render TextAreaField(props)
  alt errorMessage present
    C->>H: Render error HelperTextItem\n(id: {fieldId}-helper-error,\nvariant: error,\nicon: ExclamationCircleIcon,\ncontent: errorMessage)
  end
  alt helperText present
    C->>H: Render default HelperTextItem\n(id: {fieldId}-helper,\nvariant: default,\ncontent: helperText)
  end
  note over C: textarea aria-describedby={fieldId}-helper
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibble code like clover leaves,
Two hints now bloom where one reprieves—
An error bell, a gentle note,
Both lines beneath the text they float.
My paws approve this tidy pair,
Hop hop—clarity everywhere! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 26, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 26, 2025

@ElayAharoni: This pull request references MGMT-21261 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.20.0" version, but no target version was set.

Details

In response to this:

https://issues.redhat.com/browse/MGMT-21261

image

Summary by CodeRabbit

  • Bug Fixes

  • TextArea fields now display error messages more clearly with an error icon.

  • Helper text and error messages are shown separately for improved clarity and consistency.

  • More reliable rendering of helper/error states across forms.

  • Refactor

  • Simplified internal rendering logic for helper and error messages to improve maintainability without changing public APIs.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx (2)

56-56: Accessibility: aria-describedby does not reference the error message id.

When an error is shown, the field still points only to ${fieldId}-helper. If helperText is absent, aria-describedby points to a non-existent element; if present, screen readers won’t announce the error text. Include the error id (and helper id if present) in aria-describedby, with error first.

Apply this diff to line 56:

-        aria-describedby={`${fieldId}-helper`}
+        aria-describedby={
+          [errorMessage && `${fieldId}-helper-error`, helperText && `${fieldId}-helper`]
+            .filter(Boolean)
+            .join(' ') || undefined
+        }

Optional (further a11y enhancement): also wire aria-errormessage for explicit error association.

         validated={isValid ? 'default' : 'error'}
         isRequired={isRequired}
-        aria-describedby={`${fieldId}-helper`}
+        aria-describedby={
+          [errorMessage && `${fieldId}-helper-error`, helperText && `${fieldId}-helper`]
+            .filter(Boolean)
+            .join(' ') || undefined
+        }
+        aria-errormessage={!isValid && errorMessage ? `${fieldId}-helper-error` : undefined}

57-57: Formik integration bug: onChange handler receives (value, event), but forwards only a value-like argument to field.onChange(event).

PatternFly TextArea calls onChange with (value, event). Passing the first argument straight into Formik’s field.onChange (which expects a React event) can break updates. Prefer setValue.

Proposed fix:

-  const [field, { touched, error }] = useField(props.name);
+  const [field, { touched, error }, helpers] = useField(props.name);
...
-        onChange={(event) => field.onChange(event)}
+        onChange={(value) => helpers.setValue(value)}

This keeps blur handling from {...field} intact and ensures the Formik state updates correctly with PF’s value-first signature.

🧹 Nitpick comments (2)
libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx (2)

58-58: API consistency: use PatternFly’s isDisabled prop instead of disabled.

Using the HTML disabled attribute works because it’s passed through, but PF components conventionally expose isDisabled. This improves consistency and readability across the codebase.

-        disabled={isDisabled}
+        isDisabled={isDisabled}

60-79: Consider making the helper region a live description for error changes.

With both helper and error items rendered, announcements will happen on focus due to describedby, but dynamic updates may not be announced. If you observe SRs not announcing changes, consider adding an aria-live="polite" to the error HelperTextItem or using PF props that render an alert role (if available in your PF version).

Example (only if your PF version forwards unknown props to the item’s container):

-              <HelperTextItem
+              <HelperTextItem
+                aria-live="polite"
                 icon={<ExclamationCircleIcon />}
                 variant={'error'}
                 id={`${fieldId}-helper-error`}
               >

If PF doesn’t forward aria-live on HelperTextItem, skip this suggestion.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7fd142a and f8641e8.

📒 Files selected for processing (1)
  • libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: format
  • GitHub Check: tests
  • GitHub Check: circular-deps
  • GitHub Check: unit-tests
  • GitHub Check: translation-files
  • GitHub Check: lint
🔇 Additional comments (1)
libs/ui-lib/lib/common/components/ui/formik/TextAreaField.tsx (1)

63-76: Nice refactor: error and helper text can now co-exist.

This directly supports the “keep link to pull secret visible” requirement by rendering the helper text even when an error is present. Clean, readable, and aligns with PF HelperText patterns.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 26, 2025
@openshift-ci
Copy link

openshift-ci bot commented Aug 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: celdrake, ElayAharoni

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 26, 2025
Copy link
Contributor

@celdrake celdrake left a comment

Choose a reason for hiding this comment

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

Actually, the "aria-describedby" may need changes as described by Coderabbit.

@openshift-merge-bot openshift-merge-bot bot merged commit b93e663 into openshift-assisted:master Aug 26, 2025
11 checks passed
@jgyselov
Copy link
Contributor

jgyselov commented Sep 3, 2025

/cherry-pick releases/v2.15-cim

@openshift-cherrypick-robot
Copy link
Contributor

@jgyselov: new pull request created: #3153

Details

In response to this:

/cherry-pick releases/v2.15-cim

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants