fix: adds close button on response error screen#8093
Conversation
WalkthroughThe PR updates error UI rendering in the survey component's 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/surveys/src/components/general/survey.tsx`:
- Around line 1053-1063: The close-button header JSX is duplicated across the
error branches in survey.tsx; extract it into a single constant (e.g.,
closeHeader or CloseHeaderElement) defined before the switch/conditional and
reuse that constant in both ResponseSendingError and
RecaptchaError/InvalidDeviceError branches instead of repeating the
SurveyCloseButton markup (keep references to localSurvey.type, onClose,
styling.inputBgColor, and styling.roundness unchanged so behavior is identical).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 486055fb-3388-4ecf-8516-e5f9663483f3
📒 Files selected for processing (1)
packages/surveys/src/components/general/survey.tsx
|



Fixes https://linear.app/formbricks/issue/ENG-1029
Adds the close button in the survey response error UI