Skip to content

Conversation

@Arpit529Srivastava
Copy link
Member

Description

fixed the build error in the frontend

Related Issue

Fixes #<issue_number>

Changes Made

  • Updated ...
  • Refactored ...
  • Fixed ...
  • Added tests for ...

Checklist

Please ensure the following before submitting your PR:

  • I have reviewed the project's contribution guidelines.
  • I have written unit tests for the changes (if applicable).
  • I have updated the documentation (if applicable).
  • I have tested the changes locally and ensured they work as expected.
  • My code follows the project's coding standards.

Screenshots or Logs (if applicable)

Additional Notes

Copilot AI review requested due to automatic review settings December 20, 2025 20:00
@kubestellar-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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

@kubestellar-prow kubestellar-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 20, 2025
@kubestellar-prow
Copy link

@Arpit529Srivastava: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubestellar-ui-build bdaf2f8 link true /test pull-kubestellar-ui-build

Full PR test history

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR attempts to fix a build error by removing the | null union type from React ref types for terminal elements. However, this change introduces a type safety issue. The refs are initialized with null in the parent component (WecsDetailsPanel.tsx), and React's RefObject type correctly requires the current property to be nullable until it's attached to a DOM element.

Key Changes:

  • Updated terminalRef type in LogsTab from React.RefObject<HTMLDivElement | null> to React.RefObject<HTMLDivElement>
  • Updated execTerminalRef type in ExecTab from React.RefObject<HTMLDivElement | null> to React.RefObject<HTMLDivElement>

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
frontend/src/components/wecs_details/tabs/LogsTab.tsx Removed null union type from terminalRef prop type
frontend/src/components/wecs_details/tabs/ExecTab.tsx Removed null union type from execTerminalRef prop type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

theme: string;
t: (key: string, options?: Record<string, unknown>) => string;
terminalRef: React.RefObject<HTMLDivElement | null>;
terminalRef: React.RefObject<HTMLDivElement>;
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The ref is initialized as useRef<HTMLDivElement>(null) in WecsDetailsPanel.tsx (line 115), which means the current property can be null. Changing the type to React.RefObject<HTMLDivElement> creates a type mismatch because RefObject.current can be null or undefined until the ref is attached to a DOM element.

The code already handles this correctly with null checks (e.g., line 66: if (!terminalRef.current || ...)), so the type should remain as React.RefObject<HTMLDivElement | null> to accurately reflect that the ref can be null.

Suggested change
terminalRef: React.RefObject<HTMLDivElement>;
terminalRef: React.RefObject<HTMLDivElement | null>;

Copilot uses AI. Check for mistakes.
loadingContainers: boolean;
isTerminalMaximized: boolean;
execTerminalRef: React.RefObject<HTMLDivElement | null>;
execTerminalRef: React.RefObject<HTMLDivElement>;
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The ref is initialized as useRef<HTMLDivElement>(null) in WecsDetailsPanel.tsx (line 116), which means the current property can be null. Changing the type to React.RefObject<HTMLDivElement> creates a type mismatch because RefObject.current can be null or undefined until the ref is attached to a DOM element.

The code already handles this correctly with null checks (e.g., lines 85, 100, 138: checking for !execTerminalRef.current), so the type should remain as React.RefObject<HTMLDivElement | null> to accurately reflect that the ref can be null.

Suggested change
execTerminalRef: React.RefObject<HTMLDivElement>;
execTerminalRef: React.RefObject<HTMLDivElement | null>;

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

yes understood made the change and closing the PR.

@github-project-automation github-project-automation bot moved this from In Progress to Done in KubeStellar UI Project Dec 20, 2025
@Arpit529Srivastava Arpit529Srivastava deleted the build-errors branch December 22, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant