@swmansion/argent 0.34.1-next.96 → 0.34.1-next.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/bin/argent-android-devtools-0.4.0.apk +0 -0
  2. package/bin/darwin/argent-macos-helper +0 -0
  3. package/bin/darwin/ax-service +0 -0
  4. package/bin/darwin/tvos-ax-service +0 -0
  5. package/bin/darwin/tvos-hid-daemon +0 -0
  6. package/bin/network-inspector/network-inspector.jar +0 -0
  7. package/bin/tcp/ax-service +0 -0
  8. package/dist/cli-cmds.mjs +1 -1
  9. package/dist/installer.mjs +1 -1
  10. package/dist/tool-args.generated.d.ts +32 -32
  11. package/dist/tool-server.cjs +250 -190
  12. package/dylibs/libArgentAudio.dylib +0 -0
  13. package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
  14. package/dylibs/libKeyboardPatch.dylib +0 -0
  15. package/dylibs/libNativeDevtoolsIos.dylib +0 -0
  16. package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
  17. package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
  18. package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
  19. package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
  20. package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
  21. package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
  22. package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
  23. package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
  24. package/package.json +2 -2
  25. package/skills/argent-create-e2e/references/live-authoring.md +7 -15
  26. package/skills/argent-device-interact/SKILL.md +25 -23
  27. package/skills/argent-macos-app-interact/SKILL.md +1 -1
  28. package/skills/argent-metro-debugger/SKILL.md +25 -25
  29. package/skills/argent-qa-e2e/SKILL.md +1 -1
  30. package/skills/argent-react-native-optimization/references/fix-reference.md +10 -10
  31. package/skills/argent-test-ui-flow/SKILL.md +1 -1
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.34.1-next.96",
3
+ "version": "0.34.1-next.98",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
6
6
  "license": "Apache-2.0",
@@ -98,5 +98,5 @@
98
98
  "vitest": "^5.0.5",
99
99
  "yaml": "^2.9.1"
100
100
  },
101
- "gitHead": "698324b75329ff5f5a6f0b110dd30fd10cb03446"
101
+ "gitHead": "90309addca9889a45e4d5ec9930e59c2b099395d"
102
102
  }
@@ -16,7 +16,6 @@ Read this file before creating or changing an e2e test. Exercise the saved path
16
16
  - [Scrolling and swiping](#scrolling-and-swiping)
17
17
  - [Live waits and checks](#live-waits-and-checks)
18
18
  - [Network capture](#network-capture)
19
- - [Network checks](#network-checks)
20
19
  - [Wrong turns](#wrong-turns)
21
20
  - [Finish and polish](#finish-and-polish)
22
21
  - [Worked example](#worked-example)
@@ -147,23 +146,16 @@ A warning does not reject the step. If `e2e-finish-recording` reports dropped wa
147
146
 
148
147
  ### Network capture
149
148
 
150
- On iOS, Android, and Mac apps, record a capture start before reproducing the request. On Chromium, record `view-network-logs` before the action if you only need to inspect requests. Use start and stop steps when the test needs a capture window. The Chromium log includes requests outside that window.
149
+ On iOS simulators, Android, Mac apps, and Chromium, use `e2e-add-step` to record `network-capture-start`, the action, `await-network-request`, and `network-capture-stop` in that order. Put capture start after launch and the first-screen wait. A start before `launch:` makes the test a fragment. Use [Inspect network requests](../../argent-metro-debugger/SKILL.md#inspect-network-requests) for platform setup.
151
150
 
152
- 1. Add `network-capture-start` through `e2e-add-step` after the launch and first-screen wait, if present, and before the action. A relaunch ends JS capture. A start before `launch:` makes the test a fragment.
153
- 2. After the action, record a network check if the test must verify the request. Record `network-capture-stop` as soon as you have the requests you need.
154
- 3. If a read reports that capture never started, record the start through `e2e-add-step`, then re-record the action and the read. Replay only runs the steps you recorded.
155
- 4. A `tool:` step keeps its recorded `bundleId` on every platform. Only `launch:` takes an id per platform. If the app id differs by platform, add a top-level `requires:` block with the recording platform (see [File shape and test type](e2e-yaml.md#file-shape-and-test-type)). Record a separate test for each other platform.
156
- 5. After replay, check `armed` and `reason` for the layer the test uses in each step's `result`. A passed step can report an unarmed start or an unconfirmed stop. A Chromium stop reports `armed: false` even when `reason` says no capture window was started. Fix the reported problem and replay before relying on the capture.
151
+ - Keep the wait as a raw `tool:` step. A log listing can pass with an empty log. Match a part of the URL that contains no secret. On Android, capture can slow the app: start just before the action and stop right after the wait. When collecting several related requests, stop after the last check.
152
+ - If the recorder reports `NETWORK_CAPTURE_NOT_STARTED`, record the missing start, then repeat and record the action and the wait. Replay only uses recorded steps.
153
+ - If the recorder saves a failed wait, inspect `toolResult.nearMisses` for an `unmet` wait. Restore capture and repeat the action for `unreadable`. Record a new wait if cancelled. Remove superseded steps after `e2e-finish-recording`.
154
+ - On replay, verify the relevant layer's `armed` and `reason` in the start and stop results. On Chromium, stop can report `armed: false` even when there was no window. If a failed step skips the stop, stop capture before replaying.
157
155
 
158
- ### Network checks
156
+ On Vega, call `view-network-logs` before the action to start JavaScript capture. Read the log again after the action to inspect the requests. `await-network-request` is unavailable on Vega.
159
157
 
160
- Use `await-network-request` when the replay must verify that the action sent a request. A log listing passes even when the request is missing. Record start → action → wait → stop through `e2e-add-step`. This works on iOS simulators, Android, Mac apps, and Chromium. On Chromium use the same valid `bundleId` placeholder, such as `argent.capture`, for the capture calls and the wait.
161
-
162
- Keep the wait as a `tool:` step in YAML. Match on a part of the URL that contains no secret.
163
-
164
- On Android, capture can slow the app. Start just before the triggering action and stop immediately after the wait, before checking the UI. For many related requests, keep capture running through the group and stop after the last wait. If a replay fails before the stop, stop capture before retrying.
165
-
166
- If the recorder reports `NETWORK_CAPTURE_NOT_STARTED`, record the start and repeat the action. If it records a wait with `success: false`, read the warning. For `unmet`, use `toolResult.nearMisses` and the request counts in `toolResult.note` to check the matcher and the recorded action. For `unreadable`, fix the layer named in the result before repeating the action. For `cancelled`, record the wait again. Remove superseded steps after `e2e-finish-recording`.
158
+ A recorded `tool:` step keeps its `bundleId` on every platform. If app IDs differ, restrict the test with [`requires:`](e2e-yaml.md#file-shape-and-test-type) and record a test for each platform.
167
159
 
168
160
  ### Wrong turns
169
161
 
@@ -16,28 +16,30 @@ Each tool's own description carries its parameters, defaults, return shape and e
16
16
 
17
17
  ## 2. Choosing the Right Tool
18
18
 
19
- | Action | Tool | Notes |
20
- | ------------------------------ | -------------------- | ------------------------------------------------------------------------ |
21
- | Several known steps | `run-sequence` | One call, one screenshot at the end (§5) |
22
- | Open an app | `launch-app` | **Never tap home-screen icons** |
23
- | Restart an app | `restart-app` | Clean in-memory state |
24
- | Open URL / deep link | `open-url` | Web pages, deep links, URL schemes |
25
- | Tap | `gesture-tap` | Buttons, links, checkboxes |
26
- | Scroll / swipe | `gesture-swipe` | Touch targets; not Chromium |
27
- | Scroll (Chromium) | `gesture-scroll` | Mouse wheel |
28
- | Drag (Chromium) | `gesture-drag` | Sliders, drag-and-drop, text selection |
29
- | Long press, drag & drop | `gesture-custom` | Also any other non-linear touch sequence |
30
- | Pinch / zoom | `gesture-pinch` | |
31
- | Two-finger rotation | `gesture-rotate` | |
32
- | Hardware key | `button` | Home, back, power, volume, appSwitch, actionButton |
33
- | Type text or press a named key | `keyboard` | Every platform; text or one key per call (§6) |
34
- | Paste text | `paste` | Only where a user would paste (§6). Sim/emu, Mac app |
35
- | Rotate device | `rotate` | Orientation changes |
36
- | Fold device | `fold` | Foldables only: `references/foldables.md` |
37
- | Shake device | `shake` | Shake handlers (sim/emu only), Undo-typing prompt, RN dev menu |
38
- | Slow or offline network | `network-conditions` | Latency, bandwidth, offline. iOS sim app, Chromium tab, Android emulator |
39
- | Wait for UI | `await-ui-element` | Block until an element is visible/hidden/exists/contains text |
40
- | Wait for idle | `await-screen-idle` | Block until a non-empty tree holds for `minStableMs` (§4) |
19
+ | Action | Tool | Notes |
20
+ | ------------------------------ | -------------------- | -------------------------------------------------------------- |
21
+ | Several known steps | `run-sequence` | One call, one screenshot at the end (§5) |
22
+ | Open an app | `launch-app` | **Never tap home-screen icons** |
23
+ | Restart an app | `restart-app` | Clean in-memory state |
24
+ | Open URL / deep link | `open-url` | Web pages, deep links, URL schemes |
25
+ | Tap | `gesture-tap` | Buttons, links, checkboxes |
26
+ | Scroll / swipe | `gesture-swipe` | Touch targets; not Chromium |
27
+ | Scroll (Chromium) | `gesture-scroll` | Mouse wheel |
28
+ | Drag (Chromium) | `gesture-drag` | Sliders, drag-and-drop, text selection |
29
+ | Long press, drag & drop | `gesture-custom` | Also any other non-linear touch sequence |
30
+ | Pinch / zoom | `gesture-pinch` | |
31
+ | Two-finger rotation | `gesture-rotate` | |
32
+ | Hardware key | `button` | Home, back, power, volume, appSwitch, actionButton |
33
+ | Type text or press a named key | `keyboard` | Every platform; text or one key per call (§6) |
34
+ | Paste text | `paste` | Only where a user would paste (§6). Sim/emu, Mac app |
35
+ | Rotate device | `rotate` | Orientation changes |
36
+ | Fold device | `fold` | Foldables only: `references/foldables.md` |
37
+ | Shake device | `shake` | Shake handlers (sim/emu only), Undo-typing prompt, RN dev menu |
38
+ | Slow or offline network | `network-conditions` | iOS simulator app, Android emulator, or Chromium tab |
39
+ | Wait for UI | `await-ui-element` | Block until an element is visible/hidden/exists/contains text |
40
+ | Wait for idle | `await-screen-idle` | Block until a non-empty tree holds for `minStableMs` (§4) |
41
+
42
+ After a network test, call `network-conditions` with the same target and omit the conditions to reset. On Android, this brings an offline emulator back online. If an Argent crash leaves an emulator's proxy active, reset before retrying.
41
43
 
42
44
  ## 3. Finding Tap Targets
43
45
 
@@ -80,7 +82,7 @@ Use `run-sequence` when every step is known in advance; if a step depends on wha
80
82
  - "submit form": fill every field, then tap submit
81
83
  - "go back to X": a known tap path
82
84
 
83
- Use `await-ui-element` to gate a step on a screen transition. To gate on a network request, start capture before the sequence, then put `await-network-request` after the triggering action. A failed step, including a wait with `success: false`, stops the sequence and returns partial results.
85
+ Use `await-ui-element` to gate a step on a screen transition. To gate on a request, start capture before the sequence and put `await-network-request` after the triggering action. A failed step, including a wait with `success: false`, stops the sequence and returns partial results.
84
86
 
85
87
  ## 6. Text Entry and Secrets
86
88
 
@@ -55,4 +55,4 @@ Read `references/e2e.md` before recording or writing a test for a Mac app.
55
55
 
56
56
  ## React Native
57
57
 
58
- For React Native Debug builds on macOS, including Mac Catalyst, start Metro before `boot-device` (see `argent-react-native-app-workflow`). Use `describe` for UI targets. For JavaScript debugging and network capture, follow the Mac app workflow in `argent-metro-debugger`.
58
+ For React Native Debug builds on macOS, including Mac Catalyst, start Metro before `boot-device` (see `argent-react-native-app-workflow`). Use `describe` for UI targets. For JavaScript debugging and network capture, load `argent-metro-debugger` and follow [React Native Mac apps](../argent-metro-debugger/SKILL.md#react-native-mac-apps) and [Inspect network requests](../argent-metro-debugger/SKILL.md#inspect-network-requests).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-metro-debugger
3
- description: Debug JavaScript with Argent in React Native apps on iOS, Android, Vega, and macOS, or in Chromium and Electron over CDP. Use when connecting to a runtime, inspecting React components, reading console logs, or evaluating JavaScript.
3
+ description: Debug JavaScript with Argent in React Native apps on iOS, Android, Vega, and macOS, or in Chromium and Electron over CDP. Use when connecting to a runtime, inspecting React components, reading console logs, evaluating JavaScript, or inspecting and checking an app's HTTP requests.
4
4
  ---
5
5
 
6
6
  ## 1. Prerequisites
@@ -16,42 +16,42 @@ Physical iPhone: not supported; every `debugger-*` tool rejects `kind: "device"`
16
16
 
17
17
  Use the `device_id` from `list-devices` and keep the same ID and Metro port across calls. On shared Metro, if `debugger-connect` cannot match an iOS simulator UDID or Android serial, it lists logical IDs. Choose the requested device's `logicalDeviceId` for subsequent debugger calls. If you later tear down this session, include that ID in `stop-all-simulator-servers`'s `devices`.
18
18
 
19
- | Tool | Use for |
20
- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
21
- | `debugger-status` | Diagnosing the connection. Call it first when anything fails |
22
- | `debugger-connect` | Opening the session and starting console capture |
23
- | `debugger-reload-metro` | Reloading the JS bundle of an attached app |
24
- | `restart-app` | Relaunching the app when it lost its Metro connection |
25
- | `debugger-component-tree` | Component names and testIDs on screen. Find tap targets with `describe` |
26
- | `debugger-inspect-element` | Which component is at a point and where it is defined (source file:line). Takes **logical pixels**, not normalized 0–1 |
27
- | `debugger-log-registry` | Console log summary, the newest entries inline, and the log file path (§4) |
28
- | `debugger-evaluate` | Running a JS expression in the app runtime |
29
- | `view-network-logs` → `view-network-request-details` | Find a request and inspect its headers, timing, or body |
19
+ | Tool | Use for |
20
+ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
21
+ | `debugger-status` | Diagnosing the connection. Call it first when anything fails |
22
+ | `debugger-connect` | Opening the session and starting console capture |
23
+ | `debugger-reload-metro` | Reloading the JS bundle of an attached app |
24
+ | `restart-app` | Relaunching the app when it lost its Metro connection |
25
+ | `debugger-component-tree` | Component names and testIDs on screen. Find tap targets with `describe` |
26
+ | `debugger-inspect-element` | Which component is at a point and where it is defined (source file:line). Takes **logical pixels**, not normalized 0–1 |
27
+ | `debugger-log-registry` | Console log summary, the newest entries inline, and the log file path (§4) |
28
+ | `debugger-evaluate` | Running a JS expression in the app runtime |
30
29
 
31
30
  A component missing from `debugger-component-tree`? `includeSkipped` only adds counts of what was pruned. Use `onScreenOnly: false` for one off screen, or `debugger-inspect-element` at its point for one on screen.
32
31
 
33
- ### Inspect HTTP requests
34
-
35
- On iOS simulators, Android, and Mac apps, call `network-capture-start` before reproducing the request and check that `js` reports `armed: true`. Start again once JavaScript is ready after a reload or relaunch.
36
-
37
- After the action, use `await-network-request` if you know which request to check. Use `view-network-logs` to explore the traffic. Open the details with `view-network-request-details` when needed. Stop capture when you have what you need. If the stop still reports `armed: true`, follow its `reason`.
38
-
39
- Use the device ID as `udid` for start, stop, and the wait. On shared Metro, pass the logical ID as `logicalDeviceId` for start and stop, or `device_id` for the log tools. The wait reuses the Metro target from the start. Keep the Metro port consistent across the other calls.
40
-
41
- On Vega, call `view-network-logs` before reproducing the request and again after a reload.
42
-
43
- On Chromium and Electron, call `view-network-logs` before reproducing the request so Argent connects to the page. Use `network-capture-start` and `network-capture-stop` to mark a capture window when needed. The log includes requests outside that window.
44
-
45
32
  ### React Native Mac apps
46
33
 
47
34
  1. Start Metro before launching a Debug Hermes build of react-native-macos 0.76+ or React Native for Mac Catalyst. Launch Mac Catalyst through Argent so it can identify its runtime. If `boot-device` refuses a hardened react-native-macos build, have the user start it from Xcode. JavaScript tools still work. UI inspection and gestures require a build Argent can control.
48
35
  2. Keep `macos-app-<bundle id>` as `device_id`, even on shared Metro. If a call returns `device_mismatch`, check that the Debug bundle loaded from the requested Metro port. The IDs in the error identify other targets.
49
- 3. For a build started from Xcode, use `macos-app-<bundle id>` as `udid` and set `layer: "js"` for start and stop. `list-devices` only lists Mac apps launched through Argent. To inspect native `URLSession` requests, launch a supported build through Argent and read with `native-network-logs`.
50
36
 
51
37
  Use `describe` for tap targets. The React tools use the root with the most components, which can be in a different window. Before using a point, verify that both tools are looking at the same window. To inspect a tap point from the React tree, multiply its fractions by the width and height in `Screen: WxH`. The resulting points include the title bar. On the old architecture (Paper), native views around the React root can shift those points. Check the returned component against the intended control.
52
38
 
39
+ For JavaScript capture in an app started from Xcode, use `macos-app-<bundle id>` as `udid` and select `layer: "js"` on start and stop. `list-devices` only lists Mac apps launched through Argent. Native capture needs a supported build launched through Argent.
40
+
53
41
  If `debugger-reload-metro` fails to reload the Mac app, use `restart-app` for an Argent-controlled build. For a build started from Xcode, restart it there.
54
42
 
43
+ ### Inspect network requests
44
+
45
+ 1. Choose the log. Use `view-network-logs` for JavaScript or the active Chromium tab and `native-network-logs` for OkHttp or URLSession. The two logs can show the same request.
46
+ 2. Start before triggering the request. On iOS simulators, Android, and Mac apps, call `network-capture-start`. Select `layer: "js"` or `layer: "native"` when you only need one. Check that the layer you need is armed. On Vega, read the JS log to start. On Chromium, read the log to attach or call start if you need a window for a request check.
47
+ 3. After the action, use `await-network-request` to check for a specific request or read the logs to explore traffic. On Vega, use the log. On Chromium, use a valid placeholder bundle ID such as `argent.capture` for start, stop, and wait. The log includes traffic outside the window. For redirects, Chromium waits match the final URL and method. Other layers match the URL the app requested.
48
+ 4. For an `unmet` wait, check the action and matcher against the near misses. For `unreadable`, follow the layer notes before repeating the action. A wait can restore recording while a JS window is active, but may miss requests sent before it reconnects.
49
+ 5. Pass an ID from the log or wait to `view-network-request-details`. Read Android native bodies you need before stopping. Stop the capture you started with `network-capture-stop`. Check `armed` and `reason` to confirm what stopped. On Chromium, a stop closes the window and leaves tab logging active.
50
+
51
+ Keep the original `udid` for start, wait, stop, and native reads. On iOS simulators and Android, if shared Metro requires a logical ID, use it as `logicalDeviceId` on start and stop and as `device_id` on JS reads. For Mac apps, keep `macos-app-<bundle id>` for capture and JS reads, even on shared Metro. Check the project's Metro start script if the port is unclear. Pass the same port throughout when it differs from the device default. The wait reuses the target from start.
52
+
53
+ After a JavaScript reload or relaunch, start JS capture again before repeating the action. On Vega, read the log again instead. If the Android app restarted outside Argent, start native capture again. If an iOS provider owns native capture, relaunch clears its history. Once the app reconnects, start capture again and confirm the native layer is armed.
54
+
55
55
  ## 3. Rules and recovery
56
56
 
57
57
  1. **`debugger-status` first when something fails.** Only `debugger-status` and `debugger-log-registry` return `status: "not_connected"` with a `guidance`; the other tools throw. Follow the `guidance` once; do not retry in a loop.
@@ -83,7 +83,7 @@ A snapshot has no recorder form. Inspect its stable state during the walkthrough
83
83
  - **Repeated controls:** prefer an id. Otherwise use YAML-only `within` with a stable container. Use `text.in` to prove rendered membership inside that container.
84
84
  - **Dynamic content:** assert controlled state or stable app chrome. Use anchored structure for unavoidable dynamic values and disclose the dependency.
85
85
  - **Visual state:** snapshot only a correct, settled, deterministic screen. Use full screen for global changes and `cropOn` for one component.
86
- - **Network requests:** record capture inside the test, after `launch:`, so both replays establish their own capture window. On Android, start just before the triggering action and stop after the wait. For many related requests, stop after the last wait. A wait requires a match, so use it only for requests the app must send. See [Network checks](../argent-create-e2e/references/live-authoring.md#network-checks).
86
+ - **Network requests:** record capture inside the test, after `launch:`, so both replays establish their own capture window. On Android, start just before the triggering action and stop after the wait. For many related requests, stop after the last wait. A wait requires a match, so use it only for requests the app must send. See [Network capture](../argent-create-e2e/references/live-authoring.md#network-capture).
87
87
 
88
88
  Never put acceptance evidence inside `when:`. Use `when:` only for optional setup that reconverges to the required path.
89
89
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  Match profiler findings and semantic sweep results to concrete fixes. With React Compiler active, skip the first three rows for the components it compiles; keep them for components it skips (`compilationMode: "annotation"`, `"use no memo"`, a `sources` filter).
4
4
 
5
- | Finding | Fix | Detail |
6
- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
7
- | Re-renders with same props | `React.memo(Comp)` | Only where the props really are equal between renders |
8
- | Expensive recomputation / unstable callbacks | `useMemo(fn, [deps])` / `useCallback(fn, [deps])` | `useCallback` must pair with `React.memo` on child; alone it has no effect |
9
- | Inline objects/arrays in JSX | `StyleSheet.create()` / module-level const | New reference every render breaks shallow equality |
10
- | List jank | `removeClippedSubviews`, `maxToRenderPerBatch`, `windowSize`, `getItemLayout` | Or migrate to `@shopify/flash-list` (v2 needs the New Architecture) |
11
- | JS-thread animation jank | `useNativeDriver: true` or `react-native-reanimated` | `useNativeDriver` can't animate layout props (width, height, margins, …) |
12
- | Heavy work during transitions | `requestIdleCallback()` | Runs the work when the JS thread is idle; `InteractionManager` is deprecated |
13
- | Slow startup | Defer heavy imports (lazy `require()`) | Check inline requires in the Metro config (on in bare RN, off in Expo) |
14
- | Redundant, heavy, or n+1 network calls | Inspect requests using `argent-metro-debugger`. On iOS, Android, and Mac apps, stop capture with `network-capture-stop`, then restart the app before profiling again. | Batch, debounce, or cache at the data layer |
5
+ | Finding | Fix | Detail |
6
+ | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
7
+ | Re-renders with same props | `React.memo(Comp)` | Only where the props really are equal between renders |
8
+ | Expensive recomputation / unstable callbacks | `useMemo(fn, [deps])` / `useCallback(fn, [deps])` | `useCallback` must pair with `React.memo` on child; alone it has no effect |
9
+ | Inline objects/arrays in JSX | `StyleSheet.create()` / module-level const | New reference every render breaks shallow equality |
10
+ | List jank | `removeClippedSubviews`, `maxToRenderPerBatch`, `windowSize`, `getItemLayout` | Or migrate to `@shopify/flash-list` (v2 needs the New Architecture) |
11
+ | JS-thread animation jank | `useNativeDriver: true` or `react-native-reanimated` | `useNativeDriver` can't animate layout props (width, height, margins, …) |
12
+ | Heavy work during transitions | `requestIdleCallback()` | Runs the work when the JS thread is idle; `InteractionManager` is deprecated |
13
+ | Slow startup | Defer heavy imports (lazy `require()`) | Check inline requires in the Metro config (on in bare RN, off in Expo) |
14
+ | Redundant, heavy, or n+1 network calls | Follow [Inspect network requests](../../argent-metro-debugger/SKILL.md#inspect-network-requests). Before profiling again, stop capture with `network-capture-stop` and restart the app. | Batch, debounce, or cache at the data layer |
@@ -20,7 +20,7 @@ For implementation tasks that modify visible UI, this workflow also serves as a
20
20
  4. **Verify**: check the returned screenshot. If it shows a loading/transitional state, block with `await-ui-element` (expected element `visible`, or a spinner `hidden`) rather than a guessed delay (its result carries the new screenshot and element tree), but only with a selector you can trust (`text`/`identifier`/`role`) that the screen is known to have or that you saw in a prior `describe`; a guessed one just times out. Otherwise use a short fixed wait. Pick evidence by what's being asserted:
21
21
  - **Visual** (layout, spacing, color, typography, image/icon rendering, clipping, overflow, text rendering): prefer `screenshot-diff` against the step 1 baseline: it surfaces pixel-visible changes the auto-screenshot might miss. Fall back to inspecting the auto-screenshot only when a stable baseline isn't available.
22
22
  - **Structural** (navigation state, element existence, accessibility labels/values, selection, hierarchy, route): verify with `describe` or `debugger-component-tree`.
23
- - **Runtime / log / network** (console errors, API calls, persistence, timing): use `debugger-log-registry`, `debugger-evaluate`, or targeted tests. If a debugger tool returns `not_connected`, follow its `guidance` and verify again. To verify a specific request, start capture before the action, call `await-network-request` after it, then stop capture. See `argent-metro-debugger` for capture setup and recovery.
23
+ - **Runtime / log / network** (console errors, API calls, persistence, timing): verify with `debugger-log-registry`, `debugger-evaluate`, or targeted tests. If the debugger reports `not_connected`, follow its `guidance` before drawing conclusions. For a specific API request, start capture before the action. Then call `await-network-request` and finish with `network-capture-stop`. See [Inspect network requests](../argent-metro-debugger/SKILL.md#inspect-network-requests) for setup.
24
24
  - **Mixed**: collect evidence for each relevant class.
25
25
  - Report the combined verdict: expected behavior, observed behavior, evidence used, and any blocker for requested visual diffing.
26
26
  5. **Repeat** for each step in the flow.