diff --git a/common/src/main/scala/explore/components/Tile.scala b/common/src/main/scala/explore/components/Tile.scala index f43ba3470e..82ceb0c9ab 100644 --- a/common/src/main/scala/explore/components/Tile.scala +++ b/common/src/main/scala/explore/components/Tile.scala @@ -58,8 +58,7 @@ case class Tile[A]( } object Tile: - type TileId = NonEmptyString - type RenderInTitle = VdomNode => VdomNode + type TileId = NonEmptyString private type Props[A] = Tile[A] diff --git a/explore/src/main/scala/explore/config/sequence/GeneratedSequenceBody.scala b/explore/src/main/scala/explore/config/sequence/GeneratedSequenceBody.scala index 2e2eaa413b..d625d29776 100644 --- a/explore/src/main/scala/explore/config/sequence/GeneratedSequenceBody.scala +++ b/explore/src/main/scala/explore/config/sequence/GeneratedSequenceBody.scala @@ -128,18 +128,11 @@ object GeneratedSequenceBody: case class GeneratedSequenceTitle( obsExecution: Pot[Execution] - // programId: Program.Id, - // obsId: Observation.Id, - // targetIds: List[Target.Id], - // snPerClass: Map[ObserveClass, SignalToNoise], - // sequenceChanged: View[Pot[Unit]] ) extends ReactFnProps(GeneratedSequenceTitle.component) object GeneratedSequenceTitle: private type Props = GeneratedSequenceTitle - private given Reusability[InstrumentExecutionConfig] = Reusability.byEq - private val component = ScalaFnComponent .withHooks[Props] diff --git a/explore/src/main/scala/explore/config/sequence/SequenceEditorTile.scala b/explore/src/main/scala/explore/config/sequence/SequenceEditorTile.scala index 020ec78c00..fb71563cc8 100644 --- a/explore/src/main/scala/explore/config/sequence/SequenceEditorTile.scala +++ b/explore/src/main/scala/explore/config/sequence/SequenceEditorTile.scala @@ -11,7 +11,6 @@ import explore.model.Execution import explore.model.ObsTabTilesIds import explore.model.Observation import explore.model.OdbItcResult -import japgolly.scalajs.react.* import lucuma.core.model.Program object SequenceEditorTile: diff --git a/explore/src/main/scala/explore/constraints/ConstraintSummaryTile.scala b/explore/src/main/scala/explore/constraints/ConstraintSummaryTile.scala index a4d3448eac..5d9c14ea29 100644 --- a/explore/src/main/scala/explore/constraints/ConstraintSummaryTile.scala +++ b/explore/src/main/scala/explore/constraints/ConstraintSummaryTile.scala @@ -35,7 +35,6 @@ import lucuma.ui.table.* import lucuma.ui.table.hooks.* import scala.collection.immutable.SortedSet -import explore.model.enums.TileSizeState case class ConstraintsSummaryTableBody( userId: Option[User.Id], diff --git a/explore/src/main/scala/explore/notes/NotesTile.scala b/explore/src/main/scala/explore/notes/NotesTile.scala index 9596add584..96b95eeb9b 100644 --- a/explore/src/main/scala/explore/notes/NotesTile.scala +++ b/explore/src/main/scala/explore/notes/NotesTile.scala @@ -5,12 +5,10 @@ package explore.tabs import cats.syntax.all.* import crystal.react.* -import crystal.react.hooks.* import eu.timepit.refined.types.string.NonEmptyString import explore.Icons import explore.components.HelpIcon import explore.components.Tile -import explore.components.Tile.RenderInTitle import explore.components.ui.ExploreStyles import explore.model.ObsTabTilesIds import explore.model.Observation diff --git a/explore/src/main/scala/explore/observationtree/ObsSummaryTable.scala b/explore/src/main/scala/explore/observationtree/ObsSummaryTable.scala index b20c3eb16e..2aca837dd8 100644 --- a/explore/src/main/scala/explore/observationtree/ObsSummaryTable.scala +++ b/explore/src/main/scala/explore/observationtree/ObsSummaryTable.scala @@ -14,7 +14,6 @@ import crystal.react.syntax.pot.given import explore.Icons import explore.common.UserPreferencesQueries import explore.common.UserPreferencesQueries.TableStore -import explore.components.Tile import explore.components.ui.ExploreStyles import explore.model.AppContext import explore.model.Asterism diff --git a/explore/src/main/scala/explore/proposal/ProgramUsers.scala b/explore/src/main/scala/explore/proposal/ProgramUsers.scala index fe934d6c65..6dd50fa5ba 100644 --- a/explore/src/main/scala/explore/proposal/ProgramUsers.scala +++ b/explore/src/main/scala/explore/proposal/ProgramUsers.scala @@ -8,11 +8,8 @@ import cats.effect.IO import cats.syntax.all.* import crystal.* import crystal.react.* -import crystal.react.hooks.* import explore.Icons import explore.components.Tile -import explore.components.Tile.RenderInTitle -import explore.components.ui.ExploreStyles import explore.model.AppContext import explore.model.CoIInvitation import explore.model.ProgramUserWithRole diff --git a/explore/src/main/scala/explore/tabs/AsterismEditorTile.scala b/explore/src/main/scala/explore/tabs/AsterismEditorTile.scala index be31d234e1..02df13a831 100644 --- a/explore/src/main/scala/explore/tabs/AsterismEditorTile.scala +++ b/explore/src/main/scala/explore/tabs/AsterismEditorTile.scala @@ -10,7 +10,6 @@ import crystal.* import crystal.react.* import explore.components.Tile import explore.components.ui.ExploreStyles -import explore.config.ObsTimeEditor import explore.model.GlobalPreferences import explore.model.ObsConfiguration import explore.model.ObsIdSet diff --git a/explore/src/main/scala/explore/tabs/GroupEditBody.scala b/explore/src/main/scala/explore/tabs/GroupEditBody.scala index c73288ca7e..a4cb82f903 100644 --- a/explore/src/main/scala/explore/tabs/GroupEditBody.scala +++ b/explore/src/main/scala/explore/tabs/GroupEditBody.scala @@ -16,7 +16,6 @@ import eu.timepit.refined.types.numeric.NonNegShort import eu.timepit.refined.types.string.NonEmptyString import explore.Icons import explore.common.GroupQueries -import explore.components.Tile import explore.components.ui.ExploreStyles import explore.model.AppContext import explore.model.GroupTree diff --git a/explore/src/main/scala/explore/tabs/ItcTile.scala b/explore/src/main/scala/explore/tabs/ItcTile.scala index 21c847cc7a..86401c0de2 100644 --- a/explore/src/main/scala/explore/tabs/ItcTile.scala +++ b/explore/src/main/scala/explore/tabs/ItcTile.scala @@ -3,11 +3,9 @@ package explore.tabs -import cats.syntax.all.* import crystal.Pot import crystal.react.View import explore.components.Tile -import explore.components.ui.ExploreStyles import explore.itc.ItcPanelBody import explore.itc.ItcPanelTitle import explore.itc.ItcPanelTileState diff --git a/explore/src/main/scala/explore/tabs/ObsTabTiles.scala b/explore/src/main/scala/explore/tabs/ObsTabTiles.scala index ba24b372c6..3f30163196 100644 --- a/explore/src/main/scala/explore/tabs/ObsTabTiles.scala +++ b/explore/src/main/scala/explore/tabs/ObsTabTiles.scala @@ -20,7 +20,6 @@ import explore.components.TileController import explore.components.ui.ExploreStyles import explore.config.sequence.SequenceEditorTile import explore.constraints.ConstraintsPanel -import explore.findercharts.ChartSelector import explore.itc.ItcProps import explore.model.* import explore.model.AppContext @@ -55,7 +54,6 @@ import lucuma.core.math.Offset import lucuma.core.math.skycalc.averageParallacticAngle import lucuma.core.model.ConstraintSet import lucuma.core.model.CoordinatesAtVizTime -import lucuma.core.model.ObsAttachment as ObsAtt import lucuma.core.model.PosAngleConstraint import lucuma.core.model.Program import lucuma.core.model.Target diff --git a/explore/src/main/scala/explore/targeteditor/AsterismEditorBody.scala b/explore/src/main/scala/explore/targeteditor/AsterismEditorBody.scala index 19142d23e1..4377ebfef1 100644 --- a/explore/src/main/scala/explore/targeteditor/AsterismEditorBody.scala +++ b/explore/src/main/scala/explore/targeteditor/AsterismEditorBody.scala @@ -3,11 +3,9 @@ package explore.targeteditor -import cats.effect.IO import cats.syntax.all.* import crystal.react.* import crystal.react.hooks.* -import explore.components.Tile import explore.components.ui.ExploreStyles import explore.config.ObsTimeEditor import explore.model.AladinFullScreen @@ -35,7 +33,6 @@ import lucuma.react.common.ReactFnProps import lucuma.ui.reusability.given import lucuma.ui.syntax.all.given import monocle.Iso -import queries.schemas.odb.ObsQueries import java.time.Instant import monocle.Lens @@ -90,16 +87,15 @@ object AsterismEditorBody extends AsterismModifier: private val component = ScalaFnComponent .withHooks[Props] - .useContext(AppContext.ctx) - .useMemoBy((props, _) => (props.obsIds, props.obsAndTargets.get._1)) { (_, _) => + .useMemoBy(props => (props.obsIds, props.obsAndTargets.get._1)) { _ => ObsIdSetEditInfo.fromObservationList } - .useLayoutEffectWithDepsBy((_, _, obsEditInfo) => obsEditInfo) { (p, _, _) => obsEditInfo => + .useLayoutEffectWithDepsBy((_, obsEditInfo) => obsEditInfo) { (p, _) => obsEditInfo => p.state.zoom(AsterismTileState.obsEditInfo).set(obsEditInfo.value.some) } - .useLayoutEffectWithDepsBy((props, _, obsEditInfo) => + .useLayoutEffectWithDepsBy((props, obsEditInfo) => (obsEditInfo.asterismIds, props.focusedTargetId) - ) { (props, _, _) => (asterismIds, focusedTargetId) => + ) { (props, _) => (asterismIds, focusedTargetId) => // If the selected targetId is None, or not in the asterism, select the first target (if any). // Need to replace history here. focusedTargetId.filter(asterismIds.contains_) match @@ -108,15 +104,7 @@ object AsterismEditorBody extends AsterismModifier: } // full screen aladin .useStateView(AladinFullScreen.Normal) - .render { (props, ctx, obsEditInfo, fullScreen) => - import ctx.given - // Save the time here. this works for the obs and target tabs - // It's OK to set the viz time for executed observations, I think. - val vizTimeView = props.vizTime.withOnMod(t => - ObsQueries - .updateVisualizationTime[IO](props.obsIds.toList, t) - .runAsync - ) + .render { (props, obsEditInfo, fullScreen) => val vizTime = props.vizTime.get diff --git a/explore/src/main/scala/explore/targeteditor/SiderealTargetEditor.scala b/explore/src/main/scala/explore/targeteditor/SiderealTargetEditor.scala index 0cdf5b2c9c..22252fbcd6 100644 --- a/explore/src/main/scala/explore/targeteditor/SiderealTargetEditor.scala +++ b/explore/src/main/scala/explore/targeteditor/SiderealTargetEditor.scala @@ -15,7 +15,6 @@ import eu.timepit.refined.types.string.* import explore.DefaultErrorPolicy import explore.common.* import explore.components.HelpIcon -import explore.components.Tile import explore.components.ui.ExploreStyles import explore.model.AladinFullScreen import explore.model.AppContext diff --git a/explore/src/main/scala/explore/targeteditor/TargetTable.scala b/explore/src/main/scala/explore/targeteditor/TargetTable.scala index 2b3afaa542..b8e49af14e 100644 --- a/explore/src/main/scala/explore/targeteditor/TargetTable.scala +++ b/explore/src/main/scala/explore/targeteditor/TargetTable.scala @@ -13,7 +13,6 @@ import crystal.react.hooks.* import explore.Icons import explore.common.UserPreferencesQueries import explore.common.UserPreferencesQueries.TableStore -import explore.components.Tile import explore.components.ColumnSelectorState import explore.components.ui.ExploreStyles import explore.model.AladinFullScreen