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

Remove the animations from the suggestions UI #17247

Merged
merged 5 commits into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/cascadia/TerminalApp/SuggestionsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
xmlns:model="using:Microsoft.Terminal.Settings.Model"
xmlns:mtu="using:Microsoft.Terminal.UI"
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
MinWidth="256"
Copy link
Member

Choose a reason for hiding this comment

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

Does it need to be this much, or can we let the width get adjusted dynamically as a percentage of the page width? Do we need a MaxWidth?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, that was an unrelated nit that snuck in accidentally. IMO this makes it feel a lot smoother, since the width doesn't snap back and forth. The placeholder text makes the menu open at like, 252px or something, but then filtering the menu usually immediately makes it quite a bit narrower. This keeps the width a bit more consistent

AllowFocusOnInteraction="True"
AutomationProperties.Name="{x:Bind ControlName, Mode=OneWay}"
IsTabStop="True"
Expand Down Expand Up @@ -99,6 +100,24 @@
GeneralItemTemplate="{StaticResource GeneralItemTemplate}"
NestedItemTemplate="{StaticResource NestedItemTemplate}" />

<!--
Remove all item animations from the suggestions UI. They're
entirely too slow to let that UI be usable.
-->
<Style x:Key="NoAnimationsPlease"
TargetType="ListView">
<Setter Property="ItemContainerTransitions">
<Setter.Value>
<TransitionCollection>
<!-- (deleted transitions are left for reference for what we removed) -->
<ContentThemeTransition />
<!--<AddDeleteThemeTransition/>-->
<!--<ReorderThemeTransition/>-->
<!--<EntranceThemeTransition IsStaggeringEnabled="False"/>-->
</TransitionCollection>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>

Expand Down Expand Up @@ -203,7 +222,8 @@
ItemClick="_listItemClicked"
ItemsSource="{x:Bind FilteredActions}"
SelectionChanged="_listItemSelectionChanged"
SelectionMode="Single" />
SelectionMode="Single"
Style="{StaticResource NoAnimationsPlease}" />

</Grid>

Expand Down
Loading