Skip to content

Commit

Permalink
0.2.15
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Nov 9, 2024
1 parent 377e7de commit 91b6b6c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ packages = ["src/viser"]

[project]
name = "viser"
version = "0.2.14"
version = "0.2.15"
description = "3D visualization + Python"
readme = "README.md"
license = { text="MIT" }
Expand Down
1 change: 0 additions & 1 deletion src/viser/client/src/ControlPanel/SceneTreeTable.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const propsWrapper = style({
border: "1px solid",
borderColor: vars.colors.defaultBorder,
padding: vars.spacing.xs,
paddingTop: "1.5em",
boxSizing: "border-box",
margin: vars.spacing.xs,
marginTop: "0.1em",
Expand Down
41 changes: 22 additions & 19 deletions src/viser/client/src/ControlPanel/SceneTreeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
IconDeviceFloppy,
IconX,
} from "@tabler/icons-react";
import React from "react";
import React, { Suspense } from "react";
import {
caretIcon,
editIconWrapper,
Expand Down Expand Up @@ -60,7 +60,6 @@ function EditNodeProps({
}

const props = node.message.props;
console.log(props);
const initialValues = Object.fromEntries(
Object.entries(props)
.filter(([, value]) => !(value instanceof Uint8Array))
Expand Down Expand Up @@ -111,11 +110,13 @@ function EditNodeProps({
>
<Box
style={{
position: "absolute",
top: "0.3em",
right: "0.4em",
display: "flex",
alignItems: "center",
}}
>
<Box fw="500" style={{ flexGrow: "1" }} fz="sm">
{node.message.type.replace("Message", "")} Props
</Box>
<Tooltip label={"Close props"}>
<IconX
style={{
Expand Down Expand Up @@ -248,7 +249,7 @@ function EditNodeProps({
);
})}
<Box fz="xs" opacity="0.4">
Changes can be overwritten by updates from the server.
Changes will be overwritten by updates from the server.
</Box>
</Box>
);
Expand All @@ -262,14 +263,16 @@ export default function SceneTreeTable() {
);
return (
<ScrollArea className={tableWrapper}>
{childrenName.map((name) => (
<SceneTreeTableRow
nodeName={name}
key={name}
isParentVisible={true}
indentCount={0}
/>
))}
<Suspense fallback={<div>Loading...</div>}>
{childrenName.map((name) => (
<SceneTreeTableRow
nodeName={name}
key={name}
isParentVisible={true}
indentCount={0}
/>
))}
</Suspense>
</ScrollArea>
);
}
Expand Down Expand Up @@ -318,7 +321,7 @@ const SceneTreeTableRow = React.memo(function SceneTreeTableRow(props: {
const isVisibleEffective = isVisible && props.isParentVisible;
const VisibleIcon = isVisible ? IconEye : IconEyeOff;

const [modalOpened, { open: openEditModal, close: closeEditModal }] =
const [propsPanelOpened, { open: openPropsPanel, close: closePropsPanel }] =
useDisclosure(false);

return (
Expand Down Expand Up @@ -376,7 +379,7 @@ const SceneTreeTableRow = React.memo(function SceneTreeTableRow(props: {
</span>
))}
</Box>
{!modalOpened ? (
{!propsPanelOpened ? (
<Box
className={editIconWrapper}
style={{
Expand All @@ -396,15 +399,15 @@ const SceneTreeTableRow = React.memo(function SceneTreeTableRow(props: {
}}
onClick={(evt) => {
evt.stopPropagation();
openEditModal();
openPropsPanel();
}}
/>
</Tooltip>
</Box>
) : null}
</Box>
{modalOpened ? (
<EditNodeProps nodeName={props.nodeName} close={closeEditModal} />
{propsPanelOpened ? (
<EditNodeProps nodeName={props.nodeName} close={closePropsPanel} />
) : null}
{expanded
? childrenName.map((name) => (
Expand Down

0 comments on commit 91b6b6c

Please sign in to comment.