You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/05 13:23:25 UTC

[GitHub] [airflow] ryanahamilton commented on a diff in pull request #22742: Improve selection rerenders

ryanahamilton commented on code in PR #22742:
URL: https://github.com/apache/airflow/pull/22742#discussion_r842779573


##########
airflow/www/static/js/tree/StatusBox.jsx:
##########
@@ -46,20 +45,21 @@ export const SimpleStatus = ({ state, ...rest }) => (
 );
 
 const StatusBox = ({
-  group, instance,
+  group, instance, onSelect,
 }) => {
   const containerRef = useContainerRef();
-  const { selected, onSelect } = useSelection();
   const { runId, taskId } = instance;
   const { colors } = useTheme();
   const hoverBlue = `${colors.blue[100]}50`;
 
   // Fetch the corresponding column element and set its background color when hovering
   const onMouseEnter = () => {
-    if (selected.runId !== runId) {
-      [...containerRef.current.getElementsByClassName(`js-${runId}`)]
-        .forEach((e) => { e.style.backgroundColor = hoverBlue; });
-    }
+    [...containerRef.current.getElementsByClassName(`js-${runId}`)]
+      .forEach((e) => {
+        const bg = window.getComputedStyle(e).backgroundColor;
+        // Don't apply hover if it is already selected
+        if (bg !== 'rgb(190, 227, 248)') e.style.backgroundColor = hoverBlue;

Review Comment:
   I wonder if some sort of data attribute could be used to check this state? This seems a little fragile to be checking the color of the background.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org