Skip to content

Conversation

@MarielaTihova
Copy link
Contributor

@dkamburov dkamburov requested a review from tishko0 October 30, 2025 11:35
@DiLazarova DiLazarova added the ✅ status: verified Applies to PRs that have passed manual verification label Oct 30, 2025
@tishko0 tishko0 requested review from mddragnev and removed request for tishko0 October 30, 2025 12:24
Copy link
Member

@mddragnev mddragnev left a comment

Choose a reason for hiding this comment

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

Two more things:
1.
Screenshot 2025-12-05 at 12 41 42
Entering full screen mode there is an additional scrollbar.

  1. All the checks whether window/document is defined are redundant here because we are using client side code in the entire file. Event if we migrate this project to SSR we should either refactor the whole file or mark it as 'use client'. However, this is something that I can live with so just FYI

downloadLink: string;
}

interface TabItemProps {
Copy link
Member

Choose a reason for hiding this comment

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

I think having these as interfaces is much more readable than putting them as types of the arguments in the component

document.exitFullscreen?.() ||
(document as any).webkitExitFullscreen?.();

const checkFullscreen = () =>
Copy link
Member

Choose a reason for hiding this comment

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

Two identical functions checkFullScreen.

return;
if (typeof window === "undefined" || typeof document === "undefined") return;

const checkFullscreen = () =>
Copy link
Member

Choose a reason for hiding this comment

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

Why is this a function?

setActiveView(location.pathname.replace("/home/", ""));
}, [location]);

useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

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

What I dont like in this useEffect is that it is too complicated. Do you really need to reattach the event listeners for fullscreen handling on each location change? Isn't it better to split up the Effect into two separate so that the event listeners are added only once, and then the tabs logic is changed on location? Also I dont think that we need all this state. There might be some state that can be derived but this is probably not the time for this.


const onToggleFullscreen = async () => {
if (typeof document === "undefined") return;
const onToggleFullscreen = useCallback(async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need useCallback here?

await exitFullscreen();
}

setIsFullscreen(checkFullscreen());
Copy link
Member

Choose a reason for hiding this comment

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

Do you need to set it here as well?
You have some event listeners in the effect that should take care of changing the state

setIsChartsSection(false);
}

setActiveView(path);
Copy link
Member

Choose a reason for hiding this comment

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

There is a usEffect above that does the same thing? Why dont you remove the one above?
Edit: As I am looking at this, couldnt activeView be a derived variable instead of state?

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

Labels

✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants