Skip to content

fix: adds close button on response error screen#8093

Merged
Dhruwang merged 1 commit into
mainfrom
fix/close-button-error-screen
May 21, 2026
Merged

fix: adds close button on response error screen#8093
Dhruwang merged 1 commit into
mainfrom
fix/close-button-error-screen

Conversation

@pandeymangg
Copy link
Copy Markdown
Contributor

Fixes https://linear.app/formbricks/issue/ENG-1029

Adds the close button in the survey response error UI

Screenshot 2026-05-21 at 13 27 23

@pandeymangg pandeymangg requested a review from Dhruwang May 21, 2026 07:57
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Review Change Stack

Walkthrough

The PR updates error UI rendering in the survey component's getCardContent function. For ResponseSendingError, it adds conditional rendering of a styled SurveyCloseButton above the error component when survey type is not "link". For RecaptchaError and InvalidDeviceError, the close-button container layout was updated to use bg-survey-bg relative h-8 w-full classes and SurveyCloseButton now receives hoverColor and borderRadius props derived from the survey styling configuration.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It includes the issue reference and a screenshot but is missing most required sections: 'How should this be tested?' and the full Checklist with required and appreciated items. Add 'How should this be tested?' section with specific test instructions and complete the Checklist section with self-review confirmations and other required items.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a close button to the response error screen, which aligns with the code modifications shown in the raw summary.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ef18aac and 76e9423.

📒 Files selected for processing (1)
  • packages/surveys/src/components/general/survey.tsx

Comment thread packages/surveys/src/components/general/survey.tsx
@sonarqubecloud
Copy link
Copy Markdown

@Dhruwang Dhruwang added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit db87a58 May 21, 2026
17 checks passed
@Dhruwang Dhruwang deleted the fix/close-button-error-screen branch May 21, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants