Commit f338005
authored
Inspector v2: Side pane collapsing and undocking (#17341)
With this PR the whole "side panes" (all tabs, top and bottom, plus
toolbars) can be:
1. Collapsed/expanded (small expand buttons will overlay the canvas in
the top corners)
2. "Undocked" to child windows
Styling in the child windows is easy to manage. No need to copy styles
or anything like Inspector v1, it just requires a little bit of Fluent
setup in the child window, and then only the used styles will be
injected into that window.
In the Inspector v2 implementation, when a child window is closed, it is
just re-docked in the main window. Also, child windows will
automatically close if Inspector itself is closed, or if the main window
is closed.
Unfortunately, the approach I initially used with portals to keep the
panes mounted all the time (so we don't lose their state when redocking)
*does not* work with child windows. Simply re-parenting a raw html
element into a child window basically bypasses all the fluent theming
and also seems to break other things. For this reason, I rolled that
part of the change back, which means when you redock a side pane, it is
unmounted/remounted and the state is lost. However, I did two things to
improve this:
1. Panes are not unmounted/remounted when the selected tab changes.
2. Scene explorer selects the currently selected entity when it first
mounts, so if you re-dock to a new location (including a child window),
it at least selects and scrolls to the same selected entity. This is
still an improvement over the v1 behavior!
<img width="1146" height="753" alt="image"
src="https://github.com/user-attachments/assets/8fff2e9f-aa38-44ed-ae63-71b01ae017c1"
/>
<img width="1149" height="751" alt="image"
src="https://github.com/user-attachments/assets/36e81e0c-26ed-4bad-a9ee-26762e295473"
/>
<img width="436" height="306" alt="image"
src="https://github.com/user-attachments/assets/b4ca7528-d805-4d2c-9bd0-eeb95286858d"
/>
<img width="1146" height="754" alt="image"
src="https://github.com/user-attachments/assets/79c533ee-67ca-4b9d-87b5-2fb30381d69c"
/>1 parent 58d6e06 commit f338005
File tree
4 files changed
+317
-166
lines changed- packages/dev/inspector-v2/src
- components
- scene
- services
4 files changed
+317
-166
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
Lines changed: 23 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
| 725 | + | |
| 726 | + | |
725 | 727 | | |
726 | 728 | | |
727 | 729 | | |
728 | 730 | | |
729 | 731 | | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
| 732 | + | |
| 733 | + | |
734 | 734 | | |
735 | | - | |
| 735 | + | |
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
| |||
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
746 | 757 | | |
| 758 | + | |
747 | 759 | | |
748 | | - | |
749 | | - | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
750 | 766 | | |
751 | 767 | | |
752 | 768 | | |
| |||
0 commit comments