Wire up URL routing so browser URLs open apps #30
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#30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
routing.rscontains a full URL routing implementation (/space/:context/:appsformat) with parsing, building, and History API integration — but it is never imported or used. The module is dead code.This means:
/hero_os_ui/space/geomind/contactsloads the app but ignores the URL — it shows whatever was in localStorage instead of opening the contacts appRoot Cause
main.rsnever declaresmod routing;— the module is orphaned.Expected Behavior
/hero_os_ui/space/geomind/contactsshould open the contacts app in the geomind context/hero_os_ui/space/work/contacts+filesystemshould open both apps?contacts.id=abcshould be passed to islandsImplementation Plan
mod routing;tomain.rsuse_effectthat syncs window state → URL bar viareplace_url()popstateevent listener for browser back/forwardSecondary Issue
livekit.jsinDioxus.tomluses absolute path/livekit.jswhich 404s because base_path ishero_os_ui. Should reference it correctly.Implemented in commit eed6f4ebade687bdeef148d92296169f09be271c on the
developmentbranch.Changes
main.rs: Addedmod routing;, URL-based initial context, URL-to-windows restoration on mount,replace_urlsync effect,popstatelistener for back/forwardcontroller.rs: Addedpush_url_state()helper, called fromopen_window()andclose_window()for discrete history entriesCargo.toml: AddedHistoryandPopStateEventweb-sys featuresDioxus.toml: Fixedlivekit.jspath from/livekit.jsto/hero_os_ui/livekit.jsHow it works
/hero_os_ui/space/geomind/hero_os_ui/space/geomind/contacts/hero_os_ui/space/work/contacts+filesystemAll 9 routing unit tests pass. WASM build succeeds.
Pushed to
development: 25b1662176a35496dd6ec288f43712327a43a731 (rebased on latest remote).Consolidated #21 (Hero OS URLs working) into this issue. The original vision from #21 — shareable URLs, per-app deep linking, context+app params in URL, archipelago integration — is all captured in the implementation plan above.
Next steps: verify current routing implementation works end-to-end, then use hero_browser_mcp for automated route testing.
Routing Verification Report
Verified the URL routing implementation on branch
development(commitee2cfe6).Implementation Status
All 5 items from the implementation plan are complete:
mod routing;in main.rshero_os_app/src/main.rs:27(web-platform gated)main.rs:180-186(initial_context) +main.rs:703-743(window restoration)use_effectsyncs window state → URL viareplace_url()main.rs:792-811popstatelistener for browser back/forwardmain.rs:813-877Unit Tests
All 9 routing unit tests pass (
cargo test -p hero_os_app routing):test_parse_context_only—/space/defaulttest_parse_single_app—/space/default/contactstest_parse_multiple_apps—/space/default/contacts+filesystemtest_parse_with_proxy_prefix—/hero_os_ui/space/workspace-1/contactstest_parse_query_params—?contacts.id=abc123&contacts.view=detailtest_parse_root_returns_nonetest_parse_no_space_prefix_returns_nonetest_build_url_context_onlytest_build_url_with_appsSecondary Issue
livekit.jspath fixed from/livekit.jsto/hero_os_ui/livekit.jsinDioxus.toml✓Architecture Summary
push_url()for discrete user actions (creates history entries) vsreplace_url()for reactive sync (no history spam)/hero_os_uiprefix behind hero_proxyweb-platformfeatureparse_url()is testable without browser globalsNext Step
Browser-level E2E route verification via hero_browser_mcp (#31).
Browser-level E2E route tests now available on
development_30branch viamake test-routes— see #31 for details.Routing implementation is verified complete. This issue can be closed once the browser tests have been run successfully against a live instance.
E2E Browser Verification Complete
All URL routing verified via hero_browser_mcp against live hero_os_ui:
/hero_os_ui/— loads, correct title/hero_os_ui/space/geomind— URL preserved in browser bar/hero_os_ui/space/geomind/contacts— URL preserved with app name/hero_os_ui/space/geomind/contacts+filesystem— both app names in URL/hero_os_ui/space/geomind/contacts?contacts.id=test123— query params preserved/hero_os_ui/space/work/filesystem— different context works/space/nonexistent/bogus): no crash, no JS exceptions16 passed, 0 failed. Routing implementation is solid.