Add support for opening the Suggestions UI with recent commands#14943
Add support for opening the Suggestions UI with recent commands#14943zadjii-msft merged 95 commits intomainfrom
Conversation
…Ev-DaYs' into dev/migrie/fhl-2023/pwsh-autocomplete-demo
…wsh-autocomplete-demo
…grie/f/14779-sxnui-recent-commands
…grie/f/14779-sxnui-recent-commands
…grie/f/14779-sxnui-recent-commands
…grie/f/14779-sxnui-recent-commands
Co-authored-by: Carlos Zamora <[email protected]>
| if (Visibility() == Visibility::Visible && _direction == TerminalApp::SuggestionsDirection::BottomUp) | ||
| { | ||
| auto m = this->Margin(); | ||
| m.Top = (_anchor.Y - ActualHeight()); | ||
| this->Margin(m); | ||
| } |
There was a problem hiding this comment.
I feel like the reliance on the cached _direction member here will lead to bugs. I think it would be more robust if there was a common function that would recompute the entire layout whenever any of its parameters change.
I mean a size change should lead to potential a call to _setDirection right? If there was less state here and more "recomputations" (English word 404), would this be simpler? As such I think that this code should be abstracted: https://github.com/microsoft/terminal/blob/dev/migrie/f/14779-sxnui-recent-commands/src/cascadia/TerminalApp/SuggestionsControl.cpp#L1088-L1103
...but it might be necessary to move even more logic in there.
There was a problem hiding this comment.
Yea, I was hoping that by just starting with the right direction based off the size it opened with, then anything smaller would still make sense in that direction.
I worry that like, trying to rearrange the layout of the control while the size is changing is just gonna trigger another size change. I'm sure there's a correct way to do this with the Arrange/Layout events in WinUI, but that's a dark part of the framework I've been trying my best to avoid 😅

This adds support for a new action,
showSuggestions, as described in #14864. This adds just onesourcecurrently,recentCommands. This requires shell integration to be enabled in the shell to work properly. When it is enabled, activating that action will invoke the suggestions UI as a palette, populated withsendInputactions for each of the user's recent commands.There's mild plans to remedy that in a follow-up, though that needs a bit more design consideration.
Closes #14779