Skip to content

Commit

Permalink
Add tooltip to ObsBadge when observation reference index is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
toddburnside committed Feb 20, 2025
1 parent 1449461 commit 53f45d8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions explore/src/main/scala/explore/observationtree/ObsBadge.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ object ObsBadge:
val obs = props.obs
val layout = props.layout

val identifierStr = obs.reference.fold(obs.id.show)(_.observationIndex.toString)
val identifier: VdomNode = obs.reference.fold(s"[${obs.id.show}]": VdomNode): ref =>
Tooltip.Fragment(content = s"${ref.label} (${obs.id})")(
<.span(s"[${ref.observationIndex.toString}]")
)

val deleteButton =
Button(
Expand Down Expand Up @@ -144,7 +147,7 @@ object ObsBadge:
<.div(
ExploreStyles.ObsBadgeId,
scienceBandButton.when(props.showScienceBand),
s"[$identifierStr]",
identifier,
props.cloneCB.whenDefined(_ => duplicateButton),
deleteButton
)
Expand Down

0 comments on commit 53f45d8

Please sign in to comment.