geido commented on code in PR #44144:
URL: https://github.com/apache/superset/pull/44144#discussion_r4013595427


##########
superset/utils/screenshot_utils.py:
##########
@@ -488,6 +492,21 @@ def _unready_chart_holders_js_body(*, viewport_only: bool) 
-> str:
     f"() => {{ {UNREADY_ALL_CHART_HOLDERS_JS_BODY} "
     "return holders.length > 0 && unready.length === 0; }"
 )
+# API/UI exports capture the selected tab state from a permalink. A selected
+# tab may intentionally contain no charts, so layout hydration is the non-
+# vacuous mount signal while holder readiness applies to every chart actually
+# rendered by that state.
+DASHBOARD_LAYOUT_READY_JS = "() => document.querySelector('.dashboard-grid') 
!== null"
+DASHBOARD_CHART_HOLDERS_READY_JS = (
+    "() => { if (document.querySelector('.dashboard-grid') === null) "
+    f"return false; {UNREADY_CHART_HOLDERS_JS_BODY} "
+    "return unready.length === 0; }"

Review Comment:
   Checked and intentionally unchanged in a55d5eb89c. The .dashboard-grid node 
and its selected layout children are emitted by the same DashboardGrid render; 
asynchronous chart work happens inside an already-mounted holder. Requiring 
holders.length > 0 would reject valid empty dashboards and chart-free selected 
tabs. The strict predicate still needs a hydrated grid, applies a 500ms stable 
dwell, and the rebuilt Docker matrix proves empty, chart-free, in-grid 
non-first, nested non-first, and top-level non-first states.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to