Skip to content

feat(avalonia): P4 feedback components - #11

Merged
Shewart merged 4 commits into
mainfrom
feat/avalonia-p4-feedback
Oct 9, 2026
Merged

Shewart merged 4 commits into
mainfrom
feat/avalonia-p4-feedback

Conversation

@Shewart

@Shewart Shewart commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Ports the P4 tier to Avalonia: spinner, tooltip, toast, alert-dialog and hover-card.

Changes

  • Spinner: Sm / Default / Lg, any token, spins only while on screen
  • Tooltip: hover with a delay, also on keyboard focus; Placement uses Avalonia's PlacementMode (Top, Bottom, Left, Right) and keeps its 6px gap when flipped
  • Toast: Toast.Show / Success / Error / Warning / Info / Dismiss; the stack lives in the window's overlay layer above dialogs, pauses on hover, has an optional action button and a close button on hover; <ui:Toaster Position MaxVisible> is optional
  • AlertDialog: ShowAsync() returns the choice, Confirmed / Cancelled events, backdrop doesn't dismiss, Escape = Cancel, focus trapped with Cancel focused first; extra XAML children go between the description and the buttons
  • HoverCard (+ trigger and content): opens on mouse hover; touch, pen and Enter / Space toggle it. A card opened by hover has no light dismiss (Avalonia's window-wide dismiss layer took the pointer off the trigger and made it flicker); one opened by a tap closes on a tap outside, and that click still reaches its target
  • ShellFloatingHost.ClaimsChild: lets a host place XAML children itself (used by AlertDialog)
  • ShellLabel wraps by default like MAUI's Label (TextWrapping="NoWrap" for one line)
  • Demo: "Feedback" section
  • Docs: COMPONENTS.md Avalonia section and differences table, plan updated

Verification

  • Solution and Avalonia demo build 0 warnings / 0 errors; 793 tests pass; dotnet format check clean
  • Each P4 component, plus label and dialog, installed alone into a fresh dotnet new avalonia.app builds 0/0 with no MAUI code
  • Demo checked in light and dark: spinners, stacked toasts above the dialog backdrop that dismiss themselves, tooltip placement and gap, hover card text wraps, alert dialog focuses Cancel
  • Hover card and tooltips checked with a real mouse: stable while hovered, close after leaving

Shewatipa Tseisi added 4 commits October 9, 2026 15:50
TextBlock defaults to one line, which cut off labels in fixed-width panels such as a hover card. TextWrapping="NoWrap" keeps the old behavior.
Spinner, tooltip, toast, alert-dialog and hover-card with its parts. Toasts live in the window's overlay layer, so Toast.Show works from anywhere. AlertDialog builds on the overlay host, so it gets the focus trap; ShellFloatingHost.ClaimsChild lets it place extra XAML children in its body. Tooltips also show on keyboard focus.
Light dismiss put a window-wide layer under the card, which took the pointer off the trigger: the card closed, the layer went away, the trigger was hovered again and the card reopened. A card opened by hover has no light dismiss now; one opened by touch, pen or the keyboard still closes on a tap outside.
@github-actions github-actions Bot added documentation Improvements or additions to documentation templates examples labels Oct 9, 2026
@Shewart
Shewart merged commit d1c86e8 into main Oct 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation examples templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant