Skip to content

Update Night Sky Panel's Markings tab + Small Sun Tab refactor#207

Open
WeirdRubberDuck wants to merge 22 commits intomasterfrom
issue/3753-nightsky-markings-layout
Open

Update Night Sky Panel's Markings tab + Small Sun Tab refactor#207
WeirdRubberDuck wants to merge 22 commits intomasterfrom
issue/3753-nightsky-markings-layout

Conversation

@WeirdRubberDuck
Copy link
Copy Markdown
Collaborator

@WeirdRubberDuck WeirdRubberDuck commented Mar 20, 2026

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:
image

New VS old Sun tab:
image

@WeirdRubberDuck WeirdRubberDuck marked this pull request as draft March 20, 2026 08:40
@WeirdRubberDuck
Copy link
Copy Markdown
Collaborator Author

WeirdRubberDuck commented Mar 20, 2026

The layout is now more responsive and uses an adaptive gridding similar to the skybrowser panel. Demonstration:

2026-03-20.09-43-50.mov

Comment thread src/components/ToggleCard/ToggleCard.module.css Outdated
Comment thread src/panels/NightSkyPanel/tabs/MarkingsTab/SceneGraphNodeToggle.tsx Outdated
WeirdRubberDuck and others added 3 commits March 27, 2026 09:13
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
@micahnyc
Copy link
Copy Markdown
Contributor

Actions now available here: https://github.com/OpenSpace/OpenSpace-WebGui/pull/207/changes and I updated this branch to call them.

@WeirdRubberDuck WeirdRubberDuck marked this pull request as ready for review April 15, 2026 09:32
@WeirdRubberDuck
Copy link
Copy Markdown
Collaborator Author

The "Cardinal Directions" part's design was changed once again... Now it corresponds more to how it actually works - with the scene graph node being enabled/disabled and then which texture is set. It also allows setting the visuals before showing the direction.

This is how it looks now:

image

@micahnyc
Copy link
Copy Markdown
Contributor

Looks and works great! Tested all the changes, and I updated the actions in the main repo to fix the hide all stuff

Copy link
Copy Markdown
Member

@engbergandreas engbergandreas left a comment

Choose a reason for hiding this comment

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

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!

Comment on lines +194 to +195
"add-trail-simulation-date": "Add trail for Simulation Date",
"add-trail-today": "Add trail for Today",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"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",

?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"label": "Show during Day",
"label": "Show during day",

Comment on lines +107 to +131
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;
}
}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be its own function instead?

Comment on lines +153 to +156
onChange={(event) =>
luaApi?.action.triggerAction(
event.target.checked ? Data['marks'].showAction : Data['marks'].hideAction
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be wrapped with in a function body right?

/>
}
<MarkingsToggleLayout
onClick={() => checkboxChange(!isVisible)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
onClick={() => checkboxChange(!isVisible)}
onClick={() => { checkboxChange(!isVisible)} }

To follow our new guidelines?

Copy link
Copy Markdown
Collaborator Author

@WeirdRubberDuck WeirdRubberDuck Apr 17, 2026

Choose a reason for hiding this comment

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

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:

Suggested change
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 :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Pinged you all in Slack as well

variant={'subtle'}
onClick={() =>
luaApi?.action.triggerAction('os.nightsky.HideAllConstellationElements')
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.

Comment on lines 80 to 86
@@ -83,20 +86,22 @@ export function SunTab() {
<Button onClick={() => setAngularSize(0.8)}>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

theese 3 aswell - sorry

</ActionIcon>
<ActionIcon.Group>
<ActionIcon
onClick={() => setAngularSize(angularSize - 0.1)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.

<MinusIcon />
</ActionIcon>
<ActionIcon
onClick={() => setAngularSize(angularSize + 0.1)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.

<Button
size={'compact-sm'}
leftSection={<EyeOffIcon />}
onClick={() => luaApi.fadeOut(`{${sunTrailTag}}`)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.

"aria-labels": {
"small": "Show cardinal directions (small)",
"large": "Show cardianl directions (large)",
"toggle": "Toggle cardinal directions' size",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"toggle": "Toggle cardinal directions' size",
"toggle": "Toggle cardinal directions' sizes",

Comment on lines +194 to +195
"add-trail-simulation-date": "Add trail for Simulation Date",
"add-trail-today": "Add trail for Today",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"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

Comment on lines +12 to +14
/**
* The identifier of the scene graph node that this toggle represents
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/**
* The identifier of the scene graph node that this toggle represents
*/
// The identifier of the scene graph node that this toggle represents

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NightSky Panel: Layout issues

4 participants