Skip to content

feat(avalonia): P1 overlays : dialog, drawer, sheet, dropdown, popover - #8

Merged
Shewart merged 4 commits into
mainfrom
feat/avalonia-p1-overlays
Oct 8, 2026
Merged

Shewart merged 4 commits into
mainfrom
feat/avalonia-p1-overlays

Conversation

@Shewart

@Shewart Shewart commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Second Avalonia slice of Phase 2: the P1 overlays, completing the Phase 2 component target (P0 + P1).

shell

  • ShellTriggerView (a ShellUI Button inside activates the trigger), ShellPopoverHost (trigger + floating panel), ShellOverlayHost (modal content), ShellDismiss (Escape closes the overlay on top), ShellPopups (one menu open at a time), ShellMotion (open/close transitions)
  • Content is shown in an Avalonia Popup in the window's overlay layer, so it stays in the logical tree: theme, DataContext and FindParentOfType work as declared; dropdown/popover get Avalonia's placement, flip and click-outside dismissal
  • element-extensions gets an Avalonia version; Button activates an enclosing trigger

Components

  • dialog (+ trigger, content, header, footer, title, description, close), drawer and sheet (+ trigger, content, Side), dropdown (+ trigger, content, item), popover (+ trigger, content), with the MAUI names, properties and animations
  • Slide-in offsets use the invariant culture (some cultures write the minus sign as U+2212, which TransformOperations.Parse rejects)

Verification

  • dotnet build ShellUI.Native.slnx: 0 warnings; tests 673/673; each commit builds the Avalonia demo and passes the tests
  • Every P1 entry installs alone into a fresh dotnet new avalonia.app and builds with 0 warnings; all Avalonia components together in one app build
  • Demo: each overlay opens from its trigger button; dropdown and popover flip above a trigger at the bottom; Escape closes the dialog; picking an item fires Clicked and closes the menu; DialogClose closes the dialog; light and dark
  • Not verified: real pointer/keyboard input (driven from code), Linux

Known gaps

  • No focus trap in an open dialog (Tab can reach controls behind it)
  • A flipped dropdown/popover sits flush with the trigger (Avalonia doesn't mirror the 4px offset)

Shewatipa Tseisi added 4 commits October 8, 2026 08:50
The base layer for the P1 overlays, matching the MAUI shell's API: ShellTriggerView (a ShellUI Button inside handles its click and activates the trigger), ShellPopoverHost for trigger + floating panel, ShellOverlayHost for modal content, ShellDismiss (Escape closes the overlay on top), ShellPopups (one menu open at a time) and ShellMotion for the open/close transitions.

Both hosts put their content in an Avalonia Popup drawn in the window's overlay layer instead of moving it into a page layer as MAUI does: the content stays in the logical tree, so it inherits the theme and DataContext, and parts find their component with FindParentOfType (element-extensions, now with an Avalonia version). The popover host gets Avalonia's placement, flipping and click-outside dismissal; the dismissing click is swallowed so it can't reopen the menu.
dialog, drawer, sheet, dropdown and popover with their triggers and parts, with the MAUI names, properties, sides and animations. Content parts collect their XAML children in Items. Slide-in offsets are formatted with the invariant culture, since some cultures write the minus sign as U+2212 and TransformOperations.Parse rejects it.

TemplateContentTests no longer requires 'using Avalonia' in an Avalonia template (Dialog and the triggers need none); it checks for MAUI types instead.

Checked: every P1 entry installs alone into a fresh 'dotnet new avalonia.app' and builds with 0 warnings; all components together in one app build; in the demo each overlay opens from its trigger button, dropdown and popover flip above a trigger at the bottom, Escape closes the dialog, picking an item fires Clicked and closes the menu, DialogClose closes the dialog, light and dark.
The header said 'Setting up your MAUI project' before the platform was detected, so Avalonia projects (and folders with no project) got the MAUI wording. It now says 'Setting up your project'; the line after it names the detected platform.
@github-actions github-actions Bot added documentation Improvements or additions to documentation cli templates examples labels Oct 8, 2026
@Shewart
Shewart merged commit be36099 into main Oct 8, 2026
7 checks passed
@Shewart
Shewart deleted the feat/avalonia-p1-overlays branch October 8, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli documentation Improvements or additions to documentation examples templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant