Skip to content

feat(shell): complete Windows internal Alpha host lifecycle - #52

Merged
CN059 merged 5 commits into
devfrom
agent/windows-alpha-shell
Aug 29, 2026
Merged

CN059 merged 5 commits into
devfrom
agent/windows-alpha-shell

Conversation

@CN059

@CN059 CN059 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

范围

完成 Windows 11 x64 内部 Alpha 的宿主生命周期闭环:

  • 当前用户会话单实例,重复启动在宿主初始化前退出
  • Windows 托盘打开管理中心与显式退出
  • 管理窗口关闭到托盘,Widget 保持运行
  • Widget 与管理窗口分离任务栏、Alt+Tab 和原生窗口角色
  • 无边框 Widget 可靠拖动、缩放与鼠标捕获
  • Windows 活动显示器枚举及位置、尺寸、模式持久化恢复
  • 显式退出前保存布局,有界停止后台 worker,释放托盘、热键和数据库

验证

  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test -p floatile-platform --locked -j1:15 passed
  • cargo test -p floatile-shell --lib --locked -j1:55 passed
  • cargo test -p floatile-shell --bin floatile-shell --locked -j1:1 passed
  • cargo check -p floatile-sdk --target wasm32-wasip2 --locked
  • cargo deny --locked check advisories bans sources
  • Windows 11 x64 人工验证:单实例、托盘打开/退出、窗口角色、缩放、布局恢复、数据库释放和立即重启

已知限制

  • cargo test --workspace --all-targets --locked 在 Windows 会遇到仓库已有的 floatile_clock_wasm.dll 同名输出竞争;受影响测试已使用 -j1 串行通过
  • Windows 真实多显示器、混合 DPI 与热插拔尚未验证
  • Linux 与 macOS 运行时回归尚未人工验证
  • 许可门禁未完成,本 PR 不创建或授权公开分发产物

Refs: WA-HOST-01, WA-HOST-02, WA-HOST-03, WA-HOST-04, FR-LAYOUT-01, FR-DISPLAY-01

CN059 added 5 commits August 29, 2026 09:26
Acquire a session-scoped Windows mutex before shell initialization so repeated launches exit without creating windows, opening storage, or starting plugins. Keep the native handle and unsafe calls isolated in floatile-platform and document the Windows Alpha host requirements.

Refs: WA-HOST-01

Tests: cargo build -p floatile-shell --locked; cargo test -p floatile-platform --locked; cargo check --workspace --all-targets --locked; cargo clippy --workspace --all-targets --locked -- -D warnings; cargo test --workspace --all-targets --locked; Windows 11 x64 manual double-launch process count = 1 (user verified)

Unverified: Linux and macOS runtime behavior
Provide a Windows notification-area icon with open and explicit-exit actions while keeping native tray ownership in floatile-platform. The shell polls bounded non-blocking events on the Slint thread so closing the management window only hides it and tray exit retains the existing cleanup path.

Refs: WA-HOST-02

Tests: cargo fmt --all -- --check; cargo check --workspace --all-targets --locked; cargo clippy --workspace --all-targets --locked -- -D warnings; cargo test -p floatile-platform --locked (13 passed); cargo deny --locked check advisories bans sources; Windows 11 x64 manual tray open, hide/reopen, process retention, and explicit exit (user verified)

Unverified: Linux/macOS behavior; left-click tray activation; cargo deny --locked check licenses remains release-blocked by Slint and cross-target option-ext MPL-2.0 policy
Apply floating tool-window semantics only to Widgets so they stay out of the taskbar and Alt+Tab, while restoring the management center as a resizable native application window with system controls. Scope the shared winit attributes hook by the stable Widget title and keep Win32 style changes inside floatile-platform.

Refs: WA-HOST-03
Tests: cargo fmt --all -- --check; cargo check --workspace --all-targets --locked; cargo clippy --workspace --all-targets --locked -- -D warnings; cargo test -p floatile-platform --locked (14 passed); cargo build -p floatile-shell --locked; Windows 11 x64 manual taskbar/Alt+Tab separation, native minimize/maximize/resize, close-to-tray, and reopen (user verified)
Unverified: Linux and macOS runtime behavior
Save the final Widget layout before tray exit, release Windows host resources in an explicit order, and cap waits for background workers so one runtime cannot hold the process open indefinitely. Add Windows monitor enumeration and host-level pointer capture so resizable Widget geometry can be persisted and restored instead of being discarded when no monitor snapshot exists.

Refs: WA-HOST-04, FR-LAYOUT-01, FR-DISPLAY-01
Tests: cargo fmt --all -- --check; cargo check --workspace --all-targets --locked; cargo clippy --workspace --all-targets --locked -- -D warnings; cargo test -p floatile-platform --locked -j1 (15 passed); cargo test -p floatile-shell --lib --locked -j1 (55 passed); cargo test -p floatile-shell --bin floatile-shell --locked -j1 (1 passed); cargo check -p floatile-sdk --target wasm32-wasip2 --locked; cargo deny --locked check advisories bans sources; Windows 11 x64 manual resize, tray exit, process release, single-instance restart, and layout restore (user verified). cargo test --workspace --all-targets --locked was attempted but hit the pre-existing concurrent floatile_clock_wasm.dll output collision; affected tests passed serially.
Unverified: Windows physical multi-monitor, mixed-DPI, and hot-plug behavior; Linux and macOS runtime regression
Keep Windows-specific UI state and window-role imports behind cfg(windows) so Linux and macOS Clippy builds do not reject them as unused.

Refs: WA-HOST-03, WA-HOST-04

Tests: cargo fmt --all -- --check; cargo check --workspace --all-targets --locked; cargo clippy --workspace --all-targets --locked -- -D warnings; cargo test -p floatile-shell --bin floatile-shell --locked (1 passed)

Unverified: Linux and macOS runtime behavior; cargo test -p floatile-shell --lib --locked blocked by pre-existing Windows floatile_clock_wasm.dll output collision/lock
@CN059
CN059 merged commit 1236b83 into dev Aug 29, 2026
@CN059
CN059 deleted the agent/windows-alpha-shell branch August 29, 2026 03:52
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