-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add support for opening the Suggestions UI with recent commands #14943
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
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.
schema!
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 onesource
currently,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 withsendInput
actions 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