-
Notifications
You must be signed in to change notification settings - Fork 167
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
feature(inspector) split contextdata for multiselected sections #1925
Conversation
Job #234: Bundle Size — 43.94MB (~+0.01%).
Changed metrics (2/8)
Changed assets by type (2/7)
|
Link to test editor |
Link to test editor |
@@ -608,6 +614,31 @@ export const ComponentSectionInner = betterReactMemo( | |||
}, | |||
) | |||
|
|||
function useFilterPropsContext(paths: ElementPath[]): InspectorPropsContextData { | |||
const currentContext = useContext(InspectorPropsContext) | |||
const spiedProps = [...currentContext.spiedProps].filter((props) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These array spreads aren't necessary since the filter
creates a new array
Link to test editor |
Problem:
When multiselecting in the component-section and showing the subsections most of the controls are mixed multiselected, where they should be using the simple status.
Fix:
The multiselected component-section shows subsections for components where the property-controls are different, each subsection is a partial multiselection. The inspector context contains the selected props and spies collected for all selection to use it in one section instead of smaller subsections. The inspector hooks use the context to create controlstatus.
The fix is to split the
InspectorPropsContext
for section targets.Commit Details:
PropertyControlsSection