Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/wecs_details/tabs/ExecTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
selectedContainer: string;
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.

execTerminalKey: string;
handleContainerChange: (event: SelectChangeEvent<string>) => void;
setIsContainerSelectActive: (active: boolean) => void;
Expand Down Expand Up @@ -274,7 +274,7 @@
clearTimeout(timeoutId);
if (cleanupFn) cleanupFn();
};
}, [theme, type, name, namespace, cluster, selectedContainer, execTerminalKey, t]);

Check warning on line 277 in frontend/src/components/wecs_details/tabs/ExecTab.tsx

View workflow job for this annotation

GitHub Actions / Frontend Checks

React Hook useEffect has a missing dependency: 'execTerminalRef'. Either include it or remove the dependency array

// Use available containers if containers prop is empty
const containersToUse = containers.length > 0 ? containers : [];
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/wecs_details/tabs/LogsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface LogsTabProps {
type: string;
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.
logsContainers: ContainerInfo[];
selectedLogsContainer: string;
loadingLogsContainers: boolean;
Expand Down
Loading