feat: zustand store + move feedback modal to builder page#9688
Open
bookwormsuf wants to merge 3 commits into
Open
feat: zustand store + move feedback modal to builder page#9688bookwormsuf wants to merge 3 commits into
bookwormsuf wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Widen rating range (0-5), add triggerSource/formId/ratingChanged fields, dual-emit Datadog metrics for safe migration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lder Replace the sessionStorage-based feedback trigger with a zustand store. Move AdminFeedbackContainer from WorkspacePage to AdminFormLayout (behind the 5star-admin-rating feature flag). Remove desktop-only check. 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 was referenced Jun 30, 2026
Contributor
|
Could we update the description?
|
Contributor
Author
|
Got it! Added test cases for when the modal shows and when it doesn't. On the breaking change: this PR still uses the thumbs up/down UI. It sends 0/1 via the old |
6 tasks
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
The admin feedback modal lives on the dashboard (WorkspacePage) where admins rarely spend time. Trigger state is stored in sessionStorage, which doesn't integrate with React's rendering cycle and can't carry metadata like which action triggered the prompt.
Solution
Replace sessionStorage with a zustand store and move the feedback container from the dashboard to the form builder page (AdminFormLayout), where admins actively work. The modal still shows the existing thumbs up/down UI. The feature flag from PR 1 gates the render.
Key changes:
adminFeedbackStore.ts(34 lines): zustand store withisEligible,triggerSource,formIdAdminFeedbackContaineruses store selectors instead of sessionStorageWorkspacePagetoAdminFormLayout(behinduseFeatureIsOn)useEditFieldForm,PaymentsInputPanel) callsetEligible('field-edit', formId)instead of setting sessionStorageuseBuilderFieldscleaned up (removed 24 lines of old threshold logic)sessionStorage.tsdeletedThis is PR 3 of 5 in the admin satisfaction revamp stack:
Breaking Changes
No. This PR keeps the existing thumbs up/down UI and only changes where the modal renders (builder instead of dashboard) and how trigger state is stored (zustand instead of sessionStorage). The 5-star rating UI is a later PR (5) in this stack. PR 2 (#9684) widened the backend to accept ratings 0-5 so it's forward-compatible, but the frontend here still submits 0/1.
Tests
Build
pnpm buildpassesModal show/hide (flag ON)
Flag OFF
🤖 Generated with Claude Code