Description
Summary
The collapsed React Native LogBox banner is detected only while it holds one log entry. With two or more entries, React Native renders the count instead of !, so the banner label starts with a number (20, Failed to …). No collapsed-warning pattern matches that label. react-native dismiss-overlay then reports No React Native overlay detected, snapshots carry no overlay hint, and a press on a control under the banner opens the full LogBox inspector instead.
Environment
- agent-device 0.21.40 (observed). The detection code is byte-identical on
mainat115c83a8and in 0.21.41. - Android emulator, React Native 0.86.3 app, debug build (Metro,
__DEV__true).
Current state (evidence)
Symptom. The app's background polling failed for several minutes and logged console.error each time. The collapsed banner at the bottom of the screen grew from 8 to 20 entries. Its label in the snapshot was 20, Failed …. Then:
$ agent-device react-native dismiss-overlay
No React Native overlay detected
The next step pressed a button whose rect overlapped the banner (button y 2190–2337 px, banner y 2146–2271 px, press at y 2264). The diff after the press showed the LogBox inspector (Dismiss, Minimize) instead of the expected screen.
Why the label starts with a number. Libraries/LogBox/UI/LogBoxNotificationCountBadge.js:28 renders {props.count <= 1 ? '!' : props.count}. So the badge text is ! for one entry and the count (2 or more) otherwise. The badge text and the message are children of one Pressable (LogBoxNotification.js:42-58). Both platforms join the children's text into the button's label with ", ":
- Android:
ReactAccessibilityDelegate.getTalkbackDescriptionjoins non-focusable children with", ". The dismiss button is a focusablePressable, so it is left out. - iOS:
RCTRecursiveAccessibilityLabeljoins child labels with", ".
The resulting label is "<count>, <message>", e.g. 20, Failed to fetch ….
Local probe. I ran the 0.21.40 detector on synthetic nodes with the banner's rect:
| Label | detected | action |
|---|---|---|
!, Failed to fetch |
true | close-collapsed-banner |
20, Failed to fetch |
false | — |
Error: Failed to fetch |
false | — (intended since #4366) |
Code path (main 115c83a8; identical in v0.21.40 83328f1d):
packages/contracts/src/react-native-overlay.ts:9-14:COLLAPSED_WARNING_PREFIX_PATTERNSholds/^!,\s+/, the generic severity prefix and the unhandled-rejection pattern. No pattern accepts a numeric count.packages/contracts/src/react-native-overlay.ts:44-66:isReactNativeCollapsedWarningLabelandisReactNativeCollapsedWarningEvidenceLabelbuild on those patterns.packages/capture-kit/src/react-native-overlay.ts:189-191:isCollapsedWarningSummaryLabelchecks only/^!,\s+/.isSafeCollapsedWarningCoordinateFallback(197–203) inherits the same limit.packages/daemon/src/execution/handlers/react-native.ts:109: emitsNo React Native overlay detectedwhen the facts come back empty.packages/capture-kit/src/ios-snapshot-engine/noise-overlay.ts:88-103: the iOS full-screen wrapper suppression also uses the contracts label check, so it likely misses count banners too. I inferred this from the source and have not measured it on a device.
Existing tests (packages/capture-kit/src/react-native-overlay.test.ts, packages/daemon/src/execution/handlers/__tests__/react-native.test.ts) use only !, …, Error: and Warning: labels. I found no issue or PR about the count badge (searched LogBox, collapsed banner, dismiss-overlay, badge, LogBoxNotificationCountBadge). #554, #565, #566, #577, #641 and #4366 cover the !, banner only.
Reproduction
- In a React Native debug build (for example
examples/test-app), log two warnings or errors on a screen, e.g. callconsole.error('first')andconsole.error('second')in an effect. PR fix: harden React Native overlay dismissal #641 used the same kind of temporary trigger. - Wait until the collapsed banner shows
2in the badge. agent-device snapshot -i: the banner's label is2, second(or similar), and no overlay hint is printed.agent-device react-native dismiss-overlay: printsNo React Native overlay detected.- Log one more entry and repeat with the same result. With a single entry (
!), steps 3–4 detect and dismiss the banner.
Required behavior
A collapsed LogBox banner is detected and dismissable regardless of the entry count. Ordinary UI whose label starts with a number, such as 2, Morning in a list row or 3, Cart on a tab, is not treated as a banner.
Completion conditions
react-native dismiss-overlaycloses a collapsed banner whose badge shows 2 or more, on Android and iOS.- Snapshot overlay hints appear for count banners as they do for
!banners. - Detector tests cover count labels, and numeric-prefixed labels that are not LogBox (list rows, tabs, prices such as
20,000원) stay undetected.
Suggested fix
- Accept
^(?:[2-9]|[1-9]\d+),\s+\Sas a collapsed-banner label only together with the banner geometry. In a local patch I required: the existing collapsed-banner size checks, a width of at least 80% of the screen (LogBox insets the banner 10 pt on each side), and a bottom edge withinmax(160, 15%)of the screen bottom (LogBox anchors the banner atbottom: 20). With those checks, my probe still detected the count banner and rejected mid-screen, top-of-screen and tab-bar labels. It still accepted one false positive: a full-width row with a label like3, Eveningpinned to the bottom edge. - Put the condition in the contracts label check, so capture-kit detection and the iOS wrapper suppression change together.
- If the accessibility tree exposes it, anchoring on LogBox's own structure (the badge
Texthasid="logbox_notification_count_text") would remove that remaining false positive. I have not checked whether either platform's tree surfaces that id.
Workaround
Turning LogBox off on screen in automated runs (LogBox.ignoreAllLogs()) avoids the banner. Errors still reach console, and fatal errors still open the inspector.
Activity
thymikee commentedon Nov 21, 2026
Triage: bug; actionable without more input from you. Both detectors accept only the
!,prefix (packages/contracts/src/react-native-overlay.ts:10,packages/capture-kit/src/react-native-overlay.ts:189), so the collapsed banner with a count badge drops out. The fix belongs in the contracts label check, so detection and the iOS wrapper suppression change together. It anchors on the badge id if either tree exposes it, otherwise on the banner geometry. Your negative cases become tests.thymikee commentedon Nov 21, 2026
An agent is picking this up; the PR will link here.