Skip to content

Feat: rework of codebase to enable InfiniFrameApplication - #422

Merged
Scarlet-Bytes merged 91 commits into
corefrom
InfiniFrameApplication
Sep 24, 2026
Merged

Scarlet-Bytes merged 91 commits into
corefrom
InfiniFrameApplication

Conversation

@Scarlet-Bytes

Copy link
Copy Markdown
Member

No description provided.

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.
@Scarlet-Bytes Scarlet-Bytes self-assigned this Sep 7, 2026
- 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.
…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.
…for multi-window support, and streamline dependency handling across tests.
Scarlet-Bytes and others added 25 commits September 19, 2026 15:36
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.
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.
…`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.
…der, correct terminology, and streamline test assertions.
…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.
@Scarlet-Bytes
Scarlet-Bytes force-pushed the InfiniFrameApplication branch 2 times, most recently from d8d74c6 to 804040a Compare September 24, 2026 08:54
@github-actions

Copy link
Copy Markdown
Contributor

📊 Code Coverage Report

Language Coverage Delta Trend
TypeScript 94.1% 0.0% ➡️ unchanged
C# 71.9% 0.0% ➡️ unchanged
Python 87.2% 0.0% ➡️ unchanged

C# Project Breakdown

Project Coverage Lines Covered
InfiniFrame.Security 100.0% 500 500
InfiniFrame.Blazor 92.8% 460 427
InfiniFrame.Shared 90.5% 5456 4940
InfiniFrame.Js 86.4% 1440 1244
InfiniFrame.WebServer 85.9% 368 316
InfiniFrame.StaticAssets 77.2% 508 392
InfiniFrame.Application 72.6% 1912 1389
InfiniFrame.Window 70.1% 25516 17877
InfiniFrame.NativeBridge 64.5% 10484 6758
InfiniFrame.BlazorWebView 63.7% 3472 2212
InfiniFrame.SingleFile 60.7% 364 221

@Scarlet-Bytes
Scarlet-Bytes merged commit 3d6fdf4 into core Sep 24, 2026
81 checks passed
@Scarlet-Bytes
Scarlet-Bytes deleted the InfiniFrameApplication branch September 24, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant