-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidebar: Expand advanced panel if only item in settings tab #46024
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: +42 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
6fd922d
to
8280a39
Compare
I don't think there's an easy way to solve this. Even though it's possible to count the
So there are some real technical limitations. The best ideas I had were:
Both feel a bit hacky. |
Given the technical limitations around fill count I'm going to close this PR. If the desire for auto-expanding this panel grows, we can revisit the other proposed options. |
Related:
What?
Expands the Advanced controls panel by default when it is the only item under the sidebar settings tab.
Why?
Having the advanced controls panel remain collapsed when it is the only item in the tab looks odd. Expanding it in this scenario may also save the user a click.
How?
If there are no fills being rendered within the
default
inspector controls slot, the advanced controls panel has itsinitialOpen
prop set totrue
.Known Issues
Conditionally rendered fills within the default inspector controls slot pose a problem. For example;
The above code still adds a fill to the slot. I haven't yet found a reliable means of determining that nothing is actually being rendered by the example above to still allow the auto-expansion of the advanced controls panel.
Alternative Approach
I did try setting a flag within a new SettingsTabContext and having any fills toggle that as they render however I couldn't get that working.
Testing Instructions
Screenshots or screencast
Screen.Recording.2022-11-24.at.4.05.13.pm.mp4