feat: replace thumbs up/down with 5-star rating UI#9692
Open
bookwormsuf wants to merge 1 commit into
Open
Conversation
Replace the old thumbs up/down feedback with a 1-5 star rating using the existing Rating component. Single-screen flow with adaptive comment labels based on rating (low/mid/high). Wire triggerSource and formId through to the API. Tighten Joi create validation to min(1). Remove deprecated AdminFeedbackRating enum. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Part 5 of admin satisfaction rating split (see #9683, #9684, #9688, #9689). Replaces the old thumbs up/down feedback modal with a 1-5 star rating and wires triggerSource/formId through to the API.
Solution
AdminFeedbackBox rewrite — deleted 4 sub-components and state machine (218 lines), replaced with a single 148-line component using the existing
<Rating>component. Stars render inline, and clicking a star immediately creates/updates the feedback record. An adaptive comment label changes based on rating: "What went wrong?" (1-2), "What could we improve?" (3), "What did you enjoy most?" (4-5).API wiring —
createAdminFeedbacknow accepts optionaltriggerSourceandformId.updateAdminFeedbackaccepts{ comment?, rating? }instead of just a comment string. The container captures trigger metadata from the zustand store via refs before reset clears it.Joi tightening — create validation changed from
min(0)tomin(1). The old0value was the thumbs-down binary; the new star UI never sends 0.Type cleanup — removed the deprecated
AdminFeedbackRatingenum, replaced withtype AdminFeedbackRating = 1 | 2 | 3 | 4 | 5.AdminFeedbackBase.ratingnow uses this type instead ofnumber.Reviewer tip: review the new
AdminFeedbackBox.tsxdirectly rather than following the diff. The old file was replaced entirely.Breaking Changes
No - backwards compatible. The star UI is gated behind the
5star-admin-ratingfeature flag (PR 1).Screenshots
Tests
TC1: Star rating renders and submits
window._growthbook.setForcedFeatures(new Map([['5star-admin-rating', true]]))rating: 3,triggerSource: 'field-edit',formIdsetTC2: Rating update works
rating: 5andratingChanged: trueTC3: Adaptive labels
TC4: Close without rating
🤖 Generated with Claude Code