5.1 KiB
5.1 KiB
Bevy Window Management Verification (Windows-First)
Date: 2026-02-13
Purpose
This document defines a logical verification workflow for sprimo-app window management.
It combines code-path assertions with lightweight runtime validation.
Primary focus:
- window visibility behavior
- always-on-top behavior
- position and scale handling
- recovery hotkey behavior
- snapshot/config consistency
Scope
In scope:
crates/sprimo-app/src/main.rscrates/sprimo-platform/src/lib.rs- window-related runtime-core integration path in
sprimo-app - API commands:
SetTransform,SetFlags
Out of scope:
- tray/menu behavior
- tauri frontend window behavior
- long soak/performance testing
Requirements Traceability
| Requirement | Intent | Code path(s) |
|---|---|---|
| FR-FW-1 | Borderless/transparent overlay | crates/sprimo-app/src/main.rs window setup (decorations=false, clear color/transparent mode) |
| FR-FW-2 | Always-on-top toggle | crates/sprimo-app/src/main.rs (SetFlags.always_on_top), crates/sprimo-platform/src/lib.rs (set_always_on_top) |
| FR-FW-3 | Recovery to visible/interactive | crates/sprimo-app/src/main.rs (poll_hotkey_recovery) |
| FR-FW-4 | Positioning persistence + move | crates/sprimo-app/src/main.rs (SetTransform x/y, startup position), runtime-core config persistence |
| FR-FW-5 | Position handling under monitor/DPI context | logical verification of position updates via platform adapter + snapshot/config |
Code-Path Logical Checklist
- Startup invariants:
- window is undecorated and non-resizable
- startup position uses persisted
window.x/window.y - startup top-most intent is configured
- Handle-attach invariants:
attach_window_handle_onceapplies at most once- on Windows, native handle attach occurs before platform calls
- initial snapshot values are applied to platform (
always_on_top,visible,position)
- Command invariants:
SetTransform.scaleupdates sprite scale and window size (window_size_for_pack)SetTransform.x/yupdates logical position state and issues platform moveSetFlags.always_on_toptriggers platform top-most callSetFlags.visibletriggers platform visibility call and BevyVisibility
- Recovery invariants:
- hotkey path enforces
visible=trueandalways_on_top=true - recovery updates logical state via runtime-core command path
- Persistence/snapshot invariants:
- window fields (
x,y,scale,flags) roundtrip through runtime-core /v1/statestays consistent with command outcomes
- Degradation invariants (non-Windows):
- no-op adapter does not crash on window commands
- capability semantics remain conservative
Lightweight Runtime Checklist (Windows)
Preconditions:
- run
sprimo-app - resolve token/port from
%APPDATA%/sprimo/config/config.toml
Scenario 1: Baseline
GET /v1/healthGET /v1/statewith bearer token- Record
x,y,scale,flags.visible,flags.always_on_top
Expected:
- health endpoint alive
- state endpoint authorized
- window fields present and coherent
Scenario 2: Position Command
- Send
SetTransformwithxandy. - Re-check
/v1/state.
Expected:
x/yupdate in snapshot- window visibly moves
Scenario 3: Scale Command
- Send
SetTransformwithscale. - Re-check
/v1/state.
Expected:
scaleupdates- window dimensions update according to frame size + padding
Scenario 4: Visibility Toggle
- Send
SetFlags { visible: false }. - Send
SetFlags { visible: true }. - Re-check
/v1/state.
Expected:
- visible flag transitions correctly
- window hides/shows without crash
Scenario 5: Always-On-Top Toggle
- Send
SetFlags { always_on_top: false }. - Send
SetFlags { always_on_top: true }. - Re-check
/v1/state.
Expected:
- top-most flag transitions correctly
- OS behavior matches expected z-order changes
Scenario 6: Recovery Hotkey
- Move to non-ideal state (hidden and/or not top-most).
- Trigger configured recovery hotkey (default
Ctrl+Alt+P). - Re-check
/v1/state.
Expected:
- forces
visible=true - forces
always_on_top=true
Scenario 7: Restart Persistence
- Restart
sprimo-app. - Re-check
/v1/state.
Expected:
x,y,scale,always_on_top,visiblepersist
Suggested Command Set
cargo check -p sprimo-app
cargo check -p sprimo-platform
cargo check -p sprimo-runtime-core
cargo test -p sprimo-app
cargo test -p sprimo-runtime-core
just qa-validate
Optional runtime stress after directed checks:
just random-backend-test
Pass / Fail Criteria
Pass:
- all logical assertions hold
- runtime scenarios behave as expected
/v1/stateremains consistent with visible behavior- no crashes/panics in window-command paths
Fail:
- mismatch between command outcome and snapshot
- recovery hotkey fails to restore visible top-most state
- restart persistence for window fields fails
- any crash in window-management flow
Evidence Expectations
For issue-driven verification, attach:
- command summary
- before/after screenshots
/v1/statesnapshots before and after key transitions- lifecycle updates in
issues/issueN.mdperdocs/QA_WORKFLOW.md