fix(environment-table-autosave)/autosave removes the already added characters in environment table#8410
Open
sachin-thakur-bruno wants to merge 3 commits into
Conversation
…aracters in environment table
…environment-table-auto-save
Contributor
|
Caution Review failedAn error occurred during the review process. Please try again later. 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. Comment |
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.
Description
When Auto Save is triggered while the user is actively typing (especially with Auto Save delays below 1000 ms), the cursor jumps back to its previous position.
This interrupts typing and causes newly entered text to be inserted at the wrong location, making it seem like recent input was lost.
JIRA
Problem
EnvironmentVariablesTableuses Formik withinitialValuesfromenvironment.variablesin Redux.After every autosave, Redux updated
environment.variableswith a new array reference. BecauseenableReinitializewas enabled, Formik reset the form while the user was still typing. The form could not distinguish its own save from a real external update.Fix
enableReinitialize.environment.variableschanges and the new values are not one of the form's own snapshots.handleSave, andhandleSaveAll.This prevents save echoes from resetting the form while still allowing genuine external updates to reload the form.
Added e2e for the behaviour and tested them before and after the fix. Before the fix tests were failing as autosave was clearing the texts. After the fix working as autosave is not clearing the unsaved text.
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.