Save Settings text inputs on blur#53036
Merged
ChristopherBiscardi merged 3 commits intozed-industries:mainfrom Apr 7, 2026
Merged
Save Settings text inputs on blur#53036ChristopherBiscardi merged 3 commits intozed-industries:mainfrom
ChristopherBiscardi merged 3 commits intozed-industries:mainfrom
Conversation
Co-authored-by: Anthony Eid <[email protected]>
Previously, when writing in a Settings input field and tabbing between text inputs, the value the user wrote would be lost. This was particularly an issue when searching for settings meant that a text value was at the *end* of the settings page, and a tab out of the input would result in cycling to the top and losing a view of the input. Settings inputs that don't have confirm buttons should confirm when blurring focus, since a user has written something into the text box. This is complicated by the fact that there is another piece of code here that fires events during render, which is an anti-pattern since it means that events relating to inputs will fire out-of-order (such as: on_blur:confirm -> render:set_state back to original value -> render value from Settings file). However this code's behavior is meant to prevent the override of a user's active field if the settings file is changed by another process. It is unclear to me that this is a good behavior, since a user can lose that data without realizing it, but it was intentionally implemented. The test for this render logic currently uses the user's written data in the input field for comparison, which isn't actually indicating whether the initial value has changed. So in this PR we store the *original* initial value, and compare future initial values against it, updating the initial value if necessary.
0de9b55
into
zed-industries:main
74 of 79 checks passed
MasoudAlali
pushed a commit
to MasoudAlali/zed-ide
that referenced
this pull request
Apr 7, 2026
Co-authored-by: Anthony Eid <[email protected]>
piper-of-dawn
pushed a commit
to piper-of-dawn/zed
that referenced
this pull request
Apr 25, 2026
Co-authored-by: Anthony Eid <[email protected]>
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.
Previously, when writing in a Settings input field and tabbing between text inputs, the value the user wrote would be lost. This was particularly an issue when searching for settings meant that a text value was at the end of the settings page, and a tab out of the input would result in cycling to the top and losing a view of the input.
Settings inputs that don't have confirm buttons should confirm when blurring focus, since a user has written something into the text box.
This is complicated by the fact that there is another piece of code here that fires events during render, which is an anti-pattern since it means that events relating to inputs will fire out-of-order (such as: on_blur:confirm -> render:set_state back to original value -> render value from Settings file). However this code's behavior is meant to prevent the override of a user's active field if the settings file is changed by another process. It is unclear to me that this is a good behavior, since a user can lose that data without realizing it, but it was intentionally implemented.
The test for this render logic currently uses the user's written data in the input field for comparison, which isn't actually indicating whether the initial value has changed. So in this PR we store the original initial value, and compare future initial values against it, updating the initial value if necessary.
Previous Behavior
Screen.Recording.2026-04-02.at.6.13.28.PM.mov
This PR
Screen.Recording.2026-04-02.at.6.01.14.PM.mov
Self-Review Checklist:
Release Notes: