fix: let host-app touches through when the survey has no overlay [ENG-3156] - #81
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughNo-overlay surveys now render in the host view tree and use the renderer-reported card rectangle to define the touch region. Android keyboard padding and hardware-back handling are added for this path; overlay surveys continue to use a modal. The Formbricks wrapper fills its parent. Survey triggers now skip replacing a survey that is already showing. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The changes are mergeable after normal checks. Touch passthrough still depends on deployment of the compatible renderer; older renderers retain the documented full-area fallback. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change has bounded client-side exposure and retains existing navigation and message controls. However, dismissing an overlay survey with Android back can now leave an invisible survey registered and block later surveys. Native touch behavior and renderer compatibility also require validation. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dhruwang
left a comment
There was a problem hiding this comment.
Two findings from a correctness pass: one confirmed, one plausible.
|



Ref ENG-3156
What & why
Was: every survey rendered in a transparent
<Modal>, which takes every touch however see-through it is, so the host app was frozen until the survey closed.noneis the default overlay.Now: with
overlay: none, only the survey card takes touches; everything else reaches the host app. Light and dark overlays still block, as before.Where to look
components/utils/survey-touch-region.ts: the three card states and the clip geometry.components/survey-web-view.tsx: the no-overlay render path, keyboard handling andCloseOnBack.lib/survey/action.ts: the new "already showing" guard.How it works, and behaviour changes worth checking
For
overlay: nonethe WebView renders in the host's own view tree instead of aModal. It stays full-size (so the renderer lays the card out exactly as before) inside a view clipped to the rect the renderer reports; React Native hit-testing respects that clip. Resizing the WebView to the card does not work: the renderer caps the card at 60dvh of the WebView's own viewport, so the two shrink each other to a clipped height.onRequestClosedid this before). Passing it to the host could navigate away and leave the survey over another screen.triggerSurveynow skips while a survey is showing.KeyboardAvoidingView. On Android it left a nav-bar gap after the keyboard closed, so Android pads by however much of the survey's area the keyboard covers; an app that already resizes for the keyboard gets none.<Formbricks />'s wrapper now fills its parent, since a no-overlay survey positions itself against it. Rendering it at the app root, as the README shows, is unchanged.Modalopened while the survey is up covers it; one already open when the survey triggers hides it until it closes.Coverage
overlay: none: host usable beside the card, card inside, nothing left after close (iOS + Android)overlay: light: Modal path unchanged, host blocked; after Android back the next trigger showssurvey-touch-region.ts:69dropcard === undefined,:33junk →nullrenderSurveysurvey-touch-region.test.ts,survey-web-view-harness.test.tsaction.ts:26guard offRerun:
pnpm --filter @formbricks/react-native testOpen gaps
adjustResizeapp without edge-to-edge is untested.Breaking changes
No public API change.