Skip to content

Commit 08d2ddf

Browse files
authored
feat(FR-2218): integrate react-grab for AI agent element inspection (#5887)
1 parent 0875b96 commit 08d2ddf

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

react/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"lucide-react": "catalog:",
5252
"markdown-to-jsx": "^7.7.17",
5353
"marked": "catalog:",
54-
"nanoid": "^5.1.6",
5554
"markty-toml": "catalog:",
55+
"nanoid": "^5.1.6",
5656
"nuqs": "^2.8.6",
5757
"p-queue": "^8.1.1",
5858
"prettier": "catalog:",
@@ -151,6 +151,7 @@
151151
"nodemon": "^3.1.11",
152152
"prop-types": "^15.8.1",
153153
"react-dev-utils": "^12.0.1",
154+
"react-grab": "^0.1.21",
154155
"react-scripts": "5.0.1",
155156
"react-test-renderer": "^19.2.3",
156157
"relay-compiler": "catalog:",

react/src/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ import ReactDOM from 'react-dom/client';
2323
// This can cause Relay to show "Warning: RelayResponseNormalizer: Payload did not contain a value for field" in the browser console during development.
2424
// It's advisable to ignore these frequent logs in development mode.
2525
if (process.env.NODE_ENV === 'development') {
26+
// Enable react-grab for AI agent element inspection during development
27+
import('react-grab').catch((error) => {
28+
// eslint-disable-next-line no-console
29+
console.warn(
30+
'Failed to load react-grab devtool. AI agent element inspection will be disabled.',
31+
error,
32+
);
33+
});
34+
2635
// eslint-disable-next-line no-console
2736
const originalConsoleError = console.error;
2837
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)