Skip to content

Conversation

@XiyunZhao
Copy link

Before:
ai_2

Now:
ai_2

@openshift-ci openshift-ci bot requested review from cajieh and rhamilto November 21, 2025 08:08
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: XiyunZhao
Once this PR has been reviewed and has the lgtm label, please assign rawagner for approval. For more information see the Code Review Process.

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

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 component/core Related to console core functionality label Nov 21, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

Walkthrough

Applied inline layout styles to the edit YAML settings modal to prevent wrapping: set flexWrap: 'nowrap' on the modal's Flex container and whiteSpace: 'nowrap' on the following SplitItem.

Changes

Cohort / File(s) Summary
Layout styling updates
frontend/public/components/modals/edit-yaml-settings-modal.tsx
Added inline CSS properties (flexWrap: 'nowrap' and whiteSpace: 'nowrap') to prevent item and text wrapping in the modal layout

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Focus review on the single modified component file to confirm no unintended layout regressions across responsive breakpoints.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between aa98e3f and 2bc6e8d.

📒 Files selected for processing (1)
  • frontend/public/components/modals/edit-yaml-settings-modal.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/public/components/modals/edit-yaml-settings-modal.tsx

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

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 057ffde and aa98e3f.

📒 Files selected for processing (1)
  • frontend/public/components/modals/edit-yaml-settings-modal.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/public/components/modals/edit-yaml-settings-modal.tsx
🔇 Additional comments (1)
frontend/public/components/modals/edit-yaml-settings-modal.tsx (1)

85-85: LGTM – Low-risk alignment fix.

The whiteSpace: 'nowrap' style on the SplitItem containing the Switch prevents the toggle label from wrapping, maintaining proper alignment. Since the labels are just "On"/"Off" (very short text), the risk of overflow is minimal.

Comment on lines +71 to +75
<Flex
alignItems={{ default: 'alignItemsCenter' }}
spaceItems={{ default: 'spaceItemsMd' }}
style={{ flexWrap: 'nowrap' }}
>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

Verify responsive behavior on narrow viewports.

The flexWrap: 'nowrap' inline style fixes the reported layout issue by preventing the icon and text from wrapping. However, on narrow viewports or small screens, this could cause horizontal overflow if the description text is lengthy.

Please test the modal on various screen sizes (mobile, tablet) to ensure the content doesn't overflow or cause horizontal scrolling. Consider whether the modal needs a minimum width or if text truncation with ellipsis would be a better fallback for very narrow screens.


🏁 Script executed:

#!/bin/bash
# Verify if PatternFly's Modal component with variant="small" has responsive handling

# Search for Modal usage patterns and responsive utilities in the codebase
rg -nP --type=tsx --type=ts -C3 'Modal.*variant.*small|pf-v6-u-text-truncate|pf-v6-u-text-nowrap' -g '!node_modules' -g '!dist'

Length of output: 27



🏁 Script executed:

#!/bin/bash
# Correct search using glob patterns for tsx/ts files
# 1. Examine the actual file being modified
echo "=== Examining the modified file ==="
cat "frontend/public/components/modals/edit-yaml-settings-modal.tsx" | head -120 | tail -60

echo -e "\n=== Searching for Modal variant patterns ==="
rg -nP -g '*.tsx' -g '*.ts' 'Modal.*variant' -C2 | head -50

echo -e "\n=== Searching for flexWrap or nowrap patterns ==="
rg -nP -g '*.tsx' -g '*.ts' 'flexWrap|nowrap' -C2 | head -50

Length of output: 9266


🏁 Script executed:

#!/bin/bash
# Check PatternFly documentation for responsive Modal behavior
# This queries external resources about PatternFly Modal component
echo "Checking PatternFly Modal responsive behavior patterns..."
curl -s "https://www.patternfly.org/components/modal" 2>/dev/null | grep -i "responsive\|small\|width" | head -20 || echo "Could not fetch external documentation"

Length of output: 57



🌐 Web query:

PatternFly Modal variant small responsive width behavior

💡 Result:

Short answer: PatternFly's "small" modal is implemented as a responsive max-width, not a fixed pixel width. By default the modal box width is calc(100% - spacer) and each variant sets a max‑width; the small variant's max‑width is 35rem (so it will shrink on narrow viewports and center until it reaches that max). You can override with the Modal's width prop or by changing the --pf-c-modal-box--m-sm--sm--MaxWidth (or the general --pf-c-modal-box--MaxWidth) CSS variable. [1][2]

Sources:

  • PatternFly Modal docs and CSS variables (shows default width and --pf-c-modal-box--m-sm--sm--MaxWidth = 35rem). [1]
  • PatternFly Elements / Modal (notes variant controls width and lists same CSS custom properties). [2]

🌐 Web query:

PatternFly Flex component flexWrap responsive design

💡 Result:

Short answer — PatternFly supports responsive flex wrapping both in CSS classes and in the React Flex API.

  • CSS / utility approach: use the Flex layout classes and breakpoint modifiers (e.g. .pf-l-flex with modifier classes like .pf-m-column-on-lg, and related responsive modifiers) to control direction/wrapping at breakpoints. See the layout docs for examples and available breakpoint modifiers. [1]

  • React component approach: the Flex component exposes a flexWrap prop you can set responsively with breakpoint keys (default, sm, md, lg, xl, 2xl). Allowed values: 'wrap', 'wrapReverse', 'nowrap'. Example:
    <Flex flexWrap={{ default: 'wrap', lg: 'nowrap' }}>...
    This will apply wrap by default and switch to nowrap at the lg breakpoint. [2]

Sources:
[1] PatternFly Flex layout documentation (classes / responsive modifiers).
[2] PatternFly Flex component props (flexWrap API).


🌐 Web query:

PatternFly Split layout component narrow viewport handling

💡 Result:

Short answer — Split doesn't automatically stack at narrow widths; use wrapping or a different layout.

  • PatternFly Split lays items horizontally and will shrink items unless you enable wrapping. Use the pf-m-wrap / isWrappable option on Split to allow items to wrap to new lines on narrow viewports. [1][2]
  • Mark the item that should take remaining space with .pf-m-fill / isFilled so layout behaves predictably when space is constrained. [2]
  • If you want a true stacked (vertical) behavior on small screens, use a layout/component that switches orientation (for example Sidebar uses a stack orientation on small screens by default), or switch between Split and Stack responsively in your markup/CSS. [3]
    References
  1. PatternFly — Split (design guidelines). [1]
  2. PatternFly — Split (HTML / React props). [2]
  3. PatternFly — Sidebar (orientation: stack on small screens). [3]

Use PatternFly's responsive flexWrap API instead of inline style.

The flexWrap: 'nowrap' inline style prevents responsive behavior. PatternFly Flex component supports responsive flexWrap through breakpoint keys (e.g., flexWrap={{ default: 'wrap', lg: 'nowrap' }}), which would allow text to wrap on small screens and prevent wrapping only on larger viewports.

Change:

style={{ flexWrap: 'nowrap' }}

To:

flexWrap={{ default: 'wrap', lg: 'nowrap' }}

This ensures the modal content adapts properly on mobile devices while maintaining the horizontal layout on desktop screens.

🤖 Prompt for AI Agents
In frontend/public/components/modals/edit-yaml-settings-modal.tsx around lines
71 to 75, replace the inline style that forces non-wrapping with PatternFly's
responsive flexWrap prop so the layout can wrap on small screens and only stay
nowrap on large viewports; remove style={{ flexWrap: 'nowrap' }} and add
flexWrap={{ default: 'wrap', lg: 'nowrap' }} to the Flex component so text wraps
on mobile but remains horizontal on desktop.

@yapei
Copy link
Contributor

yapei commented Nov 21, 2025

/retitle OCPBUGS-65812: Layout issue on YAML editor settings popup window

@openshift-ci openshift-ci bot changed the title OCPBUGS-65812 Layout issue on YAML editor settings popup window w… OCPBUGS-65812: Layout issue on YAML editor settings popup window Nov 21, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Nov 21, 2025
@openshift-ci-robot
Copy link
Contributor

@XiyunZhao: This pull request references Jira Issue OCPBUGS-65812, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Before:
ai_2

Now:
ai_2

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
Copy link
Contributor

openshift-ci bot commented Nov 21, 2025

@XiyunZhao: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Copy link
Member

@logonoff logonoff left a comment

Choose a reason for hiding this comment

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

FYI this is going to conflict with #15735

@XiyunZhao
Copy link
Author

@logonoff thanks for the info, close the PR now

@XiyunZhao XiyunZhao closed this Nov 24, 2025
@openshift-ci-robot
Copy link
Contributor

@XiyunZhao: This pull request references Jira Issue OCPBUGS-65812. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state.

In response to this:

Before:
ai_2

Now:
ai_2

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-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 24, 2025
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

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

component/core Related to console core functionality jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants