Skip to content

[CmdPal] Animated notification#48176

Open
niels9001 wants to merge 2 commits into
mainfrom
niels9001/cmdpal-animated-notification
Open

[CmdPal] Animated notification#48176
niels9001 wants to merge 2 commits into
mainfrom
niels9001/cmdpal-animated-notification

Conversation

@niels9001
Copy link
Copy Markdown
Collaborator

@niels9001 niels9001 commented May 28, 2026

Summary of the Pull Request

Gives the CmdPal toast notification a glow-up: it now slides in/out with a nice fade, has acrylic + a soft shadow, and stops fighting with SizeToContent.

Along the way, the toast guts got refactored into a couple of reusable bits that live in PowerToys.Common.UI.Controls so other PowerToys utilities can grab them for their own transient overlays:

  • TransparentWindow — a WindowEx-derived host that strips the native frame, hides from taskbar/Alt-Tab, uses TransparentTintBackdrop for transparency, and runs show/hide implicit animations on its content. Supply your own animations via ShowAnimations / HideAnimations, or take the defaults (fade + slide).
  • TransparentCard — a templated ContentControl with acrylic (AlwaysActiveDesktopAcrylicBackdrop), rounded corners, border, and shadow. Drop whatever XAML you want inside.
  • AlwaysActiveDesktopAcrylicBackdrop — small SystemBackdrop wrapper so the acrylic doesn''t go grey when the window isn''t focused (transient overlays are never focused).

CmdPal''s ToastWindow is now basically a 16-line wrapper: derives from TransparentWindow, drops a bound TextBlock inside, and handles its own 2.5s auto-hide timer + bottom-center positioning.

cmdpal-toast.mp4

PR Checklist

Detailed Description of the Pull Request / Additional comments

A couple of design notes worth calling out:

  • The window is sized slightly bigger than the visible card (~24px breathing room on each side) so the shadow and slide animation have room to render without clipping. That buffer area is transparent but NOT click-through — kept it small on purpose. We explored SetWindowRgn and EnableWindow tricks to make it click-through too, but neither plays nicely with WinUI 3''s DesktopWindowXamlSource. Small transparent frame is the pragmatic compromise.
  • Animations use the Toolkit''s implicit ShowAnimations / HideAnimations so there''s zero animation code in ToastWindow.xaml.cs.
  • TransparentCard.xaml is registered in Themes/Generic.xaml — required for templated controls in a library project; <GenerateLibraryLayout> alone doesn''t auto-merge per-control xaml.

Validation Steps Performed

  • Built clean (arm64 Debug).
  • Triggered a CmdPal toast manually: fades + slides in, hangs for 2.5s, fades + slides out.
  • Acrylic stays active when the window isn''t focused (toasts are never focused).
  • Shadow renders fully without clipping.

Comment thread src/common/Common.UI.Controls/Window/TransparentWindow.cs Fixed
Comment thread src/common/Common.UI.Controls/Window/TransparentWindow.cs Fixed
Comment thread src/common/Common.UI.Controls/Window/TransparentWindow.cs Fixed
Comment thread src/common/Common.UI.Controls/Window/TransparentWindow.cs Fixed
Comment thread src/common/Common.UI.Controls/Window/TransparentWindow.cs Fixed
Comment thread src/common/Common.UI.Controls/Window/TransparentWindow.cs Fixed
Comment thread src/common/Common.UI.Controls/Window/TransparentWindow.cs Fixed
@github-actions

This comment has been minimized.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@michaeljolley michaeljolley added the Product-Command Palette Refers to the Command Palette utility label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CmdPal] Toast doesn't scale to fit content on the first time when CommandResult is KeepOpen

3 participants