fix: cell value state synchronization bugs (validation leak & flicker) #5051
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.
Fixes #4889
This pull request resolves multiple issues related to incorrect cell value behavior during editing, specifically in unique columns and date/time columns. The previous behavior caused inconsistent validation, stale UI values, and formatting glitches when entering or exiting edit mode. This PR refactors cell-edit state handling to keep the UI, edit buffer, and row data fully in sync.
Technical details
Refactored how edit state is initialized, updated, and cleared.
Uniqueness validation is now consistently triggered every time a duplicate value is entered.
Fixed stale rendering where edited values remained visible after switching cells or refreshing.
Standardized sync between raw input, formatted display value, and underlying row data.
Date/time fields now correctly retain formatted display (“19:00”) after Escape, instead of reverting to original user input (“7:00 PM”).
Improved subscription behavior so cell state resets properly after sheet refresh.
Checklist
My pull request has a descriptive title.
My pull request targets the develop branch of the repository.
My commit messages follow best practices.
My code follows the repository’s style.
I added tests if applicable.
I added or updated documentation if applicable.
I ran the project locally and verified no visible errors.