Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8315f2a
WIP: Refactor screenspace renderable list to work more like scene menu
WeirdRubberDuck Aug 10, 2026
704a0cb
Make the add part a bit smaller
WeirdRubberDuck Aug 10, 2026
f3e04cb
Make decorated icon more compact, by overlaying a theme icon
WeirdRubberDuck Aug 10, 2026
474429f
Add setting for decorator color
WeirdRubberDuck Aug 10, 2026
42824b7
Merge branch 'features/decorated-icon-update' into feature/screenspac…
WeirdRubberDuck Aug 10, 2026
cda4d7e
Use add icons
WeirdRubberDuck Aug 10, 2026
798d64a
Show an icon based on renderable type and make sure to show relevant …
WeirdRubberDuck Aug 11, 2026
17c2eea
Restructure files and start building custom placement component
WeirdRubberDuck Aug 11, 2026
78f7c55
Rough draft of position widget
WeirdRubberDuck Aug 11, 2026
9ba7a77
Add stepping for all number inputs
WeirdRubberDuck Aug 11, 2026
4063f71
Add draft of local rotation input too
WeirdRubberDuck Aug 11, 2026
74f0251
Add tooltips to some action icons
WeirdRubberDuck Aug 11, 2026
8512992
Add a popout button
WeirdRubberDuck Aug 12, 2026
af5eaea
Increase size of angle input
WeirdRubberDuck Aug 12, 2026
920ab1c
Merge branch 'master' into feature/screenspace-renderable-update
WeirdRubberDuck Aug 12, 2026
1f074d7
Move popout and remove to a more menu
WeirdRubberDuck Aug 12, 2026
b735c39
Refactor placement component
WeirdRubberDuck Aug 12, 2026
993685d
Disable rotation reset if value is 0
WeirdRubberDuck Aug 12, 2026
6e12ca4
Fix wrong icon
WeirdRubberDuck Aug 12, 2026
f63e048
Rename hooks file for removal modals
WeirdRubberDuck Aug 12, 2026
7f9ae9c
Move add functionality to a separate modal
WeirdRubberDuck Aug 12, 2026
ce6d32b
Add support for loading videos
WeirdRubberDuck Aug 12, 2026
84cc021
handle quotes in file name and add video settings for look and audio
WeirdRubberDuck Aug 12, 2026
59e4153
Add some more icons
WeirdRubberDuck Aug 12, 2026
f2976a5
Add option to add text
WeirdRubberDuck Aug 12, 2026
db29c6e
Add icon for ScreenSpaceDashboard
WeirdRubberDuck Aug 12, 2026
dba61a0
Remove unused include
WeirdRubberDuck Aug 12, 2026
396332a
Make a component to style the vec3 property groups and give them an a…
WeirdRubberDuck Aug 13, 2026
448cffe
Hide distance sub-property for advanced users
WeirdRubberDuck Aug 13, 2026
72c4620
Change icon for resetting local rotation
WeirdRubberDuck Aug 13, 2026
f42cf77
Reformat segmented contorl labels
WeirdRubberDuck Aug 13, 2026
55f47ea
Merge branch 'master' into feature/screenspace-renderable-update
WeirdRubberDuck Aug 13, 2026
bf12dec
Update an icon
WeirdRubberDuck Aug 14, 2026
df53f63
Update docs of hidedn properties again
WeirdRubberDuck Aug 14, 2026
df08e30
Make list of renderables a filterlist
WeirdRubberDuck Aug 14, 2026
d1f75fe
Filter out gui hidden objects
WeirdRubberDuck Aug 14, 2026
04f5ef4
Make name field not required in add modal
WeirdRubberDuck Aug 14, 2026
12f03e2
Merge branch 'master' into feature/screenspace-renderable-update
WeirdRubberDuck Aug 14, 2026
fadd59b
Use NumberInput component for ocnsistent behavior across UI
WeirdRubberDuck Aug 14, 2026
2563356
Add tooltip to test website button
WeirdRubberDuck Aug 14, 2026
f6dc22f
Move texts to translation system
WeirdRubberDuck Aug 18, 2026
a20abeb
Tiny cleanup
WeirdRubberDuck Aug 18, 2026
c2600aa
Small refactor
WeirdRubberDuck Aug 18, 2026
27d7c27
Oops, fix duplicated translations
WeirdRubberDuck Aug 18, 2026
76f5544
Apply suggestions from code review
WeirdRubberDuck Aug 19, 2026
b6cafe2
Clarify that text is a tooltip
WeirdRubberDuck Aug 19, 2026
8bd4ba9
Refactor aria labels
WeirdRubberDuck Aug 19, 2026
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
132 changes: 112 additions & 20 deletions public/locales/en/panel-screenspacerenderable.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,118 @@
{
"display-name-input": {
"title": "Display name",
"placeholder": "Slide name"
},
"image-input": {
"tab-title": "Image",
"title": "Path or URL to image",
"placeholder": "Path / URL",
"button-label": "Add"
},
"website-input": {
"tab-title": "Website",
"title": "URL to website",
"placeholder": "URL",
"button-label": "Add"
"add-modal": {
"button-label": "Add",
"title": "Add Screenspace Renderable",
"name-input": {
"title": "Display name",
"placeholder": "Enter a name to show in the GUI"
},
"image": {
"tab-title": "Image",
"title": "Path or URL to image",
"placeholder": "C:/path/to/image.png or https://example.com/image.png",
"error": {
"title": "Error: invalid base64 encoding format",
"description": "Cannot parse invalid format '{{format}}', supported base64 encoding images are 'png' and 'jpeg'"
}
},
"website": {
"tab-title": "Website",
"title": "Website URL",
"placeholder": "https://example.com",
"test-button": {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"test-button": {
"test-button": {

"label": "Test",
"tooltip": "Test website link (open in browser)"
}
},
"video": {
"tab-title": "Video",
"title": "Path to video file",
"placeholder": "C:/path/to/video.mp4",
"loop": {
"label": "Loop video"
},
"play-audio": {
"label": "Play audio"
}
},
"text": {
"tab-title": "Text",
"title": "Text content",
"placeholder": "Enter the text to display"
},
"add-button": {
"label": "Add",
"disabled-tooltip": "Please provide some valid content for the Screenspace renderable."
}
},
"added-slides": {
"empty-slides": "No active slides",
"remove-slide-aria-label": "Remove slide"
"search-placeholder": "Search...",
"empty": "Add Screenspace renderables to view them here.",
"tips": "Tip: Try adding an image or video file by dragging and dropping it."
},
"no-selection-hint": "Select an item to view its details",
"more-menu": {
"aria-label": "Open more menu",
"delete-button": {
"label": "Delete",
"info": "Remove this Screenspace renderable"
},
"delete-confirm-modal": {
"title": "Delete Screenspace Renderable",
"are-you-sure": "Are you sure you want to remove the Screenspace renderable",
"remove-button": "Remove",
"cancel-button": "Cancel"
},
"pop-out": "Pop out"
},
"error": {
"title": "Error: invalid base64 encoding format",
"description": "Cannot parse invalid format '{{format}}', supported base64 encoding images are 'png' and 'jpeg'"
"renderable-view": {
"placement-tab": {
"title": "Placement",
"mode-switch": {
"aria-label": "Placement mode",
"label-rae": "Spherical (RAE)",
"label-xyz": "Cartesian (XYZ)"
},
"spherical-controls": {
"label": "Spherical position",
"description": "Screenspace position in spherical coordinates (radius, azimuth, elevation). Radius is an advanced property hidden for other user levels. It controls the distance to the screenspace plane, allowing objects to be layered at different depths.",
"radius": {
"label": "Radius"
},
"azimuth": {
"label": "Azimuth"
},
"elevation": {
"label": "Elevation"
}
},
"cartesian-controls": {
"label": "Cartesian position",
"description": "Screenspace position in Cartesian coordinates (x, y, z). The z-coordinate is an advanced property hidden for other user levels. It controls the distance to the screenspace plane, allowing objects to be layered at different depths."
},
"local-rotation": {
"label": "Local rotation",
"roll": {
"label": "Roll"
},
"pitch": {
"label": "Pitch"
},
"yaw": {
"label": "Yaw"
},
"reset-button": {
"tooltip": "Reset",
"aria-label": "Reset local rotation"
}
}
},
"style-tab": {
"title": "Style"
},
"renderable-tab": {
"title": "Renderable",
"tooltip": "Main properties of the Screenspace renderable, including the ones for the specific type."
}
}
}
91 changes: 91 additions & 0 deletions src/components/AngleInput/AngleInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { useEffect, useId, useState } from 'react';
import { AngleSlider, Group, Stack } from '@mantine/core';
import { useThrottledCallback } from '@mantine/hooks';

import { NumericInput } from '@/components/Input/NumericInput/NumericInput';

interface Props {
value: number; // Radians
label: React.ReactNode;
onChange?: (value: number) => void; // Radians
disabled?: boolean;
}

export function AngleInput({ value, label, onChange, disabled }: Props) {
const [currentAngle, setCurrentAngle] = useState(radiansToDegrees(value));
const [isInteracting, setIsInteracting] = useState(false);
const throttledNumberInputChange = useThrottledCallback((numericValue: number) => {
onChange?.(degreesToRadians(numericValue));
}, 300);

const labelId = useId();

function radiansToDegrees(radians: number) {
return (radians * 180) / Math.PI;
}

function degreesToRadians(degrees: number) {
return (degrees * Math.PI) / 180;
}

useEffect(() => {
if (!isInteracting) {
setCurrentAngle(radiansToDegrees(value));
}
}, [value, isInteracting]);

return (
<Stack gap={2} flex={1} align={'center'}>
<div id={labelId}>{label}</div>
<Group align={'center'} justify={'center'} gap={5}>
<AngleSlider
marks={[
{ value: 0 },
{ value: 45 },
{ value: 90 },
{ value: 135 },
{ value: 180 },
{ value: 225 },
{ value: 270 },
{ value: 315 }
]}
size={50}
value={currentAngle}
onChange={(newValue) => {
setIsInteracting(true);
setCurrentAngle(newValue);
onChange?.(degreesToRadians(newValue));
}}
onChangeEnd={() => setIsInteracting(false)}
formatLabel={(labelValue) => `${Math.round(labelValue)}°`}
disabled={disabled}
aria-labelledby={labelId}
/>
<NumericInput
value={currentAngle}
flex={1}
miw={50}
maw={80}
size={'xs'}
min={-360}
max={360}
step={1}
decimalScale={1}
onChange={() => setIsInteracting(true)}
onEnter={(newValue) => {
const numericValue = Number(newValue);
if (numericValue === undefined) {
return;
}
setCurrentAngle(numericValue);
throttledNumberInputChange(numericValue);
}}
onFocus={() => setIsInteracting(true)}
onBlur={() => setIsInteracting(false)}
disabled={disabled}
aria-labelledby={labelId}
/>
</Group>
</Stack>
);
}
24 changes: 21 additions & 3 deletions src/components/PropertyOwner/PropertyOwner.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useMemo } from 'react';

import {
useHasVisibleChildren,
usePropertyOwner,
Expand All @@ -7,7 +9,7 @@ import { useAppSelector } from '@/redux/hooks';
import { propertySelectors } from '@/redux/propertytree/propertySlice';
import { Uri } from '@/types/types';
import { displayName } from '@/util/propertyTreeHelpers';
import { isGlobeLayersUri, parentTypeUri } from '@/util/uris';
import { identifierFromUri, isGlobeLayersUri, parentTypeUri } from '@/util/uris';

import { GlobeLayersPropertyOwner } from './Custom/GlobeLayers/GlobeLayersPropertyOwner';
import { VideoPlayerPropertyOwner } from './Custom/VideoPlayer/VideoPlayerPropertyOwner';
Expand All @@ -18,7 +20,11 @@ interface Props {
uri: Uri;
expandedOnDefault?: boolean;
showOnlyChildren?: boolean;
hideSubowners?: boolean;
/**
* If true, hide all subowners. If array, hide only the subowners with identifiers in
* the array
*/
hideSubowners?: boolean | string[];
}

export function PropertyOwner({
Expand Down Expand Up @@ -48,7 +54,19 @@ export function PropertyOwner({

const hasVisibleChildren = useHasVisibleChildren(uri);
const visibleProperties = useVisibleProperties(propertyOwner);
const subowners = hideSubowners ? [] : (propertyOwner.subowners ?? []);

const subowners = useMemo(() => {
if (hideSubowners === true) {
return [];
}

if (Array.isArray(hideSubowners)) {
return (propertyOwner.subowners ?? []).filter(
(subowner) => !hideSubowners.includes(identifierFromUri(subowner))
);
}
return propertyOwner.subowners ?? [];
}, [propertyOwner.subowners, hideSubowners]);

// If there is no content to show for the current visibility settings, we don't want to
// render this property owner
Expand Down
15 changes: 15 additions & 0 deletions src/hooks/userLevel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { usePropertyValue } from '@/hooks/properties';
import { PropertyVisibilityNumber } from '@/types/enums';

export function useIsAdvancedUserLevel(): boolean {
const userLevel = usePropertyValue(
'OptionProperty',
'OpenSpaceEngine.PropertyVisibility'
);

if (userLevel === undefined) {
throw new Error('User level property is undefined');
}
Comment on lines +10 to +12

return userLevel >= PropertyVisibilityNumber.AdvancedUser;
}
13 changes: 11 additions & 2 deletions src/icons/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export {
FaPlus as PlusIcon,
FaRegSave as SaveIcon
} from 'react-icons/fa';
export {
FaArrowsLeftRight as ArrowsLeftRightIcon,
FaArrowsUpDown as ArrowsUpDownIcon,
FaArrowRotateLeft as RotateLeftIcon
} from 'react-icons/fa6';
export {
FiChevronsDown as ChevronsDownIcon,
FiChevronsUp as ChevronsUpIcon
Expand All @@ -24,17 +29,19 @@ export {
GiNightSky as NightSkyIcon,
GiPencil as PencilIcon
} from 'react-icons/gi';
export { GoBrowser as BrowserIcon } from 'react-icons/go';
export { GoBrowser as BrowserIcon, GoVideo as VideoIcon } from 'react-icons/go';
export { GoMoveToEnd as GoToEnd, GoMoveToStart as GoToStart } from 'react-icons/go';
export { ImSphere as GridSphereIcon } from 'react-icons/im';
export { IoMdGlobe as GlobeIcon, IoMdTime as TimeIcon } from 'react-icons/io';
export {
IoInformationCircleOutline as InformationCircleOutlineIcon,
IoInformation as InformationIcon,
IoTelescopeOutline as TelescopeIcon
IoTelescopeOutline as TelescopeIcon,
IoText as TextIcon
} from 'react-icons/io5';
export {
LuFilePlus2 as AddFileIcon,
LuFileClock as FileClockIcon,
LuFileText as FileTextIcon,
LuFolderUp as FolderBackIcon,
LuFolder as FolderIcon,
Expand Down Expand Up @@ -101,6 +108,7 @@ export {
MdSettings as SettingsIcon,
MdStop as StopIcon,
MdSunny as SunIcon,
MdShortText as TextShortIcon,
MdTimer as TimerIcon,
MdArrowUpward as UpArrowIcon,
MdVideocam as VideocamIcon,
Expand Down Expand Up @@ -140,6 +148,7 @@ export {
TbCube as SceneIcon,
TbScript as ScriptLogIcon,
TbServer as ServerIcon,
TbShape as ShapeIcon,
TbWorldWww as WebIcon
} from 'react-icons/tb';
export {
Expand Down
2 changes: 1 addition & 1 deletion src/panels/GeoLocationPanel/AddedCustomNodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useAppSelector } from '@/redux/hooks';
import { GeoLocationGroupKey } from '@/util/keys';
import { useAnchorNode } from '@/util/propertyTreeHooks';
import { identifierFromUri, sgnUri } from '@/util/uris';
import { useRemoveSceneGraphNodeModal } from '@/util/useRemoveSceneGraphNode';
import { useRemoveSceneGraphNodeModal } from '@/util/removeModalsHooks';

export function AddedCustomNodes() {
const { t } = useTranslation('panel-geolocation', { keyPrefix: 'added-custom-nodes' });
Expand Down
2 changes: 1 addition & 1 deletion src/panels/Scene/SceneGraphNode/SceneGraphNodeMoreMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Uri } from '@/types/types';
import { displayName } from '@/util/propertyTreeHelpers';
import { useAnchorNode } from '@/util/propertyTreeHooks';
import { identifierFromUri } from '@/util/uris';
import { useRemoveSceneGraphNodeModal } from '@/util/useRemoveSceneGraphNode';
import { useRemoveSceneGraphNodeModal } from '@/util/removeModalsHooks';
import { useWindowLayoutProvider } from '@/windowmanagement/WindowLayout/hooks';

import { SceneGraphNodeView } from './SceneGraphNodeView';
Expand Down
Loading