You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pierrejeambrun (via GitHub)" <gi...@apache.org> on 2026/06/19 12:32:23 UTC

[PR] Fix truncated details tabs and page overflow in the grid view [airflow]

pierrejeambrun opened a new pull request, #68750:
URL: https://github.com/apache/airflow/pull/68750

   Since the Chakra UI 2.10 / React 19 upgrade, the grid view's `height: 100%` cascade no longer resolves through the `<Tabs>`/`<TabPanel>` chrome. The details tabs render taller than their visible area — content is cut off with no way to scroll to it — and the main column pushes the page footer below the viewport, so the whole page scrolls instead.
   
   This anchors the affected heights to the viewport so each details tab scrolls within its own area and the footer stays visible without a page-level scroll.
   
   **Before** — details tab content cut off, page overflows / footer pushed off-screen:
   
   **After** — details tab scrolls within its own area, footer stays in the viewport:
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
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


Re: [PR] Fix truncated details tabs and page overflow in the grid view [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #68750:
URL: https://github.com/apache/airflow/pull/68750#discussion_r3518905926


##########
airflow/www/static/js/dag/Main.tsx:
##########
@@ -199,9 +186,8 @@ const Main = () => {
   return (
     <Box
       flex={1}
-      height={`calc(100vh - ${footerHeight + headerHeight}px)`}
-      maxHeight={`calc(100vh - ${footerHeight + headerHeight}px)`}
-      minHeight="750px"

Review Comment:
   Is dropping this min intended?



-- 
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


Re: [PR] Fix truncated details tabs and page overflow in the grid view [airflow]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #68750:
URL: https://github.com/apache/airflow/pull/68750#discussion_r3518827703


##########
airflow/www/jest-globals-setup.js:
##########
@@ -45,6 +45,17 @@ if (typeof globalThis.window !== "undefined" && !globalThis.window.matchMedia) {
   };
 }
 
+// Mock ResizeObserver (not implemented in jsdom) — used by useContentHeight
+if (typeof globalThis.ResizeObserver === "undefined") {
+  globalThis.ResizeObserver = function ResizeObserver() {
+    return {
+      observe() {},
+      unobserve() {},
+      disconnect() {},
+    };
+  };
+}

Review Comment:
   The ResizeObserver mock returns a plain object from the constructor. That makes `new ResizeObserver(...) instanceof ResizeObserver` false and diverges from the real API shape, which can break tests (or libraries) that rely on constructor/class semantics. Use a class-style mock that accepts the callback parameter and provides methods on the instance.



##########
airflow/www/static/js/utils/useContentHeight.ts:
##########
@@ -0,0 +1,61 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React, { useLayoutEffect, useState } from "react";
+
+// Vertical space available to a scroll container: from where the element actually sits in the page
+// down to the body's bottom padding (the Flask footer reserve). Anchoring to the viewport this way
+// avoids the `height: 100%` cascade, which over-claims because <Tabs>/<TabPanel> have sibling chrome
+// (tab headers) on top — that cascade is what truncated the details tabs.
+const useContentHeight = (contentRef: React.RefObject<HTMLElement>) => {
+  const [height, setHeight] = useState(0);
+
+  useLayoutEffect(() => {
+    const update = () => {
+      const element = contentRef.current;
+      if (!element) return;
+      const footerReserve =
+        parseInt(
+          getComputedStyle(document.body).paddingBottom.replace("px", ""),
+          10,
+        ) || 0;

Review Comment:
   `getComputedStyle(...).paddingBottom` is already a CSS length string like "16px". Using `parseFloat(...)` avoids the extra `.replace("px", "")` and is more robust if the string format ever changes (e.g. extra whitespace).



-- 
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


Re: [PR] Fix truncated details tabs and page overflow in the grid view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #68750:
URL: https://github.com/apache/airflow/pull/68750#discussion_r3519215560


##########
airflow/www/jest-globals-setup.js:
##########
@@ -45,6 +45,17 @@ if (typeof globalThis.window !== "undefined" && !globalThis.window.matchMedia) {
   };
 }
 
+// Mock ResizeObserver (not implemented in jsdom) — used by useContentHeight
+if (typeof globalThis.ResizeObserver === "undefined") {
+  globalThis.ResizeObserver = function ResizeObserver() {
+    return {
+      observe() {},
+      unobserve() {},
+      disconnect() {},
+    };
+  };
+}

Review Comment:
   Done



##########
airflow/www/static/js/utils/useContentHeight.ts:
##########
@@ -0,0 +1,61 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React, { useLayoutEffect, useState } from "react";
+
+// Vertical space available to a scroll container: from where the element actually sits in the page
+// down to the body's bottom padding (the Flask footer reserve). Anchoring to the viewport this way
+// avoids the `height: 100%` cascade, which over-claims because <Tabs>/<TabPanel> have sibling chrome
+// (tab headers) on top — that cascade is what truncated the details tabs.
+const useContentHeight = (contentRef: React.RefObject<HTMLElement>) => {
+  const [height, setHeight] = useState(0);
+
+  useLayoutEffect(() => {
+    const update = () => {
+      const element = contentRef.current;
+      if (!element) return;
+      const footerReserve =
+        parseInt(
+          getComputedStyle(document.body).paddingBottom.replace("px", ""),
+          10,
+        ) || 0;

Review Comment:
   Done



-- 
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


Re: [PR] Fix truncated details tabs and page overflow in the grid view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #68750:
URL: https://github.com/apache/airflow/pull/68750#issuecomment-4833094897

   @potiuk Any particular reason why you closed this?
   
   CI is red but unrelated, and it's waiting for a review. Did I miss something? 


-- 
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


Re: [PR] Fix truncated details tabs and page overflow in the grid view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #68750:
URL: https://github.com/apache/airflow/pull/68750


-- 
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


Re: [PR] Fix truncated details tabs and page overflow in the grid view [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #68750: Fix truncated details tabs and page overflow in the grid view
URL: https://github.com/apache/airflow/pull/68750


-- 
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


Re: [PR] Fix truncated details tabs and page overflow in the grid view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #68750:
URL: https://github.com/apache/airflow/pull/68750#issuecomment-4875719768

   Unrelated CI failure


-- 
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


Re: [PR] Fix truncated details tabs and page overflow in the grid view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #68750:
URL: https://github.com/apache/airflow/pull/68750#discussion_r3519219339


##########
airflow/www/static/js/dag/Main.tsx:
##########
@@ -199,9 +186,8 @@ const Main = () => {
   return (
     <Box
       flex={1}
-      height={`calc(100vh - ${footerHeight + headerHeight}px)`}
-      maxHeight={`calc(100vh - ${footerHeight + headerHeight}px)`}
-      minHeight="750px"

Review Comment:
   Reverted this part. It was to not have the whole page scrollable by default even when the content doesn't need to. But it's out of scope of the current fix. 



-- 
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