Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scalafmt-common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# this file by hand! Instead, if you wish to make changes, you should
# make a PR to sbt-lucuma.

version = "3.8.3"
version = "3.9.10"
style = default

runner.dialect = scala3
Expand Down
8 changes: 4 additions & 4 deletions common/src/main/scala/explore/common/AlignerF.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ trait AlignerF[F[_], B, S]:
protected type _T // Base delta structure type

protected val _undoCtx: UndoSetter[_A] // Base model instance within an `UndoContext`
protected val _remoteBaseInput: _T // Base delta structure instance
protected val _onMod: _T => F[Unit] // Effect to send the delta structure to the remote server
protected val _remoteBaseInput: _T // Base delta structure instance
protected val _onMod: _T => F[Unit] // Effect to send the delta structure to the remote server

protected val _modelGet: _A => B // Model drill-down getter function
protected val _modelMod: (B => B) => _A => _A // Model drill-down modifier function
protected val _modelGet: _A => B // Model drill-down getter function
protected val _modelMod: (B => B) => _A => _A // Model drill-down modifier function
protected val _remoteMod: (S => S) => _T => _T // Delta structure drill-down modifier function

/** Get the value of the model. */
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/scala/explore/syntax/ui/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extension [A](pot: Pot[A])
pot.renderPot(valueRender = f, pendingRender = Icons.Spinner.withSpin(true))

// TODO: Move to lucuma-react?
extension (tag: TagOf[HTMLElement])
extension (tag: TagOf[HTMLElement])
def withTooltipWhen(
condition: Boolean,
content: VdomNode,
Expand Down
2 changes: 1 addition & 1 deletion explore/src/main/scala/explore/EditableLabel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ object EditableLabel:
.useStateBy(props => Editing(props.forceEditing)) // editing
.useEffectWithDepsBy((props, _) => props.forceEditing): (_, editing) =>
forceEditing => if forceEditing then editing.setState(InEdition) else Callback.empty
.useState("") // displayValue
.useState("") // displayValue
.useId
.render: (props, editing, displayValue, id) =>
def editCB(e: ReactMouseEvent): Callback =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ object ProgramCacheController
// TODO: Move into updateStream and use the keyedSwitchEvalMap for recursion?
private def updateGroupTimeRange(
groupId: Option[Group.Id]
)(using odbApi: OdbGroupApi[IO]): IO[
)(using
odbApi: OdbGroupApi[IO]
): IO[
ProgramSummaries => ProgramSummaries
] =
def go(
Expand Down
3 changes: 1 addition & 2 deletions explore/src/main/scala/explore/config/ModesTableCommon.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ trait ModesTableCommon:
style: Css,
indexCondition: Int => Boolean
): TagMod =
index.whenDefined(
using
index.whenDefined(using
idx =>
Button(
clazz = ExploreStyles.ScrollButton |+| style,
Expand Down
3 changes: 2 additions & 1 deletion explore/src/main/scala/explore/config/ObsTimeEditor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ object ObsTimeEditor
defaultDuration <- useMemo(props.pendingTime)(_.getOrElse(TimeSpan.fromHours(1).get))
} yield
val nowTooltip =
s"Set time to the current time${props.pendingTime.fold("")(_ => " and duration to remaining time")}"
s"Set time to the current time${props.pendingTime
.fold("")(_ => " and duration to remaining time")}"
val staleTooltipString = props.calcDigest.staleTooltipString

<.div(ExploreStyles.ObsInstantTileTitle)(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ object SpectroscopyConfigurationPanel extends ConfigurationFormats:
p.units,
p.calibrationRole
),
Option.when(focalPlaneSupported) { // Hide until supported
Option.when(
focalPlaneSupported
) { // Hide until supported
ReactFragment(
FormLabel("focal-plane".refined)("Focal Plane",
HelpIcon("configuration/focal_plane.md".refined)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,48 +183,40 @@ object ConstraintsSummaryTile:
)
.withCell(_.value match
case ElevationRange.ByAirMass(min, _) => f"${min.value}%.1f"
case ElevationRange.ByHourAngle(_, _) => ""
)
case ElevationRange.ByHourAngle(_, _) => "")
.sortableBy(_ match
case ElevationRange.ByAirMass(min, _) => min.toBigDecimal
case ElevationRange.ByHourAngle(_, _) => AirMassBound.Min.toBigDecimal - 1
),
case ElevationRange.ByHourAngle(_, _) => AirMassBound.Min.toBigDecimal - 1),
column(
MaxAMColumnId,
ConstraintGroup.constraintSet.andThen(ConstraintSet.elevationRange).get
)
.withCell(_.value match
case ElevationRange.ByAirMass(_, max) => f"${max.value}%.1f"
case ElevationRange.ByHourAngle(_, _) => ""
)
case ElevationRange.ByHourAngle(_, _) => "")
.sortableBy(_ match
case ElevationRange.ByAirMass(_, max) => max.toBigDecimal
case ElevationRange.ByHourAngle(_, _) => AirMassBound.Min.toBigDecimal - 1
),
case ElevationRange.ByHourAngle(_, _) => AirMassBound.Min.toBigDecimal - 1),
column(
MinHAColumnId,
ConstraintGroup.constraintSet.andThen(ConstraintSet.elevationRange).get
)
.withCell(_.value match
case ElevationRange.ByAirMass(_, _) => ""
case ElevationRange.ByHourAngle(min, _) => f"${min.value}%.1f"
)
case ElevationRange.ByHourAngle(min, _) => f"${min.value}%.1f")
.sortableBy(_ match
case ElevationRange.ByAirMass(_, _) => HourAngleBound.Min.toBigDecimal - 1
case ElevationRange.ByHourAngle(min, _) => min.toBigDecimal
),
case ElevationRange.ByHourAngle(min, _) => min.toBigDecimal),
column(
MaxHAColumnId,
ConstraintGroup.constraintSet.andThen(ConstraintSet.elevationRange).get
)
.withCell(_.value match
case ElevationRange.ByAirMass(_, _) => ""
case ElevationRange.ByHourAngle(_, max) => f"${max.value}%.1f"
)
case ElevationRange.ByHourAngle(_, max) => f"${max.value}%.1f")
.sortableBy(_ match
case ElevationRange.ByAirMass(_, _) => HourAngleBound.Min.toBigDecimal - 1
case ElevationRange.ByHourAngle(_, max) => max.toBigDecimal
),
case ElevationRange.ByHourAngle(_, max) => max.toBigDecimal),
column(CountColumnId, _.obsIds.length),
column(ObservationsColumnId, ConstraintGroup.obsIds.get)
.withCell(cell =>
Expand Down
5 changes: 2 additions & 3 deletions explore/src/main/scala/explore/itc/ItcImagingTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,8 @@ object ItcImagingTile extends ModesTableCommon:
// Display target selector if we have targets and results
selectedTarget.map: (gr: ImagingTargetAndResults) =>
val options =
props.tileState.get.imagingTargetResults.map(t =>
SelectItem(label = t.target.name.value, value = t)
)
props.tileState.get.imagingTargetResults
.map(t => SelectItem(label = t.target.name.value, value = t))

<.div(
ExploreStyles.ItcTileTitle,
Expand Down
5 changes: 2 additions & 3 deletions explore/src/main/scala/explore/itc/ItcSpectroscopyTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,8 @@ object ItcSpectroscopyTile:
// The only way this should be empty is if there are no targets in the results.
props.tileState.get.selectedTarget.map: (gr: TargetAndResults) =>
val options =
props.tileState.get.targetResults.map(t =>
SelectItem(label = t.target.name.value, value = t)
)
props.tileState.get.targetResults
.map(t => SelectItem(label = t.target.name.value, value = t))

<.div(
ExploreStyles.ItcTileTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ object ObsBadge:
else
<.div(
obs.workflow.value.validationErrors
.toTagMod(using ov => <.div(ov.code.name, <.ul(ov.messages.toList.toTagMod(using i => <.li(i)))))
.toTagMod(using
ov => <.div(ov.code.name, <.ul(ov.messages.toList.toTagMod(using i => <.li(i))))
)
)

val validationIcon = <.span(Icons.ErrorIcon).withTooltip(content = validationTooltip)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ object SchedulingGroupObsList:
private given Render[TimingWindowInclusion] = Render.by: twt =>
<.span(twt match
case TimingWindowInclusion.Include => ExploreStyles.TimingWindowInclude
case TimingWindowInclusion.Exclude => ExploreStyles.TimingWindowExclude
)(
case TimingWindowInclusion.Exclude => ExploreStyles.TimingWindowExclude)(
<.span(Icons.CircleSolid).withTooltip(tooltip = twt.shortName)
)

Expand Down
4 changes: 3 additions & 1 deletion explore/src/main/scala/explore/plots/NightPlot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ object NightPlot:
val seriesIndex: Int = ctx.series.index.toInt / chartData.size.toInt
val value = seriesIndex match
case 0 => // Target elevation with airmass
formatAngle(y) + s"<br/>Airmass: ${"%.3f".format(ctx.point.asInstanceOf[ElevationPointWithAirmass].airmass)}"
formatAngle(
y
) + s"<br/>Airmass: ${"%.3f".format(ctx.point.asInstanceOf[ElevationPointWithAirmass].airmass)}"
case 2 => "%.2f".format(ctx.y) // Sky Brightness
case _ => formatAngle(y) // Other elevations

Expand Down
4 changes: 3 additions & 1 deletion explore/src/main/scala/explore/programs/ProgramTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ object ProgramTable:
pinf.zoom(ProgramInfo.deleted).set(false).toAsync >>
odbApi.undeleteProgram(pinf.get.id)

private def onModName(pinf: ProgramInfo)(using odbApi: OdbProgramApi[IO])(using
private def onModName(pinf: ProgramInfo)(using
odbApi: OdbProgramApi[IO]
)(using
Logger[IO]
): Callback =
odbApi.updateProgramName(pinf.id, pinf.name).runAsync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ object ProposalAttachmentsTable extends ProposalAttachmentUtils {
(readOnly, client) =>
import ctx.given

def column[V](id: ColumnId, accessor: Row => V)
: ColumnDef.Single.WithTableMeta[Row, V, TableMeta] =
def column[V](
id: ColumnId,
accessor: Row => V
): ColumnDef.Single.WithTableMeta[Row, V, TableMeta] =
ColDef(id, v => accessor(v), columnNames(id))

List(
Expand Down Expand Up @@ -219,9 +221,8 @@ object ProposalAttachmentsTable extends ProposalAttachmentUtils {
.forPurpose(AttachmentPurpose.Proposal)
.filterNot(
// Fast turnaround proposals do not have a team attachment
_ === AttachmentType.Team && pt.exists(t =>
t.scienceSubtype === ScienceSubtype.FastTurnaround
)
_ === AttachmentType.Team && pt
.exists(t => t.scienceSubtype === ScienceSubtype.FastTurnaround)
)
.map(pat => pas.find(_.attachmentType === pat).toRight(pat))
.useReactTableBy: (_, _, _, action, urlMap, cols, rows) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ object ProposalErrorsTile:
extends ReactFnComponent[Body](props =>
<.div(
ExploreStyles.ProposalErrorsTile,
props.errors.toTagMod(
using
props.errors.toTagMod(using
e =>
<.div(
Icons.ErrorIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ object SchedulingWindowsTile:
private given Render[TimingWindowInclusion] = Render.by: swt =>
<.span(swt match
case TimingWindowInclusion.Include => ExploreStyles.TimingWindowInclude
case TimingWindowInclusion.Exclude => ExploreStyles.TimingWindowExclude
)(swt.shortName)
case TimingWindowInclusion.Exclude => ExploreStyles.TimingWindowExclude)(swt.shortName)

private given Render[TimingWindow] = Render.by:
case TimingWindow(inclusion, start, Some(TimingWindowEnd.At(endAt))) =>
Expand Down
8 changes: 7 additions & 1 deletion explore/src/main/scala/explore/tabs/GroupEditBody.scala
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,13 @@ object GroupEditBody
<.div(
ExploreStyles.GroupWarnings,
nes.toList
.toTagMod(using w => Message(id = s"${group.id}-${w.shortMsg}", text = w.longMsg, severity = Message.Severity.Warning))
.toTagMod(using
w =>
Message(id = s"${group.id}-${w.shortMsg}",
text = w.longMsg,
severity = Message.Severity.Warning
)
)
)
)
)
Expand Down
4 changes: 2 additions & 2 deletions explore/src/main/scala/explore/tabs/ObsTabContents.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ object ObsTabContents extends TwoPanels:
case (None, SelectedPanel.Editor) => selected.set(SelectedPanel.Summary)
case _ => Callback.empty
.useResizeDetector() // Measure its size
.useState(none[ObsIdSet]) // shadowClipboardObs (a copy as state only if it has observations)
.useState(none[ObsIdSet]) // shadowClipboardObs (a copy as state only if it has observations)
.useEffectOnMountBy: (_, ctx, _, _, shadowClipboardObs) => // initialize shadowClipboard
import ctx.given

Expand Down Expand Up @@ -162,7 +162,7 @@ object ObsTabContents extends TwoPanels:
callbacks
)
.useStateView(DeckShown.Shown)
.useStateView(AddingObservation(false)) // adding new observation or duplicating
.useStateView(AddingObservation(false)) // adding new observation or duplicating
.render:
(
props,
Expand Down
8 changes: 4 additions & 4 deletions explore/src/main/scala/explore/tabs/TargetTabContents.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ object TargetTabContents extends TwoPanels:
case (Focused(None, None, _), SelectedPanel.Editor) =>
selectedPanel.set(SelectedPanel.Summary)
case _ => Callback.empty
.useStateViewBy((_, _, _) => List.empty[Target.Id]) // Selected targets on table
.useStateViewBy((_, _, _) => List.empty[Target.Id]) // Selected targets on table
.useLayoutEffectWithDepsBy((props, _, _, _) => props.focused.target):
// If a target enters edit mode, unselect the rows.
(_, _, _, selTargetIds) => _.foldMap(_ => selTargetIds.set(List.empty))
Expand All @@ -139,7 +139,7 @@ object TargetTabContents extends TwoPanels:
TargetIdSet.fromTargetIdList(selTargetIds).map(_.asLeft)
.useState[LocalClipboard](
LocalClipboard.Empty
) // shadowClipboard (a copy of the clipboard as state)
) // shadowClipboard (a copy of the clipboard as state)
.useEffectOnMountBy: (_, ctx, _, _, _, shadowClipboard) => // initialize shadowClipboard
import ctx.given
ExploreClipboard.get.flatMap(shadowClipboard.setStateAsync)
Expand Down Expand Up @@ -239,7 +239,7 @@ object TargetTabContents extends TwoPanels:

UseHotkeysProps((GoToSummary :: (CopyKeys ::: PasteKeys)).toHotKeys, callbacks)
.useStateView(AladinFullScreen.Normal) // full screen aladin
.useResizeDetector() // Measure its size
.useResizeDetector() // Measure its size
.useStateView[GuideStarSelection](AgsSelection(none)) // required for aladin but not in use
.render:
(
Expand Down Expand Up @@ -508,7 +508,7 @@ object TargetTabContents extends TwoPanels:
val targetForPage: Option[Target.Id] =
if (params.areAddingTarget) params.targetId.some
else none // if we're deleting, let UI focus the first one in the asterism
val setPage: Callback =
val setPage: Callback =
if (params.isUndo)
setCurrentTarget(idsToEdit.some)(targetForPage, SetRouteVia.HistoryReplace)
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ object AladinCell extends ModelOptics with AladinCommon:
val selectedGS = index.flatMap(i => r.flatMap(_.lift(i)))
props.guideStarSelection
.mod:
case AgsSelection(_) =>
case AgsSelection(_) =>
AgsSelection(selectedGS.tupleLeft(0)) // replace automatic selection
case rem @ RemoteGSSelection(name) =>
// Recover the analysis for the remotely selected star
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,16 @@ object AladinContainer extends AladinCommon {
.flatten

// Use fov from aladin
fov <- useState(none[Fov])
fov <- useState(none[Fov])
// Survey
survey <- useState(
props.vizConf
.flatMap(_.centralWavelength)
.map(w => surveyForWavelength(w.value))
.getOrElse(ImageSurvey.DSS)
)
survey <- useState(
props.vizConf
.flatMap(_.centralWavelength)
.map(w => surveyForWavelength(w.value))
.getOrElse(ImageSurvey.DSS)
)
// Update survey if conf changes
_ <-
_ <-
useEffectWithDeps(props.vizConf.flatMap(_.centralWavelength.map(_.value))): w =>
w.map(w => survey.setState(surveyForWavelength(w))).getOrEmpty
} yield {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ trait AsterismModifier:
onAsterismUpdate: OnAsterismUpdateParams => Callback,
readOnly: Boolean = false,
buttonClass: Css = Css.Empty
)(using odbApi: OdbTargetApi[IO] & OdbAsterismApi[IO])(using
)(using
odbApi: OdbTargetApi[IO] & OdbAsterismApi[IO]
)(using
Logger[IO]
): TargetSelectionPopup =
TargetSelectionPopup(
Expand Down
4 changes: 2 additions & 2 deletions explore/src/main/scala/explore/targeteditor/SearchForm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ object SearchForm:
.withHooks[Props]
.useContext(AppContext.ctx)
.useStateViewBy((props, _) => props.targetName.get) // term
.useState(true) // enabled
.useState(none[NonEmptyString]) // error
.useState(true) // enabled
.useState(none[NonEmptyString]) // error
.useEffectWithDepsBy((props, _, _, _, _) => props.targetName.get)((_, _, term, enabled, _) =>
name => term.set(name) >> enabled.setState(true)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ExploreModelValidatorsSuite extends DisciplineSuite:

private val perturbations: List[String => Gen[String]] =
List(
_ => arbitrary[String], // swap for a random string
_ => arbitrary[String], // swap for a random string
s => Gen.const(s.replace("2", "0")) // create a leading zero, maybe (ok)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ object KeyedIndexedTree {
.map(node => (getKey(node.value), node))
.distinctBy(_._1) // key
.filterNot(accumKeys.contains.compose(_._1))
val newAccumKeys: Set[K] = accumKeys ++ keyedNewNodes.map(_._1)
val newAccumKeys: Set[K] = accumKeys ++ keyedNewNodes.map(_._1)
keyedNewNodes.zipWithIndex.foldLeft(
List.empty[Node[IndexedElem[K, A]]]
) { case (nodes, ((key, node), idx)) =>
Expand Down
Loading
Loading