This is an automated email from the ASF dual-hosted git repository.

sarutak pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.x by this push:
     new 805db08e72d0 [SPARK-56796][UI] Fix sticky tooltips for Stage page 
additional metrics
805db08e72d0 is described below

commit 805db08e72d0670fd2014b1ee68b0196704e085c
Author: Adithya Ajith <[email protected]>
AuthorDate: Mon May 18 13:47:58 2026 +0900

    [SPARK-56796][UI] Fix sticky tooltips for Stage page additional metrics
    
    ### What changes were proposed in this pull request?
    This PR updates the Stage page additional metrics tooltips to use 
`data-bs-trigger="hover"` 
([SPARK-56796](https://issues.apache.org/jira/browse/SPARK-56796)).
    The change is limited to the additional metrics checkbox options under 
`Show Additional Metrics`, such as `Scheduler Delay`, `Task Deserialization 
Time`, `Getting Result Time`, and `Peak Execution Memory`.
    
    ### Why are the changes needed?
    Currently, after selecting one of the Stage page additional metrics 
checkboxes, the tooltip can remain visible even after the mouse leaves the 
option.
    This happens because Bootstrap tooltips use the default `hover focus` 
trigger. When a checkbox inside the tooltip target is clicked, focus can keep 
the tooltip active after mouseleave.
    
    For these checkbox options, the tooltip should only be shown while hovering.
    
    ### Does this PR introduce _any_ user-facing change?
    Yes.
    
    In the Stage page, tooltips for `Show Additional Metrics` checkbox options 
now disappear when the mouse leaves the option after selecting it.
    
    ### How was this patch tested?
    
    Manually tested in the Spark UI Stage page:
    
    1. Opened a stage detail page.
    2. Expanded `Show Additional Metrics`.
    3. Hovered over an additional metric option to show the tooltip.
    4. Selected the checkbox.
    5. Moved the mouse away from the option.
    6. Verified that the tooltip no longer remains visible after mouseleave.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    Yes. Generated-by: OpenAI GPT-5.5 Codex
    
    ### Before the fix
    
    
https://github.com/user-attachments/assets/c2ece423-5150-4478-b4e5-0931de396085
    
    ### After the fix
    
    
https://github.com/user-attachments/assets/9dde5476-412b-461b-a35b-bc40cea943a3
    
    Closes #55771 from XdithyX/SPARK-56796.
    
    Authored-by: Adithya Ajith <[email protected]>
    Signed-off-by: Kousuke Saruta <[email protected]>
    (cherry picked from commit e20f55f5c0490e6956019a33f233bf3f8a9e28e9)
    Signed-off-by: Kousuke Saruta <[email protected]>
---
 .../org/apache/spark/ui/static/stagepage.js        | 23 ++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js 
b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
index f41a5d49f477..e7057b2d9c6a 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
@@ -26,9 +26,12 @@ import {
 
 export {setTaskThreadDumpEnabled};
 
-function setTooltip(selector, text) {
-  $(selector).attr("data-bs-toggle", "tooltip")
+function setTooltip(selector, text, trigger) {
+  var tooltip = $(selector).attr("data-bs-toggle", "tooltip")
     .attr("title", text);
+  if (trigger) {
+    tooltip.attr("data-bs-trigger", trigger);
+  }
 }
 
 var shouldBlockUI = true;
@@ -362,18 +365,18 @@ $(document).ready(function () {
     "</div>");
 
   setTooltip('#scheduler_delay', "Scheduler delay includes time to ship the 
task from the scheduler to the executor, and time to send " +
-    "the task result from the executor to the scheduler. If scheduler delay is 
large, consider decreasing the size of tasks or decreasing the size of task 
results.");
-  setTooltip('#task_deserialization_time', "Time spent deserializing the task 
closure on the executor, including the time to read the broadcasted task.");
-  setTooltip('#shuffle_read_fetch_wait_time', "Time that the task spent 
blocked waiting for shuffle data to be read from remote machines.");
-  setTooltip('#shuffle_remote_reads', "Total shuffle bytes read from remote 
executors. This is a subset of the shuffle read bytes; the remaining shuffle 
data is read locally. ");
-  setTooltip('#shuffle_write_time', "Time that the task spent writing shuffle 
data.");
-  setTooltip('#result_serialization_time', "Time spent serializing the task 
result on the executor before sending it back to the driver.");
-  setTooltip('#getting_result_time', "Time that the driver spends fetching 
task results from workers. If this is large, consider decreasing the amount of 
data returned from each task.");
+    "the task result from the executor to the scheduler. If scheduler delay is 
large, consider decreasing the size of tasks or decreasing the size of task 
results.", "hover");
+  setTooltip('#task_deserialization_time', "Time spent deserializing the task 
closure on the executor, including the time to read the broadcasted task.", 
"hover");
+  setTooltip('#shuffle_read_fetch_wait_time', "Time that the task spent 
blocked waiting for shuffle data to be read from remote machines.", "hover");
+  setTooltip('#shuffle_remote_reads', "Total shuffle bytes read from remote 
executors. This is a subset of the shuffle read bytes; the remaining shuffle 
data is read locally. ", "hover");
+  setTooltip('#shuffle_write_time', "Time that the task spent writing shuffle 
data.", "hover");
+  setTooltip('#result_serialization_time', "Time spent serializing the task 
result on the executor before sending it back to the driver.", "hover");
+  setTooltip('#getting_result_time', "Time that the driver spends fetching 
task results from workers. If this is large, consider decreasing the amount of 
data returned from each task.", "hover");
   setTooltip('#peak_execution_memory', "Execution memory refers to the memory 
used by internal data structures created during " +
     "shuffles, aggregations and joins when Tungsten is enabled. The value of 
this accumulator " +
     "should be approximately the sum of the peak sizes across all such data 
structures created " +
     "in this task. For SQL jobs, this only tracks all unsafe operators, 
broadcast joins, and " +
-    "external sort.");
+    "external sort.", "hover");
   var tasksSummary = $("#parent-container");
   getStandAloneAppId(function (appId) {
     // rendering the UI page


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

Reply via email to