Currently, there is a bug where if you click on the last tab of a panel and delete that, the entire web app crashes (white page). This bug does not occur when you click on the body of the panel itself, which is likely why it has eluded discovery. This PR fixes that and simplifies how we remove child elements from the web app.
Testing procedure
[x] Recreate the bug: On master, open the web app. Add a Panel called test1. Go into customize, and click on the tab (the blue strip on top of the panel with the name test1 and click "delete"). Verify that the web app goes white.
[x] Verify the fix: Pull this branch, repeat the above test, verify the web app doesn't go blank and the layout is correctly updated.
[x] Test other cases:
[x] Start with the default layout (e.g., clear cookies).
[x] Deleting a non-last tab in a panel: Delete Arm & Lift and Wrist & Gripper.
[x] Deleting the last tab in a panel that is not the last Panel in the Layout Grid: Delete Base.
[x] Deleting the last tab in a panel that is the last Panel in the Layout Grid: Delete Safety.
[x] Delete a non-last element within a tab: Delete the gripper view.
[x] Delete the non-last element within a tab: Delete the nav cam view. Verify that the panel stays there with the tab, but the contents are empty.
[x] Delete the last panel in the layout: Delete the camera view panel.
Description
Currently, there is a bug where if you click on the last tab of a panel and delete that, the entire web app crashes (white page). This bug does not occur when you click on the body of the panel itself, which is likely why it has eluded discovery. This PR fixes that and simplifies how we remove child elements from the web app.
Testing procedure
master
, open the web app. Add a Panel calledtest1
. Go into customize, and click on the tab (the blue strip on top of the panel with the nametest1
and click "delete"). Verify that the web app goes white.Arm & Lift
andWrist & Gripper
.Base
.Safety
.Before opening a pull request
From the top-level of this repository, run:
pre-commit run --all-files
To merge
Squash & Merge