Skip to content

Add self-registering Blazor app framework (HackerOS Ecosystem)#77

Draft
werddomain with Copilot wants to merge 4 commits into
mainfrom
copilot/create-developer-ecosystem-framework
Draft

Add self-registering Blazor app framework (HackerOS Ecosystem)#77
werddomain with Copilot wants to merge 4 commits into
mainfrom
copilot/create-developer-ecosystem-framework

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Turns the project into a framework for building a developer ecosystem: a developer writes a Blazor component that inherits a window or terminal base class, drops it into the project, and it self-registers into the app list, START menu, and taskbar — no manual wiring. All apps are covered by Playwright tests, and assets are strictly module-scoped (no inline JS/CSS).

Built on the two clean libraries (BlazorWindowManager, BlazorTerminal) rather than the legacy HackerOs monolith, under wasm2/HackerOs/Ecosystem/.

Framework — HackerOs.AppFramework (RCL)

  • Self-registration: [App] attribute + AppRegistry discover decorated components by reflection and launch them through WindowManagerService. The attribute is the only extension point.
  • Base classes: WindowAppBase and TerminalAppBase — new apps are created by inheritance; TerminalHost provides an interactive console (echo, line editing, command submit).
  • Shell: Desktop composes desktop area + taskbar + AppLauncher (START menu grouped by category).
  • DI: AddHackerOsAppFramework(params Assembly[]) wires services and the populated registry.

Host — HackerOs.Ecosystem (WASM)

  • Renders a single <Desktop> and ships three sample modules: Welcome (window), System Monitor (window; polls a collocated .razor.js sampler), Hacker Shell (pure-C# terminal that lists/launches other apps). Each keeps markup/CSS/JS in collocated scoped files.

BlazorWindowManager fixes (required for external apps)

  • WindowRenderComponent now resolves window component types across all loaded assemblies; previously only types inside the window-manager assembly rendered, so consumer-defined windows fell back to an empty WindowBase.
  • Taskbar minimize/maximize/restore now route through the window component instance so CurrentState updates and the window actually hides/shows (previously only WindowInfo.State changed).

Tests

  • Playwright suite (tests/, 13 specs) covering self-registration, per-app rendering/behavior, terminal command execution, and taskbar minimize/restore/multi-window.

Adding an app is just:

@inherits WindowAppBase
@attribute [App("My App", Id = "vendor.myapp", Icon = "\U0001F680", Category = "Development")]

<WindowContent Window="this">
    <div class="my-app">Hello from a self-registered window!</div>
</WindowContent>

Docs: wasm2/HackerOs/Ecosystem/docs/app-framework.md.

Note

CodeQL validation timed out in the environment and did not return results; worth a re-run during review.

…prove window drag performance

- Added CSS styles for grouped-window popups in the taskbar to allow users to select between multiple instances of the same application.
- Optimized window dragging by caching container bounds during drag operations to reduce unnecessary JS interop calls.
- Implemented throttling for drag and resize events to improve performance and reduce UI flickering.
- Updated window control buttons to prevent event propagation for better interaction handling.
- Enhanced keyboard navigation to recognize custom typing contexts, such as terminal emulators.
- Improved terminal focus handling to ensure it remains active during animations.
- Refactored OnAfterRenderAsync in SystemMonitorApp and WelcomeApp to ensure proper JS module loading and avoid breaking window functionality.
- Updated solution file to reflect changes in Visual Studio version and added new projects for Ecosystem components.
- Cleaned up unnecessary code in WindowStateTest.
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.

2 participants