Skip to content

[release-4.22] OCPBUGS-100317: Fix pod terminal not rendering until resize - #16892

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.22from
Leo6Leo:OCPBUGS-84649-terminal-fit-4.22
Jul 31, 2026
Merged

[release-4.22] OCPBUGS-100317: Fix pod terminal not rendering until resize#16892
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.22from
Leo6Leo:OCPBUGS-84649-terminal-fit-4.22

Conversation

@Leo6Leo

@Leo6Leo Leo6Leo commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #16498 to release-4.22.

  • Bug: https://issues.redhat.com/browse/OCPBUGS-100317
  • Replace setTimeout(0) + fitAddon.fit() with a ResizeObserver (via PatternFly's getResizeObserver) to fix the race condition between xterm fitting and React 18's batched state updates
  • The terminal container starts with 0x0 dimensions; fit() was firing before the DOM had correct dimensions, leaving xterm unable to render until a manual window resize

Test plan

  • Navigate to Workloads → Pods → select a running pod → Terminal tab
  • Verify the shell prompt appears immediately without needing to resize the browser window
  • Resize the browser window — terminal should re-fit correctly
  • Click Expand (fullscreen) — terminal should fill the viewport
  • Click Collapse — terminal should return to normal size
  • Switch containers (if pod has multiple) — new terminal should render promptly

🤖 Generated with Claude Code

The terminal container starts with 0x0 dimensions and uses
setTimeout(0) to call fitAddon.fit() after setting new dimensions
via React state. This races with React 18's batched state updates —
fit() can fire before the DOM has the correct dimensions, leaving
xterm unable to render content until a manual resize event.

Replace setTimeout(0) with a ResizeObserver (via PatternFly's
getResizeObserver) that fires precisely when the container's actual
DOM dimensions change, guaranteeing fit() always sees the correct
size.

Backport of openshift#16498

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added 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 Jul 30, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@Leo6Leo: This pull request references Jira Issue OCPBUGS-100317, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.

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

Backport of #16498 to release-4.22.

  • Bug: https://issues.redhat.com/browse/OCPBUGS-100317
  • Replace setTimeout(0) + fitAddon.fit() with a ResizeObserver (via PatternFly's getResizeObserver) to fix the race condition between xterm fitting and React 18's batched state updates
  • The terminal container starts with 0x0 dimensions; fit() was firing before the DOM had correct dimensions, leaving xterm unable to render until a manual window resize

Test plan

  • Navigate to Workloads → Pods → select a running pod → Terminal tab
  • Verify the shell prompt appears immediately without needing to resize the browser window
  • Resize the browser window — terminal should re-fit correctly
  • Click Expand (fullscreen) — terminal should fill the viewport
  • Click Collapse — terminal should return to normal size
  • Switch containers (if pod has multiple) — new terminal should render promptly

🤖 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.

@Leo6Leo Leo6Leo changed the title OCPBUGS-100317: Fix pod terminal not rendering until resize [release-4.22] OCPBUGS-100317: Fix pod terminal not rendering until resize Jul 30, 2026
@openshift-ci
openshift-ci Bot requested review from cajieh and spadgett July 30, 2026 22:07
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Jul 30, 2026
@Leo6Leo

Leo6Leo commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jul 30, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

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

7 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 New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-84649 is in the state MODIFIED, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-84649 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents

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

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.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jul 30, 2026

@logonoff logonoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Jul 30, 2026
@logonoff

Copy link
Copy Markdown
Member

/label backport-risk-assessed

Pls self verify

@openshift-ci openshift-ci Bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Jul 30, 2026
@Leo6Leo

Leo6Leo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/verified by @Leo6Leo

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@Leo6Leo: This PR has been marked as verified by @Leo6Leo.

Details

In response to this:

/verified by @Leo6Leo

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 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@Leo6Leo: 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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 3890974 into openshift:release-4.22 Jul 31, 2026
7 checks passed
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@Leo6Leo: Jira Issue Verification Checks: Jira Issue OCPBUGS-100317
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-100317 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

Summary

Backport of #16498 to release-4.22.

  • Bug: https://issues.redhat.com/browse/OCPBUGS-100317
  • Replace setTimeout(0) + fitAddon.fit() with a ResizeObserver (via PatternFly's getResizeObserver) to fix the race condition between xterm fitting and React 18's batched state updates
  • The terminal container starts with 0x0 dimensions; fit() was firing before the DOM had correct dimensions, leaving xterm unable to render until a manual window resize

Test plan

  • Navigate to Workloads → Pods → select a running pod → Terminal tab
  • Verify the shell prompt appears immediately without needing to resize the browser window
  • Resize the browser window — terminal should re-fit correctly
  • Click Expand (fullscreen) — terminal should fill the viewport
  • Click Collapse — terminal should return to normal size
  • Switch containers (if pod has multiple) — new terminal should render promptly

🤖 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.

@Leo6Leo

Leo6Leo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.21

@openshift-cherrypick-robot

Copy link
Copy Markdown

@Leo6Leo: new pull request created: #16893

Details

In response to this:

/cherry-pick release-4.20

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.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@Leo6Leo: new pull request created: #16894

Details

In response to this:

/cherry-pick release-4.21

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.

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Fix included in release 4.22.0-0.nightly-2026-07-31-081336

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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. component/core Related to console core functionality 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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants