From 38fecec459a6ed195c771540bab9367835f968c8 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Thu, 10 Mar 2022 18:00:05 -0300 Subject: [PATCH] 16672: Improves UX by avoiding to instantly focus on a MPV panel. 100ms seems "instant enough" for cases where the user is really attempting to use the multi-panel-view task bar. For other cases where the user casually hovers through any of the buttons because is trying to reach some different part of the UI, not making the UI "move" is a lot less confusing. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- .../multi-panel-view/multi-panel-view.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/multi-panel-view/multi-panel-view.tsx b/src/components/multi-panel-view/multi-panel-view.tsx index 185c3b90..6fb3cc49 100644 --- a/src/components/multi-panel-view/multi-panel-view.tsx +++ b/src/components/multi-panel-view/multi-panel-view.tsx @@ -112,7 +112,7 @@ const MPVContainerComponent = ({children, panelStates, classes, ...props}: MPVCo children = [children]; } const visibility = (children as ReactNodeArray).map((_, idx) => - !!!panelStates || // if panelStates wasn't passed, default to all visible panels + !panelStates || // if panelStates wasn't passed, default to all visible panels (panelStates[idx] && (panelStates[idx].visible || panelStates[idx].visible === undefined))); const [panelVisibility, setPanelVisibility] = useState(visibility); @@ -159,13 +159,20 @@ const MPVContainerComponent = ({children, panelStates, classes, ...props}: MPVCo const panelIsMaximized = panelVisibility[idx] && panelVisibility.filter(e => e).length === 1; + let brightenerTimer: NodeJS.Timer; toggles = [ ...toggles,