Repository navigation
Conversation
FolloweePicker and SimpleFollowingModal reset only in a timer after the close. A reopen within DIALOG_RESET_DELAY_MS cleared that timer, so the old state stayed in the dialog. Reset on open as well.
|
✅ No security or compliance issues detected. Reviewed everything up to 395caf2. Security OverviewDetected Code Changes
|
📊 Build Bundle StatsThe latest build generated the following assets: |
Contributor
There was a problem hiding this comment.
🟢 Approved
No active review issues remain for the voting-dialog state reset changes.
No open issues 🎉
What changed in this PR
Fixes stale state in the voting dialogs when they reopen before the delayed close reset runs, while preserving the delay for close animations.
Changes:
- Resets
FolloweePickerandSimpleFollowingModalimmediately on open. - Uses
useEffectEventso reset effects depend only onopen. - Adds regression tests for rapid reopening and preserving an in-progress follow while the modal stays open.
| File | Description |
|---|---|
src/governance-app-frontend/src/features/voting/components/SimpleFollowingModal.tsx |
Resets on open and retains the delayed close reset. |
src/governance-app-frontend/src/features/voting/components/SimpleFollowingModal.test.tsx |
Tests search and confirmation resets on reopen, plus in-progress follow state. |
src/governance-app-frontend/src/features/voting/components/FolloweePicker.tsx |
Resets wizard state on open while preserving the close-animation delay. |
src/governance-app-frontend/src/features/voting/components/FolloweePicker.test.tsx |
Tests that rapid reopening returns to the first step with cleared selections. |
Review effort: Balanced
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.
Motivation
FolloweePickerandSimpleFollowingModalreset their state only in a timer after the close. If the dialog opens again withinDIALOG_RESET_DELAY_MS, the timer is cleared, so the old step, selection, or search stays in the reopened dialog.MutationDialogandStakingWizardModalalready handle this case with a reset on open.Changes
FolloweePickerandSimpleFollowingModal, and kept the delayed reset for the close animation.SimpleFollowingModaltouseEffectEvent, so the effect depends only onopen.