Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep sequence tile at bottom of obs tab #4476

Merged
merged 1 commit into from
Jan 15, 2025
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
15 changes: 8 additions & 7 deletions common/src/main/scala/explore/components/ui/ExploreStyles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,14 @@ object ExploreStyles:
val ITCCell: Css = Css("explore-modes-table-itc-cell")

// Sequence Viewer
val SequencesPanel = Css("explore-sequences-panel")
val SequencesPanelError = Css("explore-sequences-panel-error")
val CellHideBorder = Css("explore-table-cell-hide-border")
val SequenceRowDone = Css("explore-sequence-row-done")
val SequenceBracketCell = Css("explore-sequence-bracket-cell")
val SequenceTileTitle = Css("explore-sequence-tile-title")
val SequenceTileTitleItem = Css("explore-sequence-tile-title-item")
val SequencesPanel = Css("explore-sequences-panel")
val SequencesPanelError = Css("explore-sequences-panel-error")
val CellHideBorder = Css("explore-table-cell-hide-border")
val SequenceRowDone = Css("explore-sequence-row-done")
val SequenceBracketCell = Css("explore-sequence-bracket-cell")
val SequenceTileController = Css("explore-sequence-tile-controller")
val SequenceTileTitle = Css("explore-sequence-tile-title")
val SequenceTileTitleItem = Css("explore-sequence-tile-title-item")

val ButtonCopy: Css = Css("explore-button-copy")
val ButtonsUndo: Css = Css("explore-buttons-undo")
Expand Down
30 changes: 22 additions & 8 deletions common/src/main/scala/explore/model/ExploreGridLayouts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ object ExploreGridLayouts:
case GridLayoutSection.ObservationsLayout => observations.defaultObsLayouts
case GridLayoutSection.ObservationsSpecPhotoLayout => observations.specPhotoObsLayouts
case GridLayoutSection.ObservationsTwilightLayout => observations.twilightObsLayouts
case GridLayoutSection.ObservationsSequenceLayout => observations.sequenceObsLayouts
case GridLayoutSection.ObservationListLayout => observationList.defaultObsListLayouts
case GridLayoutSection.OverviewLayout => overview.defaultOverviewLayouts
case GridLayoutSection.ProposalLayout => proposal.defaultProposalLayouts
Expand Down Expand Up @@ -252,14 +253,6 @@ object ExploreGridLayouts:
w = DefaultWidth.value,
h = ItcMaxHeight.value,
i = ObsTabTileIds.ItcId.id.value
),
LayoutItem(
x = 0,
y =
(NotesMaxHeight |+| TargetHeight |+| FinderChartHeight |+| SkyPlotHeight |+| ConstraintsMaxHeight |+| TimingWindowsMaxHeight |+| ConfigurationMaxHeight |+| ItcMaxHeight).value,
w = DefaultWidth.value,
h = SequenceMaxHeight.value,
i = ObsTabTileIds.SequenceId.id.value
)
)
)
Expand All @@ -282,6 +275,19 @@ object ExploreGridLayouts:
layoutMedium.asList
.filterNot(l => specPhotoRemovedIds.contains(l.i))

lazy val sequenceMedium: Layout = Layout(
List(
LayoutItem(
x = 0,
y =
(NotesMaxHeight |+| TargetHeight |+| FinderChartHeight |+| SkyPlotHeight |+| ConstraintsMaxHeight |+| TimingWindowsMaxHeight |+| ConfigurationMaxHeight |+| ItcMaxHeight).value,
w = DefaultWidth.value,
h = SequenceMaxHeight.value,
i = ObsTabTileIds.SequenceId.id.value
)
)
)

def removedTiles(role: Option[CalibrationRole]) =
role match
case Some(CalibrationRole.Twilight) => twilightRemovedIds
Expand Down Expand Up @@ -311,6 +317,14 @@ object ExploreGridLayouts:
(BreakpointName.md, Layout(twilightMedium))
)
).withMinWidth

lazy val sequenceObsLayouts: LayoutsMap =
defineStdLayouts(
Map(
(BreakpointName.lg, sequenceMedium),
(BreakpointName.md, sequenceMedium)
)
)
end observations

object observationList:
Expand Down
3 changes: 3 additions & 0 deletions common/src/main/scala/explore/model/UserPreferences.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ case class UserPreferences(
val twilightTabLayout =
tabLayout(GridLayoutSection.ObservationsTwilightLayout)

val sequenceTileLayout =
tabLayout(GridLayoutSection.ObservationsSequenceLayout)

val observationListTabLayout =
tabLayout(GridLayoutSection.ObservationListLayout)

Expand Down
4 changes: 4 additions & 0 deletions common/src/main/webapp/sass/explore.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,10 @@ $search-preview-margin: 5px;
padding-top: 1em;
}

.explore-sequence-tile-controller {
margin-top: 5px;
}

.explore-sequence-tile-title {
display: flex;
justify-content: center;
Expand Down
29 changes: 20 additions & 9 deletions explore/src/main/scala/explore/tabs/ObsTabTiles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,6 @@ object ObsTabTiles:
constraintsTile.some,
schedulingWindowsTile.some,
configurationTile.some,
sequenceTile.some,
itcTile.some
).flattenOption

Expand All @@ -570,12 +569,24 @@ object ObsTabTiles:
val tiles =
alltiles.filterNot(t => removedIds.contains(t.id))

TileController(
props.vault.userId,
props.resize.width.getOrElse(0),
defaultLayout,
layout,
tiles,
section,
props.backButton.some
React.Fragment(
TileController(
props.vault.userId,
props.resize.width.getOrElse(0),
defaultLayout,
layout,
tiles,
section,
props.backButton.some
),
TileController(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you can't drag it to the other controller right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct.

props.vault.userId,
props.resize.width.getOrElse(0),
ExploreGridLayouts.sectionLayout(GridLayoutSection.ObservationsSequenceLayout),
props.userPreferences.sequenceTileLayout,
List(sequenceTile),
GridLayoutSection.ObservationsSequenceLayout,
backButton = none,
clazz = ExploreStyles.SequenceTileController.some
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DELETE FROM "public"."lucumaGridLayoutId" WHERE "id" = 'observations_sequence';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO "public"."lucumaGridLayoutId"("id") VALUES (E'observations_sequence');
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ enum GridLayoutSection(val value: String) derives Enumerated:
case ObservationsLayout extends GridLayoutSection("observations")
case ObservationsSpecPhotoLayout extends GridLayoutSection("observations_specphoto")
case ObservationsTwilightLayout extends GridLayoutSection("observations_twilight")
case ObservationsSequenceLayout extends GridLayoutSection("observations_sequence")
case ObservationListLayout extends GridLayoutSection("observation_list")
case TargetLayout extends GridLayoutSection("targets")
case ConstraintsLayout extends GridLayoutSection("constraints")
Expand Down
Loading