Update Night Sky Panel's Markings tab + Small Sun Tab refactor#207
Update Night Sky Panel's Markings tab + Small Sun Tab refactor#207WeirdRubberDuck wants to merge 22 commits intomasterfrom
Conversation
|
The layout is now more responsive and uses an adaptive gridding similar to the skybrowser panel. Demonstration: 2026-03-20.09-43-50.mov |
Co-authored-by: Alexander Bock <mail@alexanderbock.eu>
# Conflicts: # src/panels/NightSkyPanel/tabs/MarkingsTab/SceneGraphNodeToggle.tsx
# Conflicts: # src/panels/NightSkyPanel/tabs/MarkingsTab/CardinalDirectionsBoxes.tsx # src/panels/NightSkyPanel/tabs/MarkingsTab/ConstellationsArtToggle.tsx # src/panels/NightSkyPanel/tabs/MarkingsTab/ConstellationsLabelsToggle.tsx # src/panels/NightSkyPanel/tabs/MarkingsTab/ConstellationsLinesToggle.tsx # src/panels/NightSkyPanel/tabs/MarkingsTab/MarkingBox.tsx
|
Actions now available here: https://github.com/OpenSpace/OpenSpace-WebGui/pull/207/changes and I updated this branch to call them. |
…com/OpenSpace/OpenSpace-WebGui into issue/3753-nightsky-markings-layout
|
Looks and works great! Tested all the changes, and I updated the actions in the main repo to fix the hide all stuff |
engbergandreas
left a comment
There was a problem hiding this comment.
Sorry for all the onClick functions, but might as well get through them. We should probably make a separate pass through on this so that we're up-to-date with our readme. I only looked at the code and nothing sticks out. Looks way nicer now, great job!
| "add-trail-simulation-date": "Add trail for Simulation Date", | ||
| "add-trail-today": "Add trail for Today", |
There was a problem hiding this comment.
| "add-trail-simulation-date": "Add trail for Simulation Date", | |
| "add-trail-today": "Add trail for Today", | |
| "add-trail-simulation-date": "Add trail for simulation date", | |
| "add-trail-today": "Add trail for today", |
?
There was a problem hiding this comment.
| "add-trail-simulation-date": "Add trail for Simulation Date", | |
| "add-trail-today": "Add trail for Today", | |
| "add-trail-simulation-date": "Add trail for 'Simulation Date'", | |
| "add-trail-today": "Add trail for 'Today'", |
Alternative suggestion to make it more clear that that is the important part of the sentence
| "show-stars": "Show Stars", | ||
| "show-stars": "Show stars", | ||
| "show-during-day": { | ||
| "label": "Show during Day", |
There was a problem hiding this comment.
| "label": "Show during Day", | |
| "label": "Show during day", |
| onChange={(value: string) => { | ||
| switch (value) { | ||
| case 'small': | ||
| luaApi?.action.triggerAction(Data['small'].showAction); | ||
| if (isTextureOn('marks')) { | ||
| // The action for showing the small letters also hides the marks, so we | ||
| // need to show them again if they were enabled before | ||
| luaApi?.action.triggerAction(Data['marks'].showAction); | ||
| } | ||
| setSizeToggle('small'); | ||
| break; | ||
| case 'large': | ||
| luaApi?.action.triggerAction(Data['large'].showAction); | ||
| if (isTextureOn('marks')) { | ||
| // The action for showing the large letters also hides the marks, so we | ||
| // need to show them again if they were enabled before | ||
| luaApi?.action.triggerAction(Data['marks'].showAction); | ||
| } | ||
| setSizeToggle('large'); | ||
| break; | ||
| default: | ||
| setSizeToggle(undefined); | ||
| break; | ||
| } | ||
| }} |
There was a problem hiding this comment.
Should this be its own function instead?
| onChange={(event) => | ||
| luaApi?.action.triggerAction( | ||
| event.target.checked ? Data['marks'].showAction : Data['marks'].hideAction | ||
| ) |
There was a problem hiding this comment.
Should be wrapped with in a function body right?
| /> | ||
| } | ||
| <MarkingsToggleLayout | ||
| onClick={() => checkboxChange(!isVisible)} |
There was a problem hiding this comment.
| onClick={() => checkboxChange(!isVisible)} | |
| onClick={() => { checkboxChange(!isVisible)} } |
To follow our new guidelines?
There was a problem hiding this comment.
This might need some discussion, at least in my mind. I sent out a question about onclicks specifically in Slack a while ago, but never got a reply
This suggestion is missing a semicolon, which is required when including brackets, and due to our linting, this would result in three lines instead of one:
| onClick={() => checkboxChange(!isVisible)} | |
| onClick={() => { | |
| checkboxChange(!isVisible); | |
| }} |
Personally, I feel like it adds clutter in a way that I find undesired for simple onclick functions, and I'm wondering if we want ot make an exception for things like onChange and onClick. In these cases, it's already quite obvious that there is no value being returned. Thoughts?
I know I'm also biased towards writing things in one line generally, so would like to hear what you think @ylvaselling @engbergandreas and maybe @alexanderbock :)
There was a problem hiding this comment.
Pinged you all in Slack as well
| variant={'subtle'} | ||
| onClick={() => | ||
| luaApi?.action.triggerAction('os.nightsky.HideAllConstellationElements') | ||
| } |
| @@ -83,20 +86,22 @@ export function SunTab() { | |||
| <Button onClick={() => setAngularSize(0.8)}> | |||
| </ActionIcon> | ||
| <ActionIcon.Group> | ||
| <ActionIcon | ||
| onClick={() => setAngularSize(angularSize - 0.1)} |
| <MinusIcon /> | ||
| </ActionIcon> | ||
| <ActionIcon | ||
| onClick={() => setAngularSize(angularSize + 0.1)} |
| <Button | ||
| size={'compact-sm'} | ||
| leftSection={<EyeOffIcon />} | ||
| onClick={() => luaApi.fadeOut(`{${sunTrailTag}}`)} |
| "aria-labels": { | ||
| "small": "Show cardinal directions (small)", | ||
| "large": "Show cardianl directions (large)", | ||
| "toggle": "Toggle cardinal directions' size", |
There was a problem hiding this comment.
| "toggle": "Toggle cardinal directions' size", | |
| "toggle": "Toggle cardinal directions' sizes", |
| "add-trail-simulation-date": "Add trail for Simulation Date", | ||
| "add-trail-today": "Add trail for Today", |
There was a problem hiding this comment.
| "add-trail-simulation-date": "Add trail for Simulation Date", | |
| "add-trail-today": "Add trail for Today", | |
| "add-trail-simulation-date": "Add trail for 'Simulation Date'", | |
| "add-trail-today": "Add trail for 'Today'", |
Alternative suggestion to make it more clear that that is the important part of the sentence
| /** | ||
| * The identifier of the scene graph node that this toggle represents | ||
| */ |
There was a problem hiding this comment.
| /** | |
| * The identifier of the scene graph node that this toggle represents | |
| */ | |
| // The identifier of the scene graph node that this toggle represents |
?

Closes OpenSpace/OpenSpace#3753 by adding a new ToggleCard component and improving the layout in the Night Sky Panel's Markings tab. IN discussion with @ylvaselling, I also changed the design for the Cardinal directions part to better reflect how this control works, and that it's different from the other toggles.
Drafting as the following needs to be fixed before merging:
New VS old Markings tab:

New VS old Sun tab:
