WindowRoute signals created in Window scope, read from root — freezes UI #81

Closed
opened 2026-04-20 10:07:53 +00:00 by zaelgohary · 0 comments
Member

WindowRouteContext::new() at core/src/window_route.rs:88-92 allocates five Signal::new(...) values inside whatever scope constructs it. The constructor is called from each Window component, but hero_os_app/src/main.rs:929 reads ctx.route from the root scope's URL-sync use_effect.

Dioxus 0.7 owns signals by the scope they're created in. Ancestor-reading-descendant triggers the "Copy Value used in scope that is not a descendant of the owning scope" warning, which spams the console on every render cycle. With 6+ windows open (after a restored desktop state) the warning loop is severe enough to lock up the UI — clicking Calendar tips it over into a total freeze.

Repro

  1. Open the app with any restored desktop state that includes multiple islands.
  2. Observe the console: one dioxus-signals warnings.rs:26 warning per window, cycling through ScopeIds 14/7/31/22/37/42 indefinitely.
  3. Click Calendar in the dock — UI freezes.

Fix

Create the signals in a scope that outlives the Windows. Minimal: swap Signal::new(...) for Signal::new_in_scope(..., ScopeId::ROOT) in WindowRouteContext::new(), or lift context construction up so root owns it and passes each WindowRouteContext down as a prop.

Why now

Latent regression from #35 (Unify window chrome). Before that refactor there was no cross-scope signal read.

`WindowRouteContext::new()` at `core/src/window_route.rs:88-92` allocates five `Signal::new(...)` values inside whatever scope constructs it. The constructor is called from each `Window` component, but `hero_os_app/src/main.rs:929` reads `ctx.route` from the root scope's URL-sync `use_effect`. Dioxus 0.7 owns signals by the scope they're created in. Ancestor-reading-descendant triggers the "Copy Value used in scope that is not a descendant of the owning scope" warning, which spams the console on every render cycle. With 6+ windows open (after a restored desktop state) the warning loop is severe enough to lock up the UI — clicking Calendar tips it over into a total freeze. ## Repro 1. Open the app with any restored desktop state that includes multiple islands. 2. Observe the console: one `dioxus-signals warnings.rs:26` warning per window, cycling through ScopeIds 14/7/31/22/37/42 indefinitely. 3. Click Calendar in the dock — UI freezes. ## Fix Create the signals in a scope that outlives the Windows. Minimal: swap `Signal::new(...)` for `Signal::new_in_scope(..., ScopeId::ROOT)` in `WindowRouteContext::new()`, or lift context construction up so root owns it and passes each `WindowRouteContext` down as a prop. ## Why now Latent regression from #35 (Unify window chrome). Before that refactor there was no cross-scope signal read.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_archipelagos#81
No description provided.