fix: take the survey card rect from the renderer instead of scraping the DOM [ENG-3155] - #56
Conversation
…the DOM [ENG-3155]
|
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 (5)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe survey HTML no longer polls or observes the DOM for card geometry. It forwards rectangles supplied by the renderer as Geometry messages. SurveyTouchRegion represents everything, nothing, or a card rectangle. The WebView starts by accepting all pointer hits, then updates its region when it receives geometry. Overlay placements continue to bypass the pointer mask. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The change makes the survey card touch region follow renderer-reported geometry and keeps the card tappable before geometry arrives. No merge-blocking risk was identified. Release it only after the companion renderer change is deployed, as the author notes. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
|



Ref ENG-3155
What & why
Was: the SDK found the survey card by scraping the renderer's DOM (
#fbjs [role="dialog"]). That broke once already when an a11y fix moved the attribute it matched, and a missing rect made the card itself untappable, because the mask read "no rect" as "claim nothing".Now: the renderer reports the card rect through
onCardRectChange, and the mask has three states: no rect yet blocks everything (as before the mask existed), a rect passes touches outside the card through,nullclaims nothing.Where to look
widgets/survey_touch_region.dart: the three states.widgets/survey_html.dart: the probe and its rAF/MutationObserver loop are gone;onCardRectChangeis passed intorenderSurvey.widgets/survey_webview.dart: the mask starts ateverything.Coverage
overlay: none: host scrolls beside the card, card works inside, nothing left after closenon-overlay before geometry arrives: the survey takes the tapsurvey_touch_region.dart:39null→everything(3 tests fail)survey_touch_region_test.dartRerun:
cd packages/formbricks && flutter test test/widgets/survey_webview_test.dart --plain-name "non-overlay before geometry arrives"— fails withmain'ssurvey_html.dart/survey_webview.dart(1 host tap, expected 0), passes here.Full suite: 346 tests;
flutter analyzeclean.Open gaps
Breaking changes
No public API change.