Repository navigation
fix(react-native): detect the collapsed LogBox banner's count badge - #4890
Conversation
From two entries up, LogBox's badge renders the entry count instead of `!` (LogBoxNotificationCountBadge), so the collapsed banner's joined label reads `20, Failed to fetch`. No collapsed-warning pattern accepted that shape, so dismiss-overlay reported `No React Native overlay detected`, snapshot carried no overlay hint, and a press on a control under the banner opened the inspector. Detect the `<count>, <message>` form only where LogBox places its banner: the node is banner-sized, spans nearly the capture's own box, and hangs off that box's bottom edge. Ordinary rows that open with a number (a list row, a tab, a price) keep their meaning, and a capture that publishes no box keeps the label-only rule. The rule lives in the contracts label check, so the snapshot detector, the dismiss target, and the iOS full-screen wrapper suppression change together.
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 4f1294e. The verdict and the full list are in the summary comment.
…anner
The placement rule asked only that a count banner be wide and sit near the bottom
edge, so a full-width row flush with that edge ("2, Continue shopping") read as a
LogBox banner and its close point got tapped.
LogBox floats its banner with left: 10, right: 10 and bottom: 20 inside its own
container, so the banner keeps a visible gap on all three sides and no gap larger
than LogBox's own. The rule now measures those gaps against the capture's box and
rejects a row pinned to a side or the bottom edge, which is app chrome: a tab bar,
a footer, or a bottom-sheet row.
This comment has been minimized.
This comment has been minimized.
|
The collapsed-banner count badge is still missed on iPad and tablet-width surfaces at 6fcf103, and the change has no live device run yet.
This change decides which tap Not blocking, and these can be taken or left: the 15% upper band (react-native-overlay.ts:36) admits ordinary inset cards, for example a 370x72 card labeled '3, New messages' at x 16 above an 83pt tab bar on a 402x874 capture, so requiring small, roughly equal side gaps (about 3% of width or less) plus a negative fixture would tighten it; the The earlier inline thread about a full-width bottom row is fixed at this head, so it can be resolved: #4890 (comment). The only checks not passing are two cancelled 'Body rules' runs, which a newer body edit supersedes, and the diff touches no workflow or body-check script, so the cancellation looks unrelated to the code. Not verified here: tests were not run locally, no device tree was inspected, the claim that the badge id is unreachable in both trees, and the Android app-window size against the display under a non-edge-to-edge navigation bar. No conflicts. Before merge, the side-gap floor must pass LogBox's 10-unit gap on surfaces wider than 1000 units, and the live count-banner run above must show the snapshot hint and |
The side-gap floor asked for 1% of the surface width, so a real banner failed it once the surface passed 1000 units: a 13" iPad Pro portrait window, every iPad in landscape, an unfolded foldable. LogBox's gap is a fixed 10 units, so the floor is now one unit and the cap is LogBox's own gap, widened by ratio only for device-pixel captures. The bottom band already capped the gap, so the clause above it could not reject anything and is gone. A count banner now also reaches the coordinate fallback through the nodes already proven to be banners, so the facts no longer carry a surface, and nodeHasMatchingLabel says what it answers.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on a0cfc96. The verdict and the full list are in the summary comment.
The count-badge banner was accepted by a side band widened with a surface ratio, which also accepted an ordinary inset card on a wide surface. Match LogBox's fixed 10 dp inset instead, translated with the capture's own rect units: the Android helper publishes physical pixels, so the state now carries the helper's density beside the viewport.
Live device evidenceTested SHA iPhone 17 Pro (iOS 27.0)
{ "x": 369, "y": 813, "message": "React Native overlay dismiss action sent and verified gone",
"action": "dismiss-overlay", "overlayAction": "close-collapsed-banner",
"ref": "e8", "label": "2, Failed to fetch shipping options", "dismissed": true, "verified": true }iPad Pro 13-inch (M5) (iOS 27.0) — the tablet-width caseThe banner's 10-unit side gap is under 1% of a 1032-unit-wide surface, which is the geometry the earlier ratio band got wrong.
{ "x": 999, "y": 1324, "message": "React Native overlay dismiss action sent and verified gone",
"action": "dismiss-overlay", "overlayAction": "close-collapsed-banner",
"ref": "e5", "label": "2, Failed to fetch shipping options", "dismissed": true, "verified": true }Same iPad, same fixture,
|
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
This PR is ready at e4e058e. The two high-priority findings from the earlier review (#4890 (comment)) are fixed. The flush full-width row now fails the 10 dp check, and the fixed 10 dp ±1 side gap replaces the width-ratio band, with negative tests for both. All 21 checks pass at this commit. Not blocking, and fine to take or leave: add one |
Summary
A collapsed LogBox banner is detected only while it holds one log entry. From two entries up, LogBox's badge renders the entry count instead of
!(LogBoxNotificationCountBadge), so the banner's label reads20, Failed to fetch, and no collapsed-warning pattern matched it.react-native dismiss-overlaythen reportedNo React Native overlay detectedandsnapshot -icarried no overlay hint (#4787).Detection now accepts the
<count>, <message>form only where LogBox floats its banner: banner-sized, and both side gaps equal to its fixed 10 dp inset, read in the capture's own units. Android publishes physical pixels, so the snapshot state carries the helper's density beside the viewport. Rows that merely open with a number (2, Morning, a flush footer, a 16 pt inset card) stay undetected. The rule sits in the contracts label check, so detection, the dismiss target and iOS wrapper suppression change together. No new flags.Before / after
Validation
Tested at
e4e058e9onorigin/main. The count-banner tests fail at base for the intended reason and pass at head. Live on two simulators, iPhone 17 Pro and iPad Pro 13-inch, both capture the count banner, publish the hint and verify the dismiss; rebuilt at base on the same iPad session, the same capture answersNo React Native overlay detected. Excerpts in the evidence comment. Android is unverified on device and rests on fixtures.pnpm lint,pnpm typecheckandpnpm formatpass.Fixes #4787
🤖 Generated with Claude Code