You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "yaooqinn (via GitHub)" <gi...@apache.org> on 2026/03/04 14:25:12 UTC

[PR] [SPARK-55778][UI] Remove redundant data-bs-placement="top" from tooltip markup [spark]

yaooqinn opened a new pull request, #54622:
URL: https://github.com/apache/spark/pull/54622

   ### What changes were proposed in this pull request?
   
   Remove all `data-bs-placement="top"` attributes from tooltip markup across the Spark Web UI, including Scala files, JavaScript files, and HTML templates.
   
   ### Why are the changes needed?
   
   Bootstrap 5 Tooltip defaults to `top` placement (see [Bootstrap docs](https://getbootstrap.com/docs/5.3/components/tooltips/#options)), so explicitly setting `data-bs-placement="top"` is redundant. Removing it simplifies the HTML/JS markup without any behavioral change.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Tooltip placement behavior remains identical since Bootstrap 5 already defaults to `top`.
   
   ### How was this patch tested?
   
   - `./dev/lint-js` — passed
   - `./dev/scalastyle` — passed
   - `./build/sbt 'core/testOnly org.apache.spark.ui.UIUtilsSuite'` — all 8 tests passed
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Yes, GitHub Copilot assisted with identifying and removing the redundant attributes.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-55778][UI] Remove redundant data-bs-placement="top" from tooltip markup [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #54622:
URL: https://github.com/apache/spark/pull/54622#discussion_r2884502405


##########
core/src/main/scala/org/apache/spark/ui/UIUtils.scala:
##########
@@ -546,22 +546,28 @@ private[spark] object UIUtils extends Logging {
 
   def tooltip(text: String, position: String): Seq[Node] = {
     <sup>
-      (<a data-bs-toggle="tooltip" data-bs-placement={position} title={text}>?</a>)
+      (<a data-bs-toggle="tooltip" title={text}>?</a>)
     </sup>
   }
 
   /** Wrap content in a span with a Bootstrap 5 tooltip. */
   def tooltipSpan(content: Seq[Node], text: String,
       placement: String = "top"): Seq[Node] = {
-    <span data-bs-toggle="tooltip" data-bs-placement={placement} title={text}>
+    val bsPlacement =
+      if (placement == "top") null else placement

Review Comment:
   Could you make it one-liner?
   
   ```scala
   - val bsPlacement =
   -      if (placement == "top") null else placement
   + val bsPlacement = if (placement == "top") null else placement
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-55778][UI] Remove redundant data-bs-placement="top" from tooltip markup [spark]

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #54622:
URL: https://github.com/apache/spark/pull/54622#issuecomment-4002156109

   Merged to master, thank you @dongjoon-hyun 


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-55778][UI] Remove redundant data-bs-placement="top" from tooltip markup [spark]

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #54622:
URL: https://github.com/apache/spark/pull/54622#discussion_r2884687711


##########
core/src/main/scala/org/apache/spark/ui/UIUtils.scala:
##########
@@ -546,22 +546,28 @@ private[spark] object UIUtils extends Logging {
 
   def tooltip(text: String, position: String): Seq[Node] = {
     <sup>
-      (<a data-bs-toggle="tooltip" data-bs-placement={position} title={text}>?</a>)
+      (<a data-bs-toggle="tooltip" title={text}>?</a>)
     </sup>
   }
 
   /** Wrap content in a span with a Bootstrap 5 tooltip. */
   def tooltipSpan(content: Seq[Node], text: String,
       placement: String = "top"): Seq[Node] = {
-    <span data-bs-toggle="tooltip" data-bs-placement={placement} title={text}>
+    val bsPlacement =
+      if (placement == "top") null else placement

Review Comment:
   ```suggestion
       val bsPlacement = if (placement == "top") null else placement
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-55778][UI] Remove redundant data-bs-placement="top" from tooltip markup [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #54622:
URL: https://github.com/apache/spark/pull/54622#discussion_r2884723800


##########
core/src/main/scala/org/apache/spark/ui/UIUtils.scala:
##########
@@ -546,22 +546,27 @@ private[spark] object UIUtils extends Logging {
 
   def tooltip(text: String, position: String): Seq[Node] = {
     <sup>
-      (<a data-bs-toggle="tooltip" data-bs-placement={position} title={text}>?</a>)
+      (<a data-bs-toggle="tooltip" title={text}>?</a>)
     </sup>
   }
 
   /** Wrap content in a span with a Bootstrap 5 tooltip. */
   def tooltipSpan(content: Seq[Node], text: String,
       placement: String = "top"): Seq[Node] = {
-    <span data-bs-toggle="tooltip" data-bs-placement={placement} title={text}>
+    val bsPlacement = if (placement == "top") null else placement
+    <span data-bs-toggle="tooltip"
+        data-bs-placement={bsPlacement} title={text}>
       {content}
     </span>
   }
 
   /** Create a link with a Bootstrap 5 tooltip. */
   def tooltipLink(content: Seq[Node], text: String,
       placement: String = "top"): Seq[Node] = {
-    <a data-bs-toggle="tooltip" data-bs-placement={placement} title={text}>
+    val bsPlacement =
+      if (placement == "top") null else placement

Review Comment:
   ditto, @yaooqinn .



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-55778][UI] Remove redundant data-bs-placement="top" from tooltip markup [spark]

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn closed pull request #54622: [SPARK-55778][UI] Remove redundant data-bs-placement="top" from tooltip markup
URL: https://github.com/apache/spark/pull/54622


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org