Skip to content

Update Rename UI to accommodate for getting suggestions automatically#72790

Merged
Cosifne merged 21 commits intodotnet:release/dev17.10from
AmadeusW:dev/amwieczo/smartRenameWithoutDropdown
Apr 2, 2024
Merged

Update Rename UI to accommodate for getting suggestions automatically#72790
Cosifne merged 21 commits intodotnet:release/dev17.10from
AmadeusW:dev/amwieczo/smartRenameWithoutDropdown

Conversation

@AmadeusW
Copy link
Contributor

@AmadeusW AmadeusW commented Mar 28, 2024

We're introducing an experiment to automatically request Rename suggestions.
We don't want to automatically obstruct the Rename options with suggested names, so we've worked with PMs and designers to come up with a UI that always accommodates for 3 results, and gets them automatically.
User may opt out of this behavior by toggling the Copilot button (via mouse or hitting Ctrl+Space), which would restore the default UI.

Screenshots and Gifs

Inline rename with Copilot, suggestions are obtained automatically

✨ this is the new scenario
roslyn NEW behavior

Ctrl+Space works to toggle whether suggestions are obtained automatically. If they were off, hitting Ctrl+Space will request suggestions. This state is saved for next time when the rename dialog opens.
roslyn NEW persistence

String changes:

  • Removed the Shift+Space comment, which drastically narrowed the window back to its original size
  • Adjusted the tooltip (this is a new string and may need to be localized)
    image

For reference: Inline rename with Copilot, existing behavior

where Ctrl+Space or button press gets suggestions
Here, the copilot button is a bit smaller (and chevron is larger) so that buttons line up. Additionally, the progress bar does not have a light gray background that it had before.
roslyn NEW manual smart rename

For reference: Inline rename without Copilot

Here, the chevron button is a bit larger. I had to make this change so that the buttons line up in all 3 scenarios. This increased height of the textbox by 2px, which I believe looks better.
roslyn NEW no smart rename2

@AmadeusW AmadeusW requested a review from a team as a code owner March 28, 2024 22:03
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 28, 2024
@dotnet-policy-service dotnet-policy-service bot added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Mar 28, 2024
@Cosifne
Copy link
Member

Cosifne commented Mar 28, 2024

Do you want to target release/dev17.10?

@AmadeusW AmadeusW changed the base branch from main to release/dev17.10 March 28, 2024 22:15
@AmadeusW
Copy link
Contributor Author

Do you want to target release/dev17.10?

yes, thank you!

{"dotnet_rename_use_inline_adornment", new RoamingProfileStorage("TextEditor.RenameUseInlineAdornment")},
{"dotnet_preview_inline_rename_changes", new RoamingProfileStorage("TextEditor.Specific.PreviewRename")},
{"dotnet_collapse_suggestions_in_inline_rename_ui", new RoamingProfileStorage("TextEditor.CollapseRenameSuggestionsUI")},
{"dotnet_rename_get_suggestions_automatically", new FeatureFlagStorage(@"Editor.AutoSmartRenameSuggestions")},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature flag is defined as follows in the .pkgdef file:

[$RootKey$\FeatureFlags\Editor\AutoSmartRenameSuggestions]
"Value"=dword:00000000

@Cosifne Cosifne mentioned this pull request Mar 29, 2024
@AmadeusW
Copy link
Contributor Author

AmadeusW commented Mar 29, 2024

Adding @romalpani and @verautia_microsoft for UX review


GetSuggestionsCommand = new DelegateCommand(OnGetSuggestionsCommandExecute, null, threadingContext.JoinableTaskFactory);

var getSuggestionsAutomatically = _globalOptionService.GetOption(InlineRenameUIOptionsStorage.GetSuggestionsAutomatically);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should InlineRenameUIOptionsStorage.GetSuggestionsAutomatically be called nlineRenameUIOptionsStorage.UseSuggestionsPanel? I was confused when looking at this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also InlineRenameUIOptionsStorage.CollapseSuggestionsPanel seems like controlling the GetSuggestionsAutomatically behavior. So I guess they might need a better name


var getSuggestionsAutomatically = _globalOptionService.GetOption(InlineRenameUIOptionsStorage.GetSuggestionsAutomatically);
IsUsingResultPanel = getSuggestionsAutomatically;
IsUsingDropdown = !IsUsingResultPanel;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just use one bool value, or enum. I feel tracking two mutual exclusive states are quite confusing..

@Cosifne
Copy link
Member

Cosifne commented Mar 29, 2024

Overall lgtm, we might want to

  1. See if the telemetry meets PM's needs, and test it works locally.
  2. Validate that PR in 17.10. Then find QB next week.

cc @dibarbet this is another QB PR.

@AmadeusW
Copy link
Contributor Author

AmadeusW commented Apr 1, 2024

Per feedback, I updated the layout and color of the button

Dark theme, collapsed
image

Dark theme, expanded
image

Blue theme, collapsed
image

Blue theme, expanded
image

Light theme, collapsed
image

Light theme, expanded
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. untriaged Issues and PRs which have not yet been triaged by a lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants