Skip to content
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

Merged
merged 4 commits into from
Oct 18, 2021

Conversation

enidemi
Copy link
Contributor

@enidemi enidemi commented Oct 18, 2021

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:

  • update context
  • use new context in PropertyControlsSection

@relativeci
Copy link

relativeci bot commented Oct 18, 2021

Job #234: Bundle Size — 43.94MB (~+0.01%).

9b1a270 vs f263c8adc3f5f214ca65e681b34585a2fd7ce6c4

Changed metrics (2/8)
Metric Current Baseline
Initial JS 28.72MB(+0.02%) 28.72MB
Cache Invalidation 20.54% 0%
Changed assets by type (2/7)
            Current     Baseline
HTML 13.33KB (~+0.01%) 13.33KB
JS 43.93MB (~+0.01%) 43.92MB

View Job #234 report on app.relative-ci.com

@github-actions
Copy link
Contributor

Link to test editor
This PR:
Scroll Canvas: 66.2ms (48.4-271.3ms) | Resize: 102.7ms (16.1-279.5ms) | Selection: 311.4ms (258.5-797.2ms) | Calc Pi: 25ms (22-43ms) | Empty Dispatch: 49.6ms (39.6-133.9ms) | (Chart)
Compare with last deployed Master:
Scroll Canvas: 57.4ms (42.8-152.7ms) | Resize: 108.1ms (28.3-251.3ms) | Selection: 312.4ms (255.5-820.3ms) | Calc Pi: 28ms (25-47ms) | Empty Dispatch: 53.2ms (40-743.6ms) | (Chart)

@github-actions
Copy link
Contributor

Link to test editor
This PR:
Scroll Canvas: 69ms (55.9-220.9ms) | Resize: 113ms (19.4-228.1ms) | Selection: 343ms (293.7-1144.4ms) | Calc Pi: 27ms (26-36ms) | Empty Dispatch: 59.3ms (45.9-160.3ms) | (Chart)
Compare with last deployed Master:
Scroll Canvas: 69.4ms (48.1-116.3ms) | Resize: 125.9ms (19.7-1014.1ms) | Selection: 338.8ms (298.2-933ms) | Calc Pi: 28ms (26-49ms) | Empty Dispatch: 59.4ms (44.6-506.2ms) | (Chart)

@@ -608,6 +614,31 @@ export const ComponentSectionInner = betterReactMemo(
},
)

function useFilterPropsContext(paths: ElementPath[]): InspectorPropsContextData {
const currentContext = useContext(InspectorPropsContext)
const spiedProps = [...currentContext.spiedProps].filter((props) =>
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Link to test editor
This PR:
Scroll Canvas: 75.1ms (59.5-170.5ms) | Resize: 121.8ms (22.9-310.6ms) | Selection: 386.9ms (335.3-742.9ms) | Calc Pi: 42ms (40-52ms) | Empty Dispatch: 64.3ms (50.5-758.5ms) | (Chart)
Compare with last deployed Master:
Scroll Canvas: 78ms (56.9-149ms) | Resize: 143.4ms (31.4-875.2ms) | Selection: 382.1ms (335.6-766.8ms) | Calc Pi: 42ms (40-53ms) | Empty Dispatch: 68.7ms (54.4-883.2ms) | (Chart)

@enidemi enidemi merged commit f7b7726 into master Oct 18, 2021
@enidemi enidemi deleted the feature/inspector-components-controlstatus branch October 18, 2021 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants