guan404ming commented on code in PR #55611:
URL: https://github.com/apache/airflow/pull/55611#discussion_r2352736336
##########
airflow-core/src/airflow/ui/src/layouts/Details/Grid/GridTI.tsx:
##########
@@ -40,27 +41,32 @@ type Props = {
readonly taskId: string;
};
-const onMouseEnter = (event: MouseEvent<HTMLDivElement>) => {
- const tasks =
document.querySelectorAll<HTMLDivElement>(`#${event.currentTarget.id}`);
-
- tasks.forEach((task) => {
- task.style.backgroundColor = "var(--chakra-colors-brand-subtle)";
- });
-};
-
-const onMouseLeave = (event: MouseEvent<HTMLDivElement>) => {
- const tasks =
document.querySelectorAll<HTMLDivElement>(`#${event.currentTarget.id}`);
-
- tasks.forEach((task) => {
- task.style.backgroundColor = "";
- });
-};
-
const Instance = ({ dagId, instance, isGroup, isMapped, onClick, runId,
search, taskId }: Props) => {
+ const { setHoveredTaskId } = useHover();
const { groupId: selectedGroupId, taskId: selectedTaskId } = useParams();
const { t: translate } = useTranslation();
const location = useLocation();
+ const onMouseEnter = (event: MouseEvent<HTMLDivElement>) => {
+ const tasks =
document.querySelectorAll<HTMLDivElement>(`#${event.currentTarget.id}`);
+
+ tasks.forEach((task) => {
+ task.style.backgroundColor = "var(--chakra-colors-info-subtle)";
+ });
+
+ setHoveredTaskId(taskId);
Review Comment:
Yes, let me fix it. It does make it better, thanks!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]