[ 
https://issues.apache.org/jira/browse/SPARK-55764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kent Yao resolved SPARK-55764.
------------------------------
    Fix Version/s: 4.2.0
       Resolution: Fixed

Issue resolved by pull request 54560
[https://github.com/apache/spark/pull/54560]

> Use delegated event listener for Bootstrap 5 Tooltip lazy initialization
> ------------------------------------------------------------------------
>
>                 Key: SPARK-55764
>                 URL: https://issues.apache.org/jira/browse/SPARK-55764
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Web UI
>    Affects Versions: 4.2.0
>            Reporter: Kent Yao
>            Assignee: Kent Yao
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.2.0
>
>
> Currently, Bootstrap 5 tooltips are eagerly initialized on DOMContentLoaded 
> via initialize-tooltips.js, plus scattered re-initialization calls in 5+ JS 
> files (spark-dag-viz.js, timeline-view.js, etc.) after dynamic content 
> renders.
> Proposed improvement: Replace eager tooltip initialization with a single 
> delegated mouseover event listener that lazily creates Tooltip instances on 
> first hover.
> Benefits:
> - Single source of truth — no per-page boilerplate or re-init calls
> - Handles dynamically rendered content automatically (DAG viz, timeline, 
> tables)
> - Better performance — only creates Tooltip for elements actually hovered
> - Simpler code — remove scattered new bootstrap.Tooltip() calls
> Implementation approach:
> {code:javascript}
> document.addEventListener('mouseover', function(e) {
>   var el = e.target.closest('[data-bs-toggle="tooltip"]');
>     new bootstrap.Tooltip(el);
>     el.dispatchEvent(new MouseEvent('mouseover'));
>   }
> }, { passive: true });
> {code}
> Part of SPARK-55760 (Spark Web UI Modernization)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to