-
Notifications
You must be signed in to change notification settings - Fork 213
fix(surveys): properly clean up popover surveys on close #2595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(surveys): properly clean up popover surveys on close #2595
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
16f38bf to
6d91284
Compare
|
Size Change: -112 B (0%) Total Size: 5.06 MB
ℹ️ View Unchanged
|
What ChangedThe fix is in Before: if (survey.type === SurveyType.Popover) {
removeSurveyFromFocus(survey)
}After: if (isPopup) {
removeSurveyFromFocus(survey)
}This changes the condition from checking the survey's configured type to checking how the survey is actually being displayed. Why This Fix is NecessaryThe original logic had a conceptual flaw: it determined cleanup behavior based on
How This Fits the CodebaseThe fix aligns with the existing architecture where display behavior should be determined by how a survey is being shown rather than its configured type. The Potential IssuesLow Risk: The change is minimal and well-targeted. The Testing Gap: The PR doesn't include tests for this specific scenario. While the fix is straightforward, adding a test that verifies surveys can be re-opened after programmatic display and close would strengthen confidence. Backward Compatibility: This change maintains full backward compatibility - it only fixes the broken case without affecting existing working scenarios. Confidence Score: 4/5This is a well-reasoned fix that addresses a clear architectural inconsistency. The change is minimal, targeted, and aligns with existing patterns in the codebase. The only concern is the lack of accompanying tests for this specific workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, no comments
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
lucasheriques
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add an e2e test to cover this behavior?
plus, shouldn't the usePopupVisibility be called with the isPopup? or is it already being called?
|
will add a test! yeah this change calls |
6d91284 to
383d9a0
Compare
|
@lucasheriques wrapped an existing test to run for all survey types -- it was almost already testing what we want |
lucasheriques
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!! 🚢

Problem
when opening surveys via API
displaySurvey, they are not properly cleaned up on close, and then cannot be re-openedcloses #2586
Changes
instead of checking only survey type, check display type -- so all surveys displayed as popovers (regardless of survey type) are cleaned up as needed
Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file