Skip to content
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 descriptions to commands (namely, snippets) #17376

Merged
merged 13 commits into from
Jun 12, 2024

Conversation

zadjii-msft
Copy link
Member

This adds a "description" property to actions. Notably, the shell completion protocol (#3121) will now also populate that.

The suggestions UI can then use those descriptions to display an additional tooltip with that information.

TeachingTip was kinda an abject disaster last time I tried this, so this isn't a TeachingTip. It's literally a text block.

xlinks:

commit 8b19458
Author: Mike Griese <migrie@microsoft.com>
Date:   Fri Feb 16 05:49:37 2024 -0600

    I can't quite get bottom-up mode to work right

commit d77e3d5
Author: Mike Griese <migrie@microsoft.com>
Date:   Thu Feb 15 16:21:00 2024 -0600

    stash temporarily

commit 7b76ef8
Author: Mike Griese <migrie@microsoft.com>
Date:   Thu Feb 15 15:40:14 2024 -0600

    yea this looks better

commit 21ce4be
Author: Mike Griese <migrie@microsoft.com>
Date:   Thu Feb 15 14:04:04 2024 -0600

    out of body experience

commit ec36139
Author: Mike Griese <migrie@microsoft.com>
Date:   Thu Feb 15 13:48:06 2024 -0600

    an idea: just put the tooltips in the body?
@zadjii-msft
Copy link
Member Author

Gifs:
Top-down, suggestion menu
suggestions-tooltips-shell-completions

bottom-up suggestion palette
suggestions-tooltips-final

@@ -103,23 +103,10 @@
</ResourceDictionary>
</UserControl.Resources>

<Grid>
Copy link
Member Author

Choose a reason for hiding this comment

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

guess what? we basically weren't using this Grid for anything. There was only ever _backdrop in it, taking up the whole thing.

This was a side-effect of command palette copypasta

src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@PankajBhojwani PankajBhojwani left a comment

Choose a reason for hiding this comment

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

Just some nits!

src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
@zadjii-msft zadjii-msft added this pull request to the merge queue Jun 12, 2024

// Now fill up the "subtitle" part of the "tooltip" with the actual
// description itself.
const auto& inlines{ _descriptionComment().Inlines() };
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const auto& inlines{ _descriptionComment().Inlines() };
const auto inlines{ _descriptionComment().Inlines() };

this is a bad habit, we should not perpetuate it

void SuggestionsControl::_recalculateTopMargin()
{
auto currentMargin = Margin();
// Call Measure() on the descriptions backdrop, so that it gets it's new
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Call Measure() on the descriptions backdrop, so that it gets it's new
// Call Measure() on the descriptions backdrop, so that it gets its new

Merged via the queue into main with commit a7e2b46 Jun 12, 2024
28 checks passed
@zadjii-msft zadjii-msft deleted the dev/migrie/f/sxnui-tooltips-4 branch June 12, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants