On a phone the Back button left the page under an open menu, sheet or dialog. An open overlay now says so (new IDOverlayHost, cascaded by MainLayout; OverlayService keeps them newest last): DModal and DDropdown through the cascade, so the D components stay free of app services, and the nav menu, PhoneSheet and the full-screen globe through the service. MainLayout's location-changing handler lets Back close the newest overlay instead of leaving the page; a link followed or the app's own navigation (signing out after its question, say) closes them all and goes on. Blazor can't tell Back from the app's navigation, so a capture-phase popstate listener in main.js marks Back (AppStatusService.TookBack). No history entries are pushed. Phone flow: Back closes the menu, a card's More sheet, the composer and the full-screen globe one after another without leaving the feed, and with nothing open goes back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
12 lines
488 B
C#
12 lines
488 B
C#
namespace decePubClient.Components.Daisy;
|
|
|
|
/// <summary>
|
|
/// Where an open overlay (a dialog, a menu, a sheet) says it is open, so that the phone's Back button closes it instead
|
|
/// of leaving the page: Open registers how to close it and returns what ends the registration once it is closed. The
|
|
/// app cascades one (OverlayService, from MainLayout); a component without one simply doesn't register.
|
|
/// </summary>
|
|
public interface IDOverlayHost
|
|
{
|
|
IDisposable Open(Func<Task> close);
|
|
}
|