Repository navigation
Feat: rework of codebase to enable InfiniFrameApplication - #422
Merged
Merged
Conversation
This change introduces a process-scoped InfiniFrameApplication registry for native windows and connects it to the Win32, GTK, and Cocoa window constructors/destructors. It also adds managed application abstractions for registering, building, running, and shutting down windows through a shared application model. The new API exposes IInfiniFrameApplication and InfiniFrameApplication in the managed layer, supporting named and unnamed window registration, lazy creation, lookup, and shutdown semantics while preserving the current per-window native loop behavior until a full app-level loop is introduced.
Introduce a native application lifecycle and managed integration: add NativeApplicationHandle (SafeHandle) and LibraryImport bindings for application ctor/register/run/shutdown/dtor (and GetWindowCount). Implement native exports to create/register/run/shutdown/destroy InfiniFrameApplication and track window counts. Add application lifecycle methods (Register/Run/Shutdown/NotifyWindowClosed) and thread-aware Windows message loop; ensure app quits when last window closes. Update Win32 window code to notify application and adjust show/track ordering. Managed InfiniFrameApplication now constructs/ registers native app, runs native loop, and shuts down/ disposes native handle. Also warm WebView2 CDP connection in tests setup.
This introduces application-owned web server registration and shutdown hooks, centralizes window builder registration, and updates the native Windows app to reuse process-wide notification and AppUserModelId settings. It also updates examples/tests to the new builder pattern and adds safeguards for desktop startup collisions under parallel test execution.
Introduces application-centric initialization for web server and Blazor WebView scenarios via InfiniFrameApplication.Initialize().WithWebServer/WithBlazorWebView. The app now defers startup until Run/RunAsync, tracks startup and shutdown actions, supports late web app configuration, and updates examples and tests to use the new lifecycle.
…tifications This commit integrates application-first window and lifecycle management, centralizes notification initialization, overhauls native app loops, and refactors examples to use modern patterns. Includes API additions for shutdown, window creation/destruction events, and refined cross-platform behavior.
Introduce InfiniFrameApplicationBuilder and application-first integration APIs (UseBlazorWebView, UseWebServer, WithWindow). Add InfiniFrameBlazorWebViewConfiguration, InfiniFrameWebServerConfiguration and ApplicationConfiguration record. Move Blazor/WebServer wiring into builder/configuration objects, attach service provider lifecycle, register window conventions, and support single-file file providers. Remove legacy InfiniFrameBlazorApp/Builders and many old WebServer builder types. Update examples, tests, and README to use the new CreateBuilder()/Use...() pattern and adjust SingleFile API. Ensure proper service-provider disposal and improved startup/shutdown integration.
- Updated `BlazorPlaywrightContextBase` to implement explicit timeout handling for Blazor app startup and CDP endpoint probing, with custom `TimeoutException` messages. - Ensured proper disposal of resources and adjusted exception paths for cancellation scenarios. - Refactored `InfiniFrameApplication` window lifecycle to invoke `WindowCreated` event post-construction. - Improved service provider lifecycle management in `InfiniFrameApplicationBuilder`. - Moved `IInfiniFrameWindow` registration to support delayed window resolution.
… processing across WebView and Blazor scenarios.
This change adds standard import/code section divider comments to the BlazorWebView extension file for readability and consistency. No functional behavior was changed.
- Introduced `TakeWindowConfiguration` in `InfiniFrameApplicationBuilder` to support unnamed window handling in integrations. - Ensured window validation with `IValidator<InfiniFrameNativeParameters>` happens before resolution in `InfiniFrameWindowBuilder`. - Updated BlazorWebView integration to apply unnamed window configurations correctly. - Added related tests to verify validation and unnamed window handling functionality.
…or improved platform consistency.
…an up legacy code for modularity.
…for better organization. Update CMakeLists.txt accordingly.
…ndow, Security, StaticAssets, Interop) and update dependencies across tests and workflows.
…es to `InfiniFrame.Js` and `InfiniFrame.Window` modules. Update references across projects, tests, and workflows accordingly.
…nd `Window` submodules. Update imports across the solution to reflect the changes.
…Parameters` with unit tests.
…for multi-window support, and streamline dependency handling across tests.
Ensure the application detaches all window references before native teardown, preventing dangling pointers while deferred platform cleanup is still running. This change also adds a regression test that exercises repeated shutdown/dispose cycles with multiple windows.
Add a Linux-only native test export to exercise repeated GTK UI thread init/shutdown cycles and include the GTK header on Linux. Replace raw gtkThread pointer with std::unique_ptr<std::thread> and reset it on detach/shutdown to avoid leaks and static-destruction ordering issues. Use std::call_once to register std::atexit exactly once across cycles. Ensure proper reset/join semantics so re-initialization after shutdown succeeds and process exit via atexit is safe.
…and WebServer lifecycle coverage
Keep macOS window registration and construction on the calling main thread, then run the blocking native AppKit loop asynchronously in a dedicated background thread. This preserves AppKit's main-thread requirements while allowing the managed caller to continue and request shutdown without blocking the UI setup path.
…bleTo` declarations.
…`MacOsTestingPlatform` and improving run loop handling. Add `Microsoft.Testing.Platform` dependency and update project settings.
…arations, restructure test files, and improve platform-specific test targeting.
…bServerConfiguration`, and simplify URI resolution logic.
… update test application disposal, and resolve missing project references in solution filters.
…gn `package-lock.json` consistency with dependency upgrades.
…st versions; synchronize `package-lock.json` with upgrades.
…age-lock.json changes.
…der, correct terminology, and streamline test assertions.
…ic, and improve configuration handling.
…ic using `GetEntryAssembly` fallback.
…ly]`, simplify method placement, and improve inline documentation.
…s with `Object.defineProperty` for better configurability and reliability.
…owClosed` handler and refine macOS testing teardown: ensure `pipefail`, log handling, and graceful exit on runtime aborts.
…m-specific build configurations
Scarlet-Bytes
force-pushed
the
InfiniFrameApplication
branch
2 times, most recently
from
September 24, 2026 08:54
d8d74c6 to
804040a
Compare
Contributor
📊 Code Coverage Report
C# Project Breakdown
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.