From 671d00cc7cd9070d1fe78a00eb814ffce5e27caa Mon Sep 17 00:00:00 2001 From: 0xda157 Date: Fri, 10 Jul 2026 13:44:40 -0700 Subject: [PATCH 1/4] remove empty jsx fragments --- fission/src/ui/components/ContextMenu.tsx | 6 +- .../src/ui/components/DragModeIndicator.tsx | 6 +- .../ui/components/ProgressNotification.tsx | 2 +- fission/src/ui/components/SceneOverlay.tsx | 2 +- .../ui/components/WPILibConnectionStatus.tsx | 6 +- fission/src/ui/panels/WsViewPanel.tsx | 4 +- .../ConfigureGamepiecePickupInterface.tsx | 76 +++++++++---------- .../ConfigureShotTrajectoryInterface.tsx | 76 +++++++++---------- .../interfaces/zones/ZoneConfigBase.tsx | 26 +++---- .../ui/panels/simulation/AutoTestPanel.tsx | 4 +- 10 files changed, 102 insertions(+), 106 deletions(-) diff --git a/fission/src/ui/components/ContextMenu.tsx b/fission/src/ui/components/ContextMenu.tsx index 11d4c871d6..67d2f7378d 100644 --- a/fission/src/ui/components/ContextMenu.tsx +++ b/fission/src/ui/components/ContextMenu.tsx @@ -24,9 +24,9 @@ const ContextMenu: React.FC = () => { }) }, []) - return !state ? ( - <> - ) : ( + if (!state) return null; + + return ( { globalAddToast("info", "Drag Mode", "Drag mode has been disabled") } - return enabled ? ( + if (!enabled) return null + + return ( { Drag Mode - ) : ( - <> ) } diff --git a/fission/src/ui/components/ProgressNotification.tsx b/fission/src/ui/components/ProgressNotification.tsx index e23b1434bf..5b94ccfc85 100644 --- a/fission/src/ui/components/ProgressNotification.tsx +++ b/fission/src/ui/components/ProgressNotification.tsx @@ -146,7 +146,7 @@ const ProgressNotifications: React.FC = () => { gap: "0.5rem", }} > - {progressElements ?? <>} + {progressElements} ) } diff --git a/fission/src/ui/components/SceneOverlay.tsx b/fission/src/ui/components/SceneOverlay.tsx index 9d142e16a9..d723ebbd76 100644 --- a/fission/src/ui/components/SceneOverlay.tsx +++ b/fission/src/ui/components/SceneOverlay.tsx @@ -19,7 +19,7 @@ const SceneOverlay: React.FC = () => { /* h1 text for each tagMap tag */ const [components, updateComponents] = useReducer(() => { - if (isDisabled) return <> // if the overlay is disabled, return nothing + if (isDisabled) return null return [...tagMap.values()].map(x => (
{ return () => clearInterval(handle) }, []) - return enabled ? ( + if (!enabled) return null + + return ( { )} - ) : ( - <> ) } diff --git a/fission/src/ui/panels/WsViewPanel.tsx b/fission/src/ui/panels/WsViewPanel.tsx index 12a3e945cf..139ca20c67 100644 --- a/fission/src/ui/panels/WsViewPanel.tsx +++ b/fission/src/ui/panels/WsViewPanel.tsx @@ -174,7 +174,7 @@ const WSViewPanel: React.FC> = ({ panel }) => { ))} {/* {deviceSelect} */} - {selectedDevice ? ( + {selectedDevice && ( setField(e.target.value)} /> setValue(e.target.value)} /> @@ -196,8 +196,6 @@ const WSViewPanel: React.FC> = ({ panel }) => { Set - ) : ( - <> )} diff --git a/fission/src/ui/panels/configuring/assembly-config/interfaces/ConfigureGamepiecePickupInterface.tsx b/fission/src/ui/panels/configuring/assembly-config/interfaces/ConfigureGamepiecePickupInterface.tsx index 1ac5413dd1..136d17f58d 100644 --- a/fission/src/ui/panels/configuring/assembly-config/interfaces/ConfigureGamepiecePickupInterface.tsx +++ b/fission/src/ui/panels/configuring/assembly-config/interfaces/ConfigureGamepiecePickupInterface.tsx @@ -139,48 +139,48 @@ const ConfigureGamepiecePickupInterface: React.FC = ({ select }, []) const gizmoComponent = useMemo(() => { - if (selectedRobot?.intakePreferences) { - const postGizmoCreation = (gizmo: GizmoSceneObject) => { - const material = (gizmo.obj as THREE.Mesh).material as THREE.Material - material.depthTest = false - - const deltaTransformation = convertArrayToThreeMatrix4( - selectedRobot.intakePreferences!.deltaTransformation - ) - - let nodeBodyId = selectedRobot.mechanism.nodeToBody.get( - selectedRobot.intakePreferences!.parentNode ?? selectedRobot.rootNodeId - ) - if (!nodeBodyId) { - // In the event that something about the id generation for the rigid nodes changes and parent node id is no longer in use - nodeBodyId = selectedRobot.mechanism.nodeToBody.get(selectedRobot.rootNodeId)! - } - - /** W = L x R. See save() for math details */ - const robotTransformation = convertJoltMat44ToThreeMatrix4( - World.physicsSystem.getBody(nodeBodyId)!.GetWorldTransform() - ) - const gizmoTransformation = deltaTransformation.premultiply(robotTransformation) - - gizmo.setTransform(gizmoTransformation) + if (!selectedRobot?.intakePreferences) { + gizmoRef.current = undefined + return null + } + + const postGizmoCreation = (gizmo: GizmoSceneObject) => { + const material = (gizmo.obj as THREE.Mesh).material as THREE.Material + material.depthTest = false + + const deltaTransformation = convertArrayToThreeMatrix4( + selectedRobot.intakePreferences!.deltaTransformation + ) + + let nodeBodyId = selectedRobot.mechanism.nodeToBody.get( + selectedRobot.intakePreferences!.parentNode ?? selectedRobot.rootNodeId + ) + if (!nodeBodyId) { + // In the event that something about the id generation for the rigid nodes changes and parent node id is no longer in use + nodeBodyId = selectedRobot.mechanism.nodeToBody.get(selectedRobot.rootNodeId)! } - return ( - + /** W = L x R. See save() for math details */ + const robotTransformation = convertJoltMat44ToThreeMatrix4( + World.physicsSystem.getBody(nodeBodyId)!.GetWorldTransform() ) - } else { - gizmoRef.current = undefined - return <> + const gizmoTransformation = deltaTransformation.premultiply(robotTransformation) + + gizmo.setTransform(gizmoTransformation) } + + return ( + + ) }, [ selectedRobot?.intakePreferences, placeholderMesh, diff --git a/fission/src/ui/panels/configuring/assembly-config/interfaces/ConfigureShotTrajectoryInterface.tsx b/fission/src/ui/panels/configuring/assembly-config/interfaces/ConfigureShotTrajectoryInterface.tsx index ed22ae5bd7..59a34a1b24 100644 --- a/fission/src/ui/panels/configuring/assembly-config/interfaces/ConfigureShotTrajectoryInterface.tsx +++ b/fission/src/ui/panels/configuring/assembly-config/interfaces/ConfigureShotTrajectoryInterface.tsx @@ -117,48 +117,48 @@ const ConfigureShotTrajectoryInterface: React.FC = ({ select }, []) const gizmoComponent = useMemo(() => { - if (selectedRobot?.ejectorPreferences) { - const postGizmoCreation = (gizmo: GizmoSceneObject) => { - const material = (gizmo.obj as THREE.Mesh).material as THREE.Material - material.depthTest = false - - const deltaTransformation = convertArrayToThreeMatrix4( - selectedRobot.ejectorPreferences!.deltaTransformation - ) - - let nodeBodyId = selectedRobot.mechanism.nodeToBody.get( - selectedRobot.ejectorPreferences!.parentNode ?? selectedRobot.rootNodeId - ) - if (!nodeBodyId) { - // In the event that something about the id generation for the rigid nodes changes and parent node id is no longer in use - nodeBodyId = selectedRobot.mechanism.nodeToBody.get(selectedRobot.rootNodeId)! - } - - /** W = L x R. See save() for math details */ - const robotTransformation = convertJoltMat44ToThreeMatrix4( - World.physicsSystem.getBody(nodeBodyId)!.GetWorldTransform() - ) - const gizmoTransformation = deltaTransformation.premultiply(robotTransformation) - - gizmo.obj.position.setFromMatrixPosition(gizmoTransformation) - gizmo.obj.rotation.setFromRotationMatrix(gizmoTransformation) + if (!selectedRobot?.ejectorPreferences) { + gizmoRef.current = undefined + return null + } + + const postGizmoCreation = (gizmo: GizmoSceneObject) => { + const material = (gizmo.obj as THREE.Mesh).material as THREE.Material + material.depthTest = false + + const deltaTransformation = convertArrayToThreeMatrix4( + selectedRobot.ejectorPreferences!.deltaTransformation + ) + + let nodeBodyId = selectedRobot.mechanism.nodeToBody.get( + selectedRobot.ejectorPreferences!.parentNode ?? selectedRobot.rootNodeId + ) + if (!nodeBodyId) { + // In the event that something about the id generation for the rigid nodes changes and parent node id is no longer in use + nodeBodyId = selectedRobot.mechanism.nodeToBody.get(selectedRobot.rootNodeId)! } - return ( - + /** W = L x R. See save() for math details */ + const robotTransformation = convertJoltMat44ToThreeMatrix4( + World.physicsSystem.getBody(nodeBodyId)!.GetWorldTransform() ) - } else { - gizmoRef.current = undefined - return <> + const gizmoTransformation = deltaTransformation.premultiply(robotTransformation) + + gizmo.obj.position.setFromMatrixPosition(gizmoTransformation) + gizmo.obj.rotation.setFromRotationMatrix(gizmoTransformation) } + + return ( + + ) }, [ placeholderMesh, selectedRobot.ejectorPreferences, diff --git a/fission/src/ui/panels/configuring/assembly-config/interfaces/zones/ZoneConfigBase.tsx b/fission/src/ui/panels/configuring/assembly-config/interfaces/zones/ZoneConfigBase.tsx index 7befd9e19a..5c47680038 100644 --- a/fission/src/ui/panels/configuring/assembly-config/interfaces/zones/ZoneConfigBase.tsx +++ b/fission/src/ui/panels/configuring/assembly-config/interfaces/zones/ZoneConfigBase.tsx @@ -202,21 +202,21 @@ export default function ZoneConfigBase(props: ) const gizmoComponent = useMemo(() => { - if (selectedField && selectedZone) { - return ( - - ) - } else { + if (!selectedField || !selectedZone) { gizmoRef.current = undefined - return <> + return null } + + return ( + + ) }, [selectedField, selectedZone, defaultGizmoMesh, postGizmoCreation]) const trySetSelectedNode = useCallback( diff --git a/fission/src/ui/panels/simulation/AutoTestPanel.tsx b/fission/src/ui/panels/simulation/AutoTestPanel.tsx index 753df6daf0..11f92016ab 100644 --- a/fission/src/ui/panels/simulation/AutoTestPanel.tsx +++ b/fission/src/ui/panels/simulation/AutoTestPanel.tsx @@ -342,15 +342,13 @@ const AutoTestPanel: React.FC> = ({ panel }) => { setEnd={setActiveProps} state="Playing" /> - ) : activeProps.state === "End" ? ( + ) : activeProps.state === "End" && ( - ) : ( - <> ))} ) From 456467ea23c483d5b4494f7c98bb6d89535a2249 Mon Sep 17 00:00:00 2001 From: 0xda157 Date: Fri, 10 Jul 2026 13:56:36 -0700 Subject: [PATCH 2/4] simplify jsx ternary --- fission/src/.npmrc | 1 + fission/src/ui/components/ContextMenu.tsx | 2 +- fission/src/ui/components/SelectMenu.tsx | 38 +++--- .../ui/components/WPILibConnectionStatus.tsx | 2 +- .../ConfigureGamepiecePickupInterface.tsx | 4 +- .../inputs/ConfigureInputsInterface.tsx | 119 +++++++++--------- .../ConfigureProtectedZonesInterface.tsx | 51 ++++---- .../ConfigureScoringZonesInterface.tsx | 51 ++++---- .../ui/panels/mirabuf/ImportMirabufPanel.tsx | 24 ++-- .../ui/panels/simulation/AutoTestPanel.tsx | 16 +-- .../src/ui/panels/simulation/WiringPanel.tsx | 70 +++++------ 11 files changed, 180 insertions(+), 198 deletions(-) create mode 100644 fission/src/.npmrc diff --git a/fission/src/.npmrc b/fission/src/.npmrc new file mode 100644 index 0000000000..021434cd82 --- /dev/null +++ b/fission/src/.npmrc @@ -0,0 +1 @@ +registry=https://npm.autodesk.com/artifactory/api/npm/npm-remote/ diff --git a/fission/src/ui/components/ContextMenu.tsx b/fission/src/ui/components/ContextMenu.tsx index 67d2f7378d..a115df7265 100644 --- a/fission/src/ui/components/ContextMenu.tsx +++ b/fission/src/ui/components/ContextMenu.tsx @@ -24,7 +24,7 @@ const ContextMenu: React.FC = () => { }) }, []) - if (!state) return null; + if (!state) return null return ( = ({ <> {/** List of options */} - {options.length > 0 ? ( - options.map((option, i) => { - return ( - { - setSelectedOption(val) - onOptionSelected(val) - }} - key={option.name + i} - onDelete={onDelete ? () => onDelete(option) : undefined} - includeDelete={deleteCondition === undefined || deleteCondition(option)} - /> - ) - }) - ) : ( - <> - {/** No options available text */} - - - )} + {options.length <= 0 && } + {options.map((option, i) => { + return ( + { + setSelectedOption(val) + onOptionSelected(val) + }} + key={option.name + i} + onDelete={onDelete ? () => onDelete(option) : undefined} + includeDelete={deleteCondition === undefined || deleteCondition(option)} + /> + ) + })} {/** Add button */} {onAddClicked && ( diff --git a/fission/src/ui/panels/configuring/initial-config/InputSchemeSelection.tsx b/fission/src/ui/panels/configuring/initial-config/InputSchemeSelection.tsx index 4c56a0bb6c..2c82a46b4b 100644 --- a/fission/src/ui/panels/configuring/initial-config/InputSchemeSelection.tsx +++ b/fission/src/ui/panels/configuring/initial-config/InputSchemeSelection.tsx @@ -47,18 +47,18 @@ const SchemeSelector: React.FC = ({ if (scheme.usesTouchControls && !matchMedia("(hover: none)").matches) return null return ( - + - + {/** Select button */} = ({ key, name, primaryButtonNode, primaryOnClick, secondaryOnClick }) => { return ( - + {secondaryOnClick && } @@ -463,9 +463,9 @@ const ImportMirabufPanel: React.FC