fix(shell): render placeholder window for unknown island ids instead of silent URL rewrite #122
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_os!122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_show_unknown_island_placeholder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a URL referenced an island id not in the runtime registry (e.g. a feature-gated island not compiled in this build), both the first-load URL effect and the popstate listener silently dropped it from the windows list. The window→URL sync effect then rewrote the address bar to match the (now-missing) window — producing the silent rewrite the issue reports. Users (and agents) following a stale or wrong URL got the impression nothing happened.
This change pushes a
WindowStatefor the unknown id verbatim, so the URL stays put. The existingIslandContentfallback arm now renders an explicitIsland "<id>" not installedplaceholder (replacing the previousDynamicIslandLoadercall, which produced a misleading "Failed to load island: …" after a delay).Related Issue
Closes #109
Changes
crates/hero_os_app/src/main.rs— both the first-load loop and the popstate loop now push a placeholderWindowState(id verbatim, title = id, default 600x400) whenreg.get(app_id)isNone. Thetracing::warn!is preserved alongside the new visual.crates/hero_os_app/src/island_content.rs— theweb-platformotherarm now renders a staticisland-placeholderdiv withIsland "<id>" not installedplus a clarifying detail line. Thenot(web-platform)arm copy is updated to match for consistency.crates/hero_os_app/src/dynamic_loader.rs— module-level#![allow(dead_code)]sinceDynamicIslandLoaderis no longer wired into any caller. Module preserved per the spec for future runtime island distribution.crates/hero_os_app/src/routing.rs— two new pure-parser tests pin the contract thatparse_urlis registry-agnostic and keeps unknown ids inroute.apps.Test Results
cargo check -p hero_os_app— clean.make check(full workspace) — clean, 25.18s.cargo test -p hero_os_app— 42 passed, 0 failed (includes the two new parser tests)./space/default/nonexistent_island_xyz→ URL preserved verbatim, window opened with titlenonexistent_island_xyz, body rendersIsland "nonexistent_island_xyz" not installedfollowed byThis island is not part of the current Hero OS build.Note on the issue's original repro id
The issue body uses
roomas the unknown-id example. Between the issue being filed and this fix,room(Conference) is now compiled in by default ondevelopmenthead, so it's no longer a useful repro id. The fix was verified withnonexistent_island_xyzinstead — the underlying behaviour is identical for any id not in the runtime registry.Caveats
localStoragefor the unknown-id placeholder window. If the user closes that window, normal close handling cleans it up. If they refresh while it's open, it's restored from localStorage — desirable, since the URL still references it.dynamic_loader.rsis now dead at the crate level. Left in place per the spec; can be removed in a follow-up if/when the team decides to drop the runtime-load story entirely.The first-load and popstate effects in main.rs both used to silently drop unknown island ids: `if let Some(meta) = reg.get(app_id) { push } else { warn }`. Combined with the window->URL sync effect (which rewrites the URL to match the actual windows list), navigating to an unknown id silently rewrote the URL back to the previously open island. The user got the impression nothing happened. Push a `WindowState` for the unknown id verbatim so: - the URL stays at what the user typed, - the IslandContent `_` arm can render a "not installed" placeholder. Replace the `web-platform` `other` arm in island_content.rs (which previously delegated to DynamicIslandLoader and produced a misleading "Failed to load" after a delay) with an explicit `Island "<id>" not installed` placeholder div. Mark dynamic_loader.rs `dead_code` since nothing wires it in any more — kept around per the spec for future runtime island distribution. Add two pure-parser tests pinning the contract that `parse_url` is registry-agnostic and keeps unknown ids in `route.apps`. #109