Skip to content

OCPBUGS-77423: Fix extra space in PageHeading when no actions present#16072

Open
rhamilto wants to merge 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-77423
Open

OCPBUGS-77423: Fix extra space in PageHeading when no actions present#16072
rhamilto wants to merge 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-77423

Conversation

@rhamilto
Copy link
Member

@rhamilto rhamilto commented Feb 26, 2026

Summary

  • Fixed extra whitespace appearing at the top of pages when PageHeading has neither a favorite button nor primary action
  • Moved conditional rendering to wrap the ActionList component instead of rendering an empty list

After

Screenshot 2026-02-26 at 10 45 06 AM

Details

Previously, the ActionList component was always rendered in the actionMenu prop, even when it had no children. This caused unnecessary spacing at the top of pages like the Project access tab.

The fix moves the conditional check outside the ActionList, so it only renders when there's actual content to display (favorite button or primary action).

Test plan

  • Navigate to Developer perspective
  • Select a project and go to the "Access" tab at /project-details/ns/{namespace}/access
  • Verify there is no extra whitespace at the top of the page
  • Check other pages using PageHeading to ensure no regression

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Improved performance of page heading component rendering by optimizing when action menus are constructed.

Prevent rendering empty ActionList component when neither favorite
button nor primary action is present, which was causing extra
whitespace at the top of pages like the Project access tab.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Feb 26, 2026
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-77423, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

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

Details

In response to this:

Summary

  • Fixed extra whitespace appearing at the top of pages when PageHeading has neither a favorite button nor primary action
  • Moved conditional rendering to wrap the ActionList component instead of rendering an empty list

Details

Previously, the ActionList component was always rendered in the actionMenu prop, even when it had no children. This caused unnecessary spacing at the top of pages like the Project access tab.

The fix moves the conditional check outside the ActionList, so it only renders when there's actual content to display (favorite button or primary action).

Test plan

  • Navigate to Developer perspective
  • Select a project and go to the "Access" tab at /project-details/ns/{namespace}/access
  • Verify there is no extra whitespace at the top of the page
  • Check other pages using PageHeading to ensure no regression

🤖 Generated with Claude Code

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 a review from yapei February 26, 2026 15:44
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-77423, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

Summary

  • Fixed extra whitespace appearing at the top of pages when PageHeading has neither a favorite button nor primary action
  • Moved conditional rendering to wrap the ActionList component instead of rendering an empty list

After

Screenshot 2026-02-26 at 10 45 06 AM

Details

Previously, the ActionList component was always rendered in the actionMenu prop, even when it had no children. This caused unnecessary spacing at the top of pages like the Project access tab.

The fix moves the conditional check outside the ActionList, so it only renders when there's actual content to display (favorite button or primary action).

Test plan

  • Navigate to Developer perspective
  • Select a project and go to the "Access" tab at /project-details/ns/{namespace}/access
  • Verify there is no extra whitespace at the top of the page
  • Check other pages using PageHeading to ensure no regression

🤖 Generated with Claude Code

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.

@rhamilto
Copy link
Member Author

/assign @logonoff

@openshift-ci openshift-ci bot requested review from Leo6Leo and cajieh February 26, 2026 15:45
@openshift-ci openshift-ci bot added component/shared Related to console-shared approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 26, 2026
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.

/lgtm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

The PageHeading component refactors its action menu rendering logic. Previously, the ActionList component was always instantiated with a nested conditional that determined whether to render its contents or null. The change moves the conditional check to the outer level, so ActionList is now only rendered when either a favorite button or primary action exists. The internal structure containing ActionListGroup, FavoriteButton, and primaryAction remains unchanged. This represents a control flow optimization that avoids unnecessary component instantiation when no actions are present.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary fix: removing extra whitespace in PageHeading when no actions are present, which directly aligns with the changeset's conditional rendering adjustment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

openshift-ci bot commented Feb 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logonoff, rhamilto

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

@rhamilto
Copy link
Member Author

/retest

1 similar comment
@rhamilto
Copy link
Member Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 28, 2026

@rhamilto: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

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. component/shared Related to console-shared jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants