-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Use inline rename session options for all checkboxes directly #61785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use inline rename session options for all checkboxes directly #61785
Conversation
| private void ComputeRenameFile() | ||
| { | ||
| // If replacementText is invalid, we won't rename the file. | ||
| RenameFileFlag = _isReplacementTextValid && AllowFileRename && _session.Options.RenameFile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the check for "thing being renamed is actually a class that represents the file name"? Is that part of the InlineRenameFileRenameInfo.Allowed check on line 49?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. That portion is calculated based on the session start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would generally expect the check boxes to not persist if the user dismisses the dialog with Esc. Is there a reason this UI needs to be treated differently from other UIs in handling of this key?
The flyout view model isn't recreated
I believe it's trivial to reassign the data context at the time the UI is going to be shown. This allows for explicit control of save/discard.
Looking deeper into the issue, I conflated two things and misspoke. The ViewModel is binding to a new session each time, so it has to be recreated. The issue was that the session options are stored and loading across sessions. We could address this in the ViewModel or at time of session creation to reset the file rename option. As for escape behavior, this follows what the current inline rename experience does. I'd prefer to have a second issue and follow up if we want a behavior change here. As of now that should not block this fix. |
Dismissing for now. If we need these changes it should be a follow up PR
Fixes #60294
The flyout view model isn't recreated, so if the session options change in some way (such as being reset) it won't get updated between showing/hiding. This fixes so there's no intermediate variables and binds directly to the session options.