Fix FocusScope StrictMode issues (#3878)
* tentative change to fix FocusScope strict mode
* cleanup
* step back some optimization until we fix all issues
* properly assign new top level scope parent
fix case where deleting a row via actionbar didnt restore focus to the new first row.
* fix table crud case
* add optimizations to fit assumptions
* fix ButtonGroup strictmode test
* fixing focuscope test for strict mode
* making DialogTrigger tests not fail due to strict mode
since strict mode unmounts and rerenders the dialog, we will always run into the "unmounted while open" error in the tests if defaultOpen or isOpen is true. Since I think we cant distingush a true unmount case vs strict modes unmount case, I opted to suppress the warning in the test instead
* ensure activeScope is accurate
in strict mode, the layouteffect cleanup triggers even when the focusscope hasnt unmounted. This makes activeScope inaccurate and breaks the parentScope for future nested focusscopes (e.g. nested dialog trigger case)
* fixing tabs tests
* removing extraneous parentScope calculation
* more cleanup
* updating test for strict mode and non strict mode consistency
the previous expect was relying on the fact that ButtonGroup first measurement happened before we mock the widths and positions of the buttons + buttongroups. That doesnt work well in strict mode and didnt feel reflective of browser behavior so I removed that expect
* Create FocusScope nodes top down and add them bottom up (#3898)
Co-authored-by: Devon Govett <devongovett@gmail.com>