[SPARK-55779][UI] Add tooltip helper utilities for Spark Web UI#54588
Open
yaooqinn wants to merge 1 commit intoapache:masterfrom
Open
[SPARK-55779][UI] Add tooltip helper utilities for Spark Web UI#54588yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn wants to merge 1 commit intoapache:masterfrom
Conversation
Add `UIUtils.tooltipSpan()` and `UIUtils.tooltipLink()` helper methods to centralize Bootstrap 5 tooltip markup generation, and a `setTooltip()` JS helper in stagepage.js. ### What changes were proposed in this pull request? This PR introduces helper utilities for tooltip markup generation in the Spark Web UI: **Scala helpers in UIUtils.scala:** - `tooltipSpan(content, text, placement)` - wraps content in a `<span>` with BS5 tooltip attributes - `tooltipLink(content, text, placement)` - wraps content in an `<a>` with BS5 tooltip attributes **JS helper in stagepage.js:** - `setTooltip(selector, text)` - sets BS5 tooltip attributes on a jQuery element These helpers replace 21 inline tooltip patterns across 10 Scala files and 12 `.attr()` call chains in stagepage.js, reducing boilerplate and ensuring consistent tooltip markup. ### Why are the changes needed? Part of the Bootstrap 5 migration (SPARK-55760). Tooltip markup was duplicated across many files with slight variations. Centralizing it: 1. Reduces code duplication 2. Ensures consistent BS5 tooltip attributes (`data-bs-toggle`, `data-bs-placement`, `title`) 3. Makes future tooltip-related changes easier (single point of change) ### Does this PR introduce _any_ user-facing change? No. The rendered HTML is functionally identical - tooltips now consistently include `data-bs-placement="top"`. ### How was this patch tested? - Updated `UIUtilsSuite` to match new tooltip markup - All existing tests pass - Scalastyle and JS lint checks pass Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dongjoon-hyun
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR introduces helper utilities for tooltip markup generation in the Spark Web UI:
Scala helpers in
UIUtils.scala:tooltipSpan(content, text, placement)— wraps content in a<span>with BS5 tooltip attributestooltipLink(content, text, placement)— wraps content in an<a>with BS5 tooltip attributesJS helper in
stagepage.js:setTooltip(selector, text)— sets BS5 tooltip attributes on a jQuery elementThese helpers replace 21 inline tooltip patterns across 10 Scala files and 12
.attr()call chains in stagepage.js, reducing boilerplate and ensuring consistent tooltip markup.Why are the changes needed?
Part of the Bootstrap 5 migration (SPARK-55760). Tooltip markup was duplicated across many files with slight variations. Centralizing it:
data-bs-toggle,data-bs-placement,title)Does this PR introduce any user-facing change?
No. The rendered HTML is functionally identical — tooltips now consistently include
data-bs-placement="top".How was this patch tested?
UIUtilsSuiteto match new tooltip markupWas this patch authored or co-authored using generative AI tooling?
Yes, GitHub Copilot CLI was used.