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

GridMeasurementHelper component to continuously measure grid cells #6517

Merged
merged 26 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d1f7ae8
Show invisible grid controls on all grids during interactions
gbalint Oct 10, 2024
0f92b36
Update snapshot
gbalint Oct 10, 2024
1509747
remove unnecessary nullish coalescing
gbalint Oct 10, 2024
145fe5a
Add missing visible prop
gbalint Oct 10, 2024
ed1a261
Deduplicate grid controls
gbalint Oct 11, 2024
e995db3
Better deduplication
gbalint Oct 11, 2024
46e414a
Remove unnecessary change
gbalint Oct 11, 2024
a81df07
Use GridControl directly in canvas controls
gbalint Oct 11, 2024
30d0bdf
Even better
gbalint Oct 11, 2024
d4814cf
Separate measurement grid helper
gbalint Oct 14, 2024
a92c086
Remove latestMetadata hack from interactions
gbalint Oct 14, 2024
bf86fa4
Remove unused import
gbalint Oct 14, 2024
2d42dc0
Merge branch 'master' into fix/reparent-blinking
gbalint Oct 14, 2024
4310311
Fix build and refactor
gbalint Oct 14, 2024
0df1258
fix
gbalint Oct 14, 2024
b4e204e
Merge branch 'master' into fix/reparent-blinking
gbalint Oct 14, 2024
1696fd1
Update keys and types
gbalint Oct 14, 2024
d167a0a
Flatten props
gbalint Oct 14, 2024
3d8be9f
Move grid measurement helpers together into component
gbalint Oct 15, 2024
5866765
Added missing displayName
gbalint Oct 15, 2024
d14e7df
Restrict GridMeasurmentHelper prop type
gbalint Oct 15, 2024
06aff88
fastDeepEqual hack
gbalint Oct 15, 2024
dfc4349
Added comment
gbalint Oct 15, 2024
d6530e5
Remove magic constant
gbalint Oct 15, 2024
5e69431
Small refactor to remove duplicated code
gbalint Oct 15, 2024
360a854
Fix compile error
gbalint Oct 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
import { mapDropNulls } from '../../../../core/shared/array-utils'
import { assertNever } from '../../../../core/shared/utils'
import { showGridControls } from '../../commands/show-grid-controls-command'
import { memoize } from '../../../../core/shared/memoize'

export function runGridRearrangeMove(
targetElement: ElementPath,
Expand Down Expand Up @@ -813,3 +814,11 @@ function getOriginalElementGridConfiguration(
mouseCellPosInOriginalElement,
}
}

export const getAllGrids = memoize(getAllGridsInner, { maxSize: 1 })

function getAllGridsInner(jsxMetadata: ElementInstanceMetadataMap): Array<ElementPath> {
return Object.keys(jsxMetadata)
.filter((key) => MetadataUtils.isGridLayoutedContainer(jsxMetadata[key]))
.map(EP.fromString)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import type { InsertionPath } from '../../../editor/store/insertion-path'
import { CSSCursor } from '../../canvas-types'
import { setCursorCommand } from '../../commands/set-cursor-command'
import { propertyToSet, updateBulkProperties } from '../../commands/set-property-command'
import { showGridControls } from '../../commands/show-grid-controls-command'
import { updateSelectedViews } from '../../commands/update-selected-views-command'
import { controlsForGridPlaceholders } from '../../controls/grid-controls'
import { ParentBounds } from '../../controls/parent-bounds'
Expand Down
68 changes: 37 additions & 31 deletions editor/src/components/canvas/controls/grid-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
pointsEqual,
scaleRect,
windowPoint,
zeroRectangle,
zeroRectIfNullOrInfinity,
} from '../../../core/shared/math-utils'
import {
Expand Down Expand Up @@ -89,7 +88,6 @@ import { windowToCanvasCoordinates } from '../dom-lookup'
import type { Axis } from '../gap-utils'
import { useCanvasAnimation } from '../ui-jsx-canvas-renderer/animation-context'
import { CanvasOffsetWrapper } from './canvas-offset-wrapper'
import { CanvasLabel } from './select-mode/controls-common'
import { useMaybeHighlightElement } from './select-mode/select-mode-hooks'
import type { GridCellCoordinates } from '../canvas-strategies/strategies/grid-cell-bounds'
import { gridCellTargetId } from '../canvas-strategies/strategies/grid-cell-bounds'
Expand Down Expand Up @@ -659,12 +657,14 @@ export const GridRowColumnResizingControls =
})

export const GridControlsKey = (gridPath: ElementPath) => `grid-controls-${EP.toString(gridPath)}`
export const GridControlKey = (gridPath: ElementPath) => `grid-control-${EP.toString(gridPath)}`

export interface GridControlProps {
grid: GridData
visible: 'visible' | 'hidden'
}

export const GridControl = React.memo<GridControlProps>(({ grid }) => {
export const GridControl = React.memo<GridControlProps>(({ grid, visible }) => {
const dispatch = useDispatch()
const controls = useAnimationControls()
const colorTheme = useColorTheme()
Expand Down Expand Up @@ -916,6 +916,7 @@ export const GridControl = React.memo<GridControlProps>(({ grid }) => {
grid.padding == null
? 0
: `${grid.padding.top}px ${grid.padding.right}px ${grid.padding.bottom}px ${grid.padding.left}px`,
opacity: visible === 'visible' ? 1 : 0,
}

// Gap needs to be set only if the other two are not present or we'll have rendering issues
Expand Down Expand Up @@ -1126,38 +1127,43 @@ GridControl.displayName = 'GridControl'

export interface GridControlsProps {
targets: ElementPath[]
visible: 'visible' | 'hidden'
}

export const GridControls = controlForStrategyMemoized<GridControlsProps>(({ targets }) => {
const targetRootCell = useEditorState(
Substores.canvas,
(store) => store.editor.canvas.controls.gridControlData?.rootCell ?? null,
'GridControls targetRootCell',
)
export const GridControls = controlForStrategyMemoized<GridControlsProps>(
({ targets, visible }) => {
const targetRootCell = useEditorState(
Substores.canvas,
(store) => store.editor.canvas.controls.gridControlData?.rootCell ?? null,
'GridControls targetRootCell',
)

const hoveredGrids = useEditorState(
Substores.canvas,
(store) => stripNulls([store.editor.canvas.controls.gridControlData?.grid]),
'GridControls hoveredGrids',
)
const hoveredGrids = useEditorState(
Substores.canvas,
(store) => stripNulls([store.editor.canvas.controls.gridControlData?.grid]),
'GridControls hoveredGrids',
)

const grids = useGridData(uniqBy([...targets, ...hoveredGrids], (a, b) => EP.pathsEqual(a, b)))
const grids = useGridData(uniqBy([...targets, ...hoveredGrids], (a, b) => EP.pathsEqual(a, b)))

if (grids.length === 0) {
return null
}
if (grids.length === 0) {
return null
}

return (
<div id={'grid-controls'}>
<CanvasOffsetWrapper>
{grids.map((grid) => {
return <GridControl key={`grid-control-${EP.toString(grid.elementPath)}`} grid={grid} />
})}
<AbsoluteDistanceIndicators targetRootCell={targetRootCell} />
</CanvasOffsetWrapper>
</div>
)
})
return (
<div id={'grid-controls'}>
<CanvasOffsetWrapper>
{grids.map((grid) => {
return (
<GridControl key={GridControlKey(grid.elementPath)} grid={grid} visible={visible} />
)
})}
<AbsoluteDistanceIndicators targetRootCell={targetRootCell} />
</CanvasOffsetWrapper>
</div>
)
},
)

const MIN_INDICATORS_DISTANCE = 32 // px

Expand Down Expand Up @@ -1845,10 +1851,10 @@ function gridPlaceholderWidthOrHeight(scale: number): string {
export function controlsForGridPlaceholders(
gridPath: ElementPath,
whenToShow: WhenToShowControl = 'always-visible',
): ControlWithProps<any> {
): ControlWithProps<GridControlsProps> {
return {
control: GridControls,
props: { targets: [gridPath] },
props: { targets: [gridPath], visible: 'visible' },
key: GridControlsKey(gridPath),
show: whenToShow,
priority: 'bottom',
Expand Down
41 changes: 41 additions & 0 deletions editor/src/components/canvas/controls/new-canvas-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ import { NO_OP } from '../../../core/shared/utils'
import { useIsMyProject } from '../../editor/store/collaborative-editing'
import { MultiplayerWrapper } from '../../../utils/multiplayer-wrapper'
import { MultiplayerPresence } from '../multiplayer-presence'
import { GridControl, GridControlKey, GridControlsKey, useGridData } from './grid-controls'
import { getAllGrids } from '../canvas-strategies/strategies/grid-helpers'
import type { ControlWithProps } from '../canvas-strategies/canvas-strategy-types'
import { CanvasOffsetWrapper } from './canvas-offset-wrapper'

export const CanvasControlsContainerID = 'new-canvas-controls-container'

Expand Down Expand Up @@ -338,6 +342,12 @@ const NewCanvasControlsInner = (props: NewCanvasControlsInnerProps) => {
'NewCanvasControlsInner',
)

const gridsWithoutControl = useGridsWithoutControl(
strategyControls,
dragInteractionActive,
componentMetadata,
)

const cmdKeyPressed = keysPressed['cmd'] ?? false

const contextMenuEnabled = !isLiveMode(editorMode)
Expand Down Expand Up @@ -596,6 +606,20 @@ const NewCanvasControlsInner = (props: NewCanvasControlsInnerProps) => {
isSelectOrInsertMode(editorMode) &&
!EP.multiplePathsAllWithTheSameUID(localSelectedViews),
<>
{when(
dragInteractionActive,
<CanvasOffsetWrapper>
{gridsWithoutControl.map((grid) => {
gbalint marked this conversation as resolved.
Show resolved Hide resolved
return (
<GridControl
key={GridControlKey(grid.elementPath)}
grid={grid}
visible={'hidden'}
/>
)
})}
</CanvasOffsetWrapper>,
)}
{strategyControls.map((c) => (
<RenderControlMemoized
key={c.key}
Expand Down Expand Up @@ -673,4 +697,21 @@ const SelectionAreaRectangle = React.memo(
},
)

function useGridsWithoutControl(
strategyControls: Array<ControlWithProps<unknown>>,
dragInteractionActive: boolean,
metadata: ElementInstanceMetadataMap,
) {
const grids = React.useMemo(() => {
if (!dragInteractionActive) {
return []
}
return getAllGrids(metadata).filter((grid) => {
return strategyControls.every((control) => control.key !== GridControlsKey(grid))
})
}, [metadata, strategyControls, dragInteractionActive])

return useGridData(grids)
}

SelectionAreaRectangle.displayName = 'SelectionAreaRectangle'
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand All @@ -53,7 +54,7 @@ Array [
"/div/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))//Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/Symbol(react.memo)()//Symbol(react.memo)()",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)())",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)())",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)())",
Expand Down Expand Up @@ -84,7 +85,7 @@ Array [
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(ResizePoint))/Symbol(react.forward_ref)(ResizePoint)/div",
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(SizeLabel))/Symbol(react.forward_ref)(SizeLabel)/div:data-testid='SizeLabelTestId'",
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(SizeLabel))/Symbol(react.forward_ref)(SizeLabel)/div:data-testid='parent-resize-label'",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/Symbol(react.memo)()//Symbol(react.memo)()",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///UtopiaSpiedExoticType(Symbol(react.fragment))",
"/Symbol(react.forward_ref)(Styled(div))/div/Symbol(react.forward_ref)(Styled(div))/div",
"/UtopiaSpiedFunctionComponent(SimpleFlexColumn)/div/ElementsOutsideVisibleAreaIndicator/Symbol(react.memo)(IndicatorArrow)",
Expand Down Expand Up @@ -814,6 +815,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand All @@ -833,7 +835,7 @@ Array [
"/div/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))//Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/Symbol(react.memo)()//Symbol(react.memo)()",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)())",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)())",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)())",
Expand Down Expand Up @@ -864,7 +866,7 @@ Array [
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(ResizePoint))/Symbol(react.forward_ref)(ResizePoint)/div",
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(SizeLabel))/Symbol(react.forward_ref)(SizeLabel)/div:data-testid='SizeLabelTestId'",
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(SizeLabel))/Symbol(react.forward_ref)(SizeLabel)/div:data-testid='parent-resize-label'",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/Symbol(react.memo)()//Symbol(react.memo)()",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///UtopiaSpiedExoticType(Symbol(react.fragment))",
"/Symbol(react.forward_ref)(Styled(div))/div/Symbol(react.forward_ref)(Styled(div))/div",
"/UtopiaSpiedFunctionComponent(SimpleFlexColumn)/div/ElementsOutsideVisibleAreaIndicator/Symbol(react.memo)(IndicatorArrow)",
Expand Down Expand Up @@ -1483,6 +1485,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand Down Expand Up @@ -1772,6 +1775,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand Down Expand Up @@ -2373,6 +2377,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand Down Expand Up @@ -2480,6 +2485,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand Down Expand Up @@ -2598,6 +2604,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand Down Expand Up @@ -2875,6 +2882,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand Down Expand Up @@ -3352,6 +3360,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand Down Expand Up @@ -3401,6 +3410,7 @@ Array [
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
"/div/div/UtopiaSpiedFunctionComponent(NewCanvasControlsInner)/Symbol(react.memo)()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('React Render Count Tests -', () => {

const renderCountAfter = renderResult.getNumberOfRenders()
// if this breaks, GREAT NEWS but update the test please :)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`858`)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`862`)
expect(renderResult.getRenderInfo()).toMatchSnapshot()
})

Expand Down Expand Up @@ -127,7 +127,7 @@ describe('React Render Count Tests -', () => {

const renderCountAfter = renderResult.getNumberOfRenders()
// if this breaks, GREAT NEWS but update the test please :)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`1110`)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`1114`)
expect(renderResult.getRenderInfo()).toMatchSnapshot()
})

Expand Down Expand Up @@ -183,7 +183,7 @@ describe('React Render Count Tests -', () => {

const renderCountAfter = renderResult.getNumberOfRenders()
// if this breaks, GREAT NEWS but update the test please :)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`650`)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`651`)
expect(renderResult.getRenderInfo()).toMatchSnapshot()
})

Expand Down Expand Up @@ -249,7 +249,7 @@ describe('React Render Count Tests -', () => {

const renderCountAfter = renderResult.getNumberOfRenders()
// if this breaks, GREAT NEWS but update the test please :)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`775`)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`776`)
expect(renderResult.getRenderInfo()).toMatchSnapshot()
})
})
Loading