Commit 93ff544
committed
[DevTools] Use Popover API for TraceUpdates highlighting (#32614)
## Summary
When using React DevTools to highlight component updates, the highlights
would sometimes appear behind elements that use the browser's
[top-layer](https://developer.mozilla.org/en-US/docs/Glossary/Top_layer)
(such as `<dialog>` elements or components using the Popover API). This
made it difficult to see which components were updating when they were
inside or behind top-layer elements.
This PR fixes the issue by using the Popover API to ensure that
highlighting appears on top of all content, including elements in the
top-layer. The implementation maintains backward compatibility with
browsers that don't support the Popover API.
## How did you test this change?
I tested this change in the following ways:
1. Manually tested in Chrome (which supports the Popover API) with:
- Created a test application with React components inside `<dialog>`
elements and custom elements using the Popover API
- Verified that component highlighting appears above these elements when
they update
- Confirmed that highlighting displays correctly for nested components
within top-layer elements
2. Verified backward compatibility:
- Tested in browsers without Popover API support to ensure fallback
behavior works correctly
- Confirmed that no errors occur and highlighting still functions as
before
3. Ran the React DevTools test suite:
- All tests pass successfully
- No regressions were introduced
[demo-page](https://devtools-toplayer-demo.vercel.app/)
[demo-repo](https://github.com/yongsk0066/devtools-toplayer-demo)
### AS-IS
https://github.com/user-attachments/assets/dc2e1281-969f-4f61-82c3-480153916969
### TO-BE
https://github.com/user-attachments/assets/dd52ce35-816c-42f0-819b-0d5d0a8a21e5
DiffTrain build for [53c9f81](53c9f81)1 parent 8b54080 commit 93ff544
File tree
24 files changed
+87
-87
lines changed- compiled-rn
- facebook-fbsource/xplat/js
- RKJSModules/vendor/react
- react-dom/cjs
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
- tools/eslint-plugin-react-hooks
24 files changed
+87
-87
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
26951 | 26951 | | |
26952 | 26952 | | |
26953 | 26953 | | |
26954 | | - | |
| 26954 | + | |
26955 | 26955 | | |
26956 | 26956 | | |
26957 | 26957 | | |
26958 | | - | |
| 26958 | + | |
26959 | 26959 | | |
26960 | 26960 | | |
26961 | 26961 | | |
| |||
26992 | 26992 | | |
26993 | 26993 | | |
26994 | 26994 | | |
26995 | | - | |
| 26995 | + | |
26996 | 26996 | | |
26997 | 26997 | | |
26998 | | - | |
| 26998 | + | |
26999 | 26999 | | |
27000 | 27000 | | |
27001 | 27001 | | |
| |||
27139 | 27139 | | |
27140 | 27140 | | |
27141 | 27141 | | |
27142 | | - | |
| 27142 | + | |
27143 | 27143 | | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17040 | 17040 | | |
17041 | 17041 | | |
17042 | 17042 | | |
17043 | | - | |
| 17043 | + | |
17044 | 17044 | | |
17045 | 17045 | | |
17046 | 17046 | | |
17047 | 17047 | | |
17048 | 17048 | | |
17049 | 17049 | | |
17050 | | - | |
| 17050 | + | |
17051 | 17051 | | |
17052 | 17052 | | |
17053 | 17053 | | |
| |||
17069 | 17069 | | |
17070 | 17070 | | |
17071 | 17071 | | |
17072 | | - | |
| 17072 | + | |
17073 | 17073 | | |
17074 | 17074 | | |
17075 | | - | |
| 17075 | + | |
17076 | 17076 | | |
17077 | 17077 | | |
17078 | 17078 | | |
| |||
17176 | 17176 | | |
17177 | 17177 | | |
17178 | 17178 | | |
17179 | | - | |
| 17179 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17750 | 17750 | | |
17751 | 17751 | | |
17752 | 17752 | | |
17753 | | - | |
| 17753 | + | |
17754 | 17754 | | |
17755 | 17755 | | |
17756 | 17756 | | |
17757 | 17757 | | |
17758 | 17758 | | |
17759 | 17759 | | |
17760 | | - | |
| 17760 | + | |
17761 | 17761 | | |
17762 | 17762 | | |
17763 | 17763 | | |
| |||
17779 | 17779 | | |
17780 | 17780 | | |
17781 | 17781 | | |
17782 | | - | |
| 17782 | + | |
17783 | 17783 | | |
17784 | 17784 | | |
17785 | | - | |
| 17785 | + | |
17786 | 17786 | | |
17787 | 17787 | | |
17788 | 17788 | | |
| |||
17901 | 17901 | | |
17902 | 17902 | | |
17903 | 17903 | | |
17904 | | - | |
| 17904 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
27012 | 27012 | | |
27013 | 27013 | | |
27014 | 27014 | | |
27015 | | - | |
| 27015 | + | |
27016 | 27016 | | |
27017 | 27017 | | |
27018 | 27018 | | |
27019 | | - | |
| 27019 | + | |
27020 | 27020 | | |
27021 | 27021 | | |
27022 | 27022 | | |
| |||
27053 | 27053 | | |
27054 | 27054 | | |
27055 | 27055 | | |
27056 | | - | |
| 27056 | + | |
27057 | 27057 | | |
27058 | 27058 | | |
27059 | | - | |
| 27059 | + | |
27060 | 27060 | | |
27061 | 27061 | | |
27062 | 27062 | | |
| |||
27516 | 27516 | | |
27517 | 27517 | | |
27518 | 27518 | | |
27519 | | - | |
| 27519 | + | |
27520 | 27520 | | |
27521 | 27521 | | |
27522 | 27522 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17051 | 17051 | | |
17052 | 17052 | | |
17053 | 17053 | | |
17054 | | - | |
| 17054 | + | |
17055 | 17055 | | |
17056 | 17056 | | |
17057 | 17057 | | |
17058 | 17058 | | |
17059 | 17059 | | |
17060 | 17060 | | |
17061 | | - | |
| 17061 | + | |
17062 | 17062 | | |
17063 | 17063 | | |
17064 | 17064 | | |
| |||
17080 | 17080 | | |
17081 | 17081 | | |
17082 | 17082 | | |
17083 | | - | |
| 17083 | + | |
17084 | 17084 | | |
17085 | 17085 | | |
17086 | | - | |
| 17086 | + | |
17087 | 17087 | | |
17088 | 17088 | | |
17089 | 17089 | | |
| |||
17341 | 17341 | | |
17342 | 17342 | | |
17343 | 17343 | | |
17344 | | - | |
| 17344 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17765 | 17765 | | |
17766 | 17766 | | |
17767 | 17767 | | |
17768 | | - | |
| 17768 | + | |
17769 | 17769 | | |
17770 | 17770 | | |
17771 | 17771 | | |
17772 | 17772 | | |
17773 | 17773 | | |
17774 | 17774 | | |
17775 | | - | |
| 17775 | + | |
17776 | 17776 | | |
17777 | 17777 | | |
17778 | 17778 | | |
| |||
17794 | 17794 | | |
17795 | 17795 | | |
17796 | 17796 | | |
17797 | | - | |
| 17797 | + | |
17798 | 17798 | | |
17799 | 17799 | | |
17800 | | - | |
| 17800 | + | |
17801 | 17801 | | |
17802 | 17802 | | |
17803 | 17803 | | |
| |||
18070 | 18070 | | |
18071 | 18071 | | |
18072 | 18072 | | |
18073 | | - | |
| 18073 | + | |
18074 | 18074 | | |
18075 | 18075 | | |
18076 | 18076 | | |
| |||
0 commit comments