studio icon indicating copy to clipboard operation
studio copied to clipboard

[New3D] Update settings sidebar when toggling 2D/3D mode via panel

Open jtbandes opened this issue 1 year ago • 0 comments

User-Facing Changes Fixed a bug in the 3D (Beta) panel where the settings sidebar would not update when toggling between 2D/3D mode via the panel button or keyboard shortcut. Fixed an issue with numeric step buttons in 3D (Beta) panel settings not working for Phi, Theta, and Y-Axis FOV.

Description For performance reasons, the New3D panel does not call updatePanelSettingsEditor any time its configuration changes, but only when the panel deems necessary (usually in a settings action handler, or when a scene extension notices a change in the underlying data source, after a debounced waiting period). The 2D/3D toggle button & keyboard shortcut were implemented via directly changing the config, and the config change triggers a re-render via useEffect, but that did not trigger an update of the settings tree. (The CoreSettings object updates its settings subtree when it detects a cameraMove event from the panel, but in this case the change did not come from the panel.) The fix is to manually tell the CoreSettings object to update the tree after the setting is toggled.

The ONE_DEGREE -> 1 change fixes a regression from https://github.com/foxglove/studio/pull/4043 where we forgot to update the step values in settings tree when the values changed from radians to degrees.

jtbandes avatar Aug 17 '22 00:08 jtbandes