Skip to content

Commit 64f843b

Browse files
committed
fix: use exact match for wait --component
Substring matching could resolve too early (e.g. waiting for App matches AppLoader). Exact match is more appropriate for a gate condition.
1 parent 5c19cdf commit 64f843b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/agent-react-devtools/skills/react-devtools/references/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If profiling is active, shows `Profiling: active`.
2525
Block until at least one React app connects via WebSocket. Resolves immediately if already connected. Default timeout: 30s. Exits non-zero on timeout.
2626

2727
### `agent-react-devtools wait --component <name> [--timeout S]`
28-
Block until a component with the given display name appears in the tree. Uses case-insensitive substring matching (same as `find`). Useful after a reload to wait for a specific part of the UI to render. Default timeout: 30s. Exits non-zero on timeout.
28+
Block until a component with the given display name appears in the tree. Uses exact name matching. Useful after a reload to wait for a specific part of the UI to render. Default timeout: 30s. Exits non-zero on timeout.
2929

3030
## Component Inspection
3131

packages/agent-react-devtools/src/daemon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ class Daemon {
313313
case 'connected':
314314
return this.bridge.getConnectedAppCount() > 0;
315315
case 'component':
316-
return this.tree.findByName(cmd.name, false).length > 0;
316+
return this.tree.findByName(cmd.name, true).length > 0;
317317
default:
318318
return false;
319319
}

0 commit comments

Comments
 (0)