Skip to content

Comments

OCPBUGS-77054, OCPBUGS-55742: Fix Add page issues#16045

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

OCPBUGS-77054, OCPBUGS-55742: Fix Add page issues#16045
rhamilto wants to merge 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-77054

Conversation

@rhamilto
Copy link
Member

@rhamilto rhamilto commented Feb 18, 2026

Summary

This PR fixes multiple issues on the Add page:

  • Console accessibility errors for Card components requiring aria labels
  • Add page cards not appearing on first load
  • Add page cards not clickable
  • Infinite re-rendering of masonry layout components when browser DevTools is open

Note: the bugs only occur when the browser's inspector is open!

After

Screen.Recording.2026-02-18.at.4.03.06.PM.mov

Changes

Accessibility and PatternFly 6 Compatibility Fixes

  1. GettingStartedExpandableGrid: Removed unnecessary isClickable/isSelectable props that require aria labels
  2. AddCard: Added isControlled={false} to SimpleList (PatternFly default behavior changed)
  3. AddCardItem:
    • Replaced deprecated navigateTo with useNavigate hook
    • Added e.preventDefault() to onClick handler

Masonry Layout Fixes

  1. Masonry: Moved MeasuredItem component outside render function (fixes infinite re-rendering when DevTools is open)
  2. Masonry: Added height change check in setHeight to prevent unnecessary state updates
  3. MasonryLayout: Added requestAnimationFrame for initial measurement to ensure DOM is ready

Performance Optimizations

  • Wrapped AddCard, AddCardItem, and MeasuredItem in memo to prevent unnecessary re-renders
  • Memoized addCards array in AddCardSection to prevent recreating on every render
  • Added debouncing to resize events with proper cleanup
  • Added proper cleanup for RAF and timeouts

Test plan

  • Visit the Add page and verify no console errors appear
  • Reload the page and verify cards appear immediately on first load
  • Click on add cards and verify navigation works correctly
  • Open browser DevTools and verify no constant re-rendering of masonry components
  • Resize browser window and verify layout adjusts smoothly without flickering

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • More robust resize and measurement handling to prevent layout glitches and unnecessary recalculations.
  • Changes

    • Cards no longer expose clickable/selectable behavior.
    • Card item navigation now respects modified-clicks and reliably navigates or invokes item actions.
  • Performance

    • Reduced re-renders via memoization and guarded height/resize updates; debounced resize handling for smoother layout.
  • Tests

    • Updated tests to await asynchronous layout and resize effects.

@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 18, 2026
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-77054, 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

This PR fixes multiple regressions introduced by the PatternFly 6.4.0 upgrade on the Add page:

  • Console accessibility errors for Card components requiring aria labels
  • Add page cards not appearing on first load
  • Add page cards not clickable
  • Infinite re-rendering of masonry layout components causing scrollbar flickering

Changes

Critical Fixes

  1. GettingStartedExpandableGrid: Removed unnecessary isClickable/isSelectable props that require aria labels
  2. AddCard: Added isControlled={false} to SimpleList (PatternFly 6.4.0 changed default from false to true)
  3. AddCardItem:
  • Replaced deprecated navigateTo with useNavigate hook
  • Added e.preventDefault() to onClick handler
  1. Masonry: Moved MeasuredItem component outside render function (root cause of infinite re-rendering)
  2. Masonry: Added height change check in setHeight to prevent unnecessary state updates
  3. MasonryLayout: Added requestAnimationFrame for initial measurement to ensure DOM is ready

Performance Optimizations

  • Wrapped AddCard, AddCardItem, and MeasuredItem in memo to prevent unnecessary re-renders
  • Memoized addCards array in AddCardSection to prevent recreating on every render
  • Added debouncing to resize events with proper cleanup
  • Added proper cleanup for RAF and timeouts

Test plan

  • Visit the Add page and verify no console errors appear
  • Reload the page and verify cards appear immediately on first load
  • Click on add cards and verify navigation works correctly
  • Open browser DevTools and verify no constant re-rendering of masonry components
  • Resize browser window and verify layout adjusts smoothly without flickering

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

@rhamilto: This pull request references Jira Issue OCPBUGS-77054, 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

This PR fixes multiple regressions introduced by the PatternFly 6.4.0 upgrade on the Add page:

  • Console accessibility errors for Card components requiring aria labels
  • Add page cards not appearing on first load
  • Add page cards not clickable
  • Infinite re-rendering of masonry layout components causing scrollbar flickering

After

Screen.Recording.2026-02-18.at.4.03.06.PM.mov

Changes

Critical Fixes

  1. GettingStartedExpandableGrid: Removed unnecessary isClickable/isSelectable props that require aria labels
  2. AddCard: Added isControlled={false} to SimpleList (PatternFly 6.4.0 changed default from false to true)
  3. AddCardItem:
  • Replaced deprecated navigateTo with useNavigate hook
  • Added e.preventDefault() to onClick handler
  1. Masonry: Moved MeasuredItem component outside render function (root cause of infinite re-rendering)
  2. Masonry: Added height change check in setHeight to prevent unnecessary state updates
  3. MasonryLayout: Added requestAnimationFrame for initial measurement to ensure DOM is ready

Performance Optimizations

  • Wrapped AddCard, AddCardItem, and MeasuredItem in memo to prevent unnecessary re-renders
  • Memoized addCards array in AddCardSection to prevent recreating on every render
  • Added debouncing to resize events with proper cleanup
  • Added proper cleanup for RAF and timeouts

Test plan

  • Visit the Add page and verify no console errors appear
  • Reload the page and verify cards appear immediately on first load
  • Click on add cards and verify navigation works correctly
  • Open browser DevTools and verify no constant re-rendering of masonry components
  • Resize browser window and verify layout adjusts smoothly without flickering

🤖 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 added the component/dev-console Related to dev-console label Feb 18, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 18, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@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 18, 2026
@rhamilto rhamilto changed the title OCPBUGS-77054: Fix Add page PatternFly 6.4.0 regression OCPBUGS-77054: Fix Add page issues with PF 6.4.0 and masonry layout Feb 18, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

📝 Walkthrough

Walkthrough

The PR refactors add-flow and related UI: wraps AddCard and AddCardItem with React.memo; replaces navigateTo with useNavigate and adds guarded click behavior in AddCardItem; removes isClickable and isSelectable props from the Card in GettingStartedExpandableGrid; memoizes add-card list in AddCardSection with useMemo; introduces a memoized MeasuredItem and stable height tracking in Masonry; adds debounced resize handling, RAF scheduling, and ResizeObserver cleanup in MasonryLayout; updates MasonryLayout tests to async waitFor patterns.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title references two Jira issues and broadly states 'Fix Add page issues,' but the substantial changes include performance optimizations (memoization, debouncing), accessibility improvements (removed props, replaced deprecated APIs), and Masonry layout fixes—key details obscured by generic 'issues' phrasing. Consider a more specific title like 'OCPBUGS-77054: Fix Add page infinite re-renders and accessibility issues' to better convey the scope and primary changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 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.

Copy link
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/packages/dev-console/src/components/add/AddCardItem.tsx`:
- Around line 51-68: In the AddCardItem component's onClick handler, avoid
calling e.preventDefault() for modified clicks (metaKey/ctrlKey/shiftKey/altKey
or middle-button e.button === 1) when an href is present so the browser can open
links in a new tab/window; update the handler in AddCardItem (the onClick that
uses fireTelemetryEvent, resolvedHref, navigate, callback, namespace, toast, id,
label) to first detect modifiedClick = e.metaKey || e.ctrlKey || e.shiftKey ||
e.altKey || e.button === 1, still call fireTelemetryEvent, and if href and
modifiedClick do not preventDefault or call navigate/callback (just return)
while preserving the existing behavior for non-modified clicks (preventDefault,
navigate(resolvedHref(...)) or callback(...)).

@rhamilto rhamilto changed the title OCPBUGS-77054: Fix Add page issues with PF 6.4.0 and masonry layout OCPBUGS-77054: Fix Add page accessibility errors and masonry layout issues Feb 18, 2026
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-77054, 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

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

Details

In response to this:

Summary

This PR fixes multiple issues on the Add page:

  • Console accessibility errors for Card components requiring aria labels
  • Add page cards not appearing on first load
  • Add page cards not clickable
  • Infinite re-rendering of masonry layout components when browser DevTools is open

After

Screen.Recording.2026-02-18.at.4.03.06.PM.mov

Changes

Accessibility and PatternFly 6 Compatibility Fixes

  1. GettingStartedExpandableGrid: Removed unnecessary isClickable/isSelectable props that require aria labels
  2. AddCard: Added isControlled={false} to SimpleList (PatternFly default behavior changed)
  3. AddCardItem:
  • Replaced deprecated navigateTo with useNavigate hook
  • Added e.preventDefault() to onClick handler

Masonry Layout Fixes

  1. Masonry: Moved MeasuredItem component outside render function (fixes infinite re-rendering when DevTools is open)
  2. Masonry: Added height change check in setHeight to prevent unnecessary state updates
  3. MasonryLayout: Added requestAnimationFrame for initial measurement to ensure DOM is ready

Performance Optimizations

  • Wrapped AddCard, AddCardItem, and MeasuredItem in memo to prevent unnecessary re-renders
  • Memoized addCards array in AddCardSection to prevent recreating on every render
  • Added debouncing to resize events with proper cleanup
  • Added proper cleanup for RAF and timeouts

Test plan

  • Visit the Add page and verify no console errors appear
  • Reload the page and verify cards appear immediately on first load
  • Click on add cards and verify navigation works correctly
  • Open browser DevTools and verify no constant re-rendering of masonry components
  • Resize browser window and verify layout adjusts smoothly without flickering

🤖 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 rhamilto changed the title OCPBUGS-77054: Fix Add page accessibility errors and masonry layout issues OCPBUGS-77054: Fix Add page issues Feb 18, 2026
@rhamilto
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/packages/dev-console/src/components/add/layout/Masonry.tsx`:
- Around line 35-40: The setHeight function inside the Masonry component is
recreated on every render which breaks MeasuredItem's memoization because
onHeightMeasured changes; wrap setHeight in useCallback (e.g., const setHeight =
useCallback((key, height) => { setHeights(old => { if (old[key] === height)
return old; return { ...old, [key]: height }; }); }, [setHeights])) so the
function identity is stable when passed to MeasuredItem; keep the same logic and
dependencies (use the state setter functional updater) to preserve behavior.

@rhamilto rhamilto force-pushed the OCPBUGS-77054 branch 3 times, most recently from 9780747 to 877f0ca Compare February 18, 2026 22:05
@rhamilto
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@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

🧹 Nitpick comments (1)
frontend/packages/dev-console/src/components/add/__tests__/MasonryLayout.spec.tsx (1)

124-131: Extract the debounce delay to a shared constant to keep tests in sync with implementation.

The test waits 150ms, but MasonryLayout.tsx (line 42) uses a hard-coded 100ms debounce. The test delay exceeds the actual debounce, which masks drift if the implementation changes. Extract the 100ms to an exported constant and import it in the test to ensure both stay synchronized.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@frontend/packages/dev-console/src/components/add/__tests__/MasonryLayout.spec.tsx`
around lines 124 - 131, Extract the hard-coded debounce delay in
MasonryLayout.tsx into a new exported constant (e.g., MASONRY_DEBOUNCE_MS) and
replace the inline 100ms value used by the debounce in the MasonryLayout
component with that constant; then update the test in MasonryLayout.spec.tsx to
import MASONRY_DEBOUNCE_MS and use it for the setTimeout wait (optionally add a
small buffer like +10ms if needed) so the test and implementation remain
synchronized.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/packages/dev-console/src/components/add/layout/Masonry.tsx`:
- Around line 20-27: The current useEffect in Masonry's measured item only
checks height once and relies on prop changes (itemKey/currentHeight) so DOM
height changes from internal toggles (like AddCardItem's showDetails) are
missed; replace or augment this logic with a ResizeObserver attached to
measureRef.current that watches for size changes and calls
onHeightMeasured(itemKey, newHeight) whenever the measured element's height
changes (debounce or ignore sub-pixel changes similar to the existing Math.abs >
1 check), and ensure you clean up the observer on unmount; reference measureRef,
onHeightMeasured, itemKey and currentHeight in the change so the observer
updates correctly and respects the existing minimal-change guard.

---

Nitpick comments:
In
`@frontend/packages/dev-console/src/components/add/__tests__/MasonryLayout.spec.tsx`:
- Around line 124-131: Extract the hard-coded debounce delay in
MasonryLayout.tsx into a new exported constant (e.g., MASONRY_DEBOUNCE_MS) and
replace the inline 100ms value used by the debounce in the MasonryLayout
component with that constant; then update the test in MasonryLayout.spec.tsx to
import MASONRY_DEBOUNCE_MS and use it for the setTimeout wait (optionally add a
small buffer like +10ms if needed) so the test and implementation remain
synchronized.

@rhamilto
Copy link
Member Author

@coderabbitai review

@rhamilto
Copy link
Member Author

/retest

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.

Possibly a dupe of #16041?

@rhamilto
Copy link
Member Author

Possibly a dupe of #16041?

Confirmed. This PR also has a fix for an accessibility issue in the getting started card.

@sg00dwin sg00dwin changed the title OCPBUGS-77054: Fix Add page issues OCPBUGS-77054, OCPBUGS-55742: Fix Add page issues Feb 19, 2026
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. and removed jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Feb 19, 2026
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-77054, 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

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

This pull request references Jira Issue OCPBUGS-55742, which is invalid:

  • expected the bug to target the "4.22.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.

Details

In response to this:

Summary

This PR fixes multiple issues on the Add page:

  • Console accessibility errors for Card components requiring aria labels
  • Add page cards not appearing on first load
  • Add page cards not clickable
  • Infinite re-rendering of masonry layout components when browser DevTools is open

Note: the bugs only occur when the browser's inspector is open!

After

Screen.Recording.2026-02-18.at.4.03.06.PM.mov

Changes

Accessibility and PatternFly 6 Compatibility Fixes

  1. GettingStartedExpandableGrid: Removed unnecessary isClickable/isSelectable props that require aria labels
  2. AddCard: Added isControlled={false} to SimpleList (PatternFly default behavior changed)
  3. AddCardItem:
  • Replaced deprecated navigateTo with useNavigate hook
  • Added e.preventDefault() to onClick handler

Masonry Layout Fixes

  1. Masonry: Moved MeasuredItem component outside render function (fixes infinite re-rendering when DevTools is open)
  2. Masonry: Added height change check in setHeight to prevent unnecessary state updates
  3. MasonryLayout: Added requestAnimationFrame for initial measurement to ensure DOM is ready

Performance Optimizations

  • Wrapped AddCard, AddCardItem, and MeasuredItem in memo to prevent unnecessary re-renders
  • Memoized addCards array in AddCardSection to prevent recreating on every render
  • Added debouncing to resize events with proper cleanup
  • Added proper cleanup for RAF and timeouts

Test plan

  • Visit the Add page and verify no console errors appear
  • Reload the page and verify cards appear immediately on first load
  • Click on add cards and verify navigation works correctly
  • Open browser DevTools and verify no constant re-rendering of masonry components
  • Resize browser window and verify layout adjusts smoothly without flickering

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

  • More robust resize and measurement handling to prevent layout glitches and unnecessary recalculations.

  • Changes

  • Cards no longer expose clickable/selectable behavior.

  • Card item navigation now respects modified-clicks and reliably navigates or invokes item actions.

  • Performance

  • Reduced re-renders via memoization and guarded height/resize updates; debounced resize handling for smoother layout.

  • Tests

  • Updated tests to await asynchronous layout and resize effects.

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.

@sg00dwin
Copy link
Member

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 19, 2026
@openshift-ci-robot
Copy link
Contributor

@sg00dwin: This pull request references Jira Issue OCPBUGS-77054, 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

This pull request references Jira Issue OCPBUGS-55742, 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

Details

In response to this:

/jira refresh

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

/retest

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 20, 2026
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2026
@rhamilto
Copy link
Member Author

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Feb 23, 2026
This fixes multiple issues on the Add page:

1. Console accessibility errors for Card components (PF 6.4.0)
2. Add page cards not appearing on first load
3. Add page cards not clickable (PF 6.4.0)
4. Infinite re-rendering when browser DevTools is open

PatternFly 6.4.0 compatibility changes:
- Remove unnecessary isClickable/isSelectable props from GettingStartedExpandableGrid
- Add isControlled={false} to SimpleList (PF 6.4.0 changed default to true)
- Replace navigateTo with useNavigate hook and add e.preventDefault()

Masonry layout fixes:
- Move MeasuredItem component outside render function to prevent re-creation
- Add requestAnimationFrame for initial measurement timing
- Add debouncing and proper cleanup for resize handling
- Wrap components in memo for performance optimization

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rhamilto
Copy link
Member Author

/retest

2 similar comments
@rhamilto
Copy link
Member Author

/retest

@rhamilto
Copy link
Member Author

/retest

@rhamilto
Copy link
Member Author

/assign @yapei
/assign @logonoff

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 24, 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.

let rafId: number;

// Use ResizeObserver to detect DOM height changes from internal toggles
const resizeObserver = new ResizeObserver((entries) => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: can we use useResizeObserver from console/shared or getResizeObserver from PF here?

};

const measuredItem = <MeasuredItem key={item.key ?? itemIndex} />;
const itemKey = (item.key as string) ?? itemIndex.toString();
Copy link
Member

Choose a reason for hiding this comment

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

just curious - was item.key ever undefined? do we need this fallback to fix the bug?

Comment on lines +69 to +70
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
Copy link
Member

Choose a reason for hiding this comment

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

should add a comment here to explain the eslint ignore

Comment on lines +59 to +60
// Only observe window resizes (not container resizes) to avoid
// infinite loops caused by scrollbar appearing/disappearing
Copy link
Member

@logonoff logonoff Feb 24, 2026

Choose a reason for hiding this comment

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

getResizeObserver is already "supposed" to be using RAF, but because the first param containerRefElement is undefined it's not working (since it falls back to the window resize event as there's nothing to observe).

we can probably write this cleaner if this was written to actually use a resizeobserver vs using the window resize event. thoughts?

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

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. component/dev-console Related to dev-console component/shared Related to console-shared jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants