Migrate Dioxus admin UI to the spec-driven, multidomain contract #161
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_aibroker#161
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?
Area:
crates/hero_aibroker_app(Dioxus WASM admin UI)Type: Refactor / migration
Depends on: server oschema + multidomain migration (separate PR, server side)
Owner (this ticket): Dioxus / frontend
Background
The repo-wide Hero server migration has two coupled parts:
JSON-RPC dispatchers with the
openrpc_server!macro (server side, separate owner).rpc.sockcarrying every domain as path segments:/api/{domain}/rpc— per-domain JSON-RPC/api/{domain}/openrpc.json— per-domain spec/api/domains.json— discovery endpointReference skills:
skills/blueprint/migration/hero_server_migration.mdskills/blueprint/oschema/oschema_best_practices.mdskills/blueprint/server/hero_server_implemenation.mdskills/web/hero_admin_ui.md← target architecture for this ticketskills/web/dioxus_bootstrap.md(Forge:
https://forge.ourworld.tf/lhumina_code/hero_skills/src/branch/development/)Problem
The Dioxus admin UI follows
dioxus_bootstrap.mdfor its building blocks (Dioxus 0.7,dioxus-bootstrap-css,BootstrapHead/ThemeProvider,use_signal,gloo-netRPC) butdoes not follow the architecture in
hero_admin_ui.md. It is hard-wired to theold server contract that the migration removes:
/rpcendpoint —crates/hero_aibroker_app/src/rpc.rs(base
/hero_aibroker/ui).info,config.get,metrics.get,mcp.health,models.list,models.config,models.get/delete/save, …) —src/app.rs,src/components/*.MethodDocconsts) —src/components/api_docs_tab.rs.src/types.rs./openrpc.json—src/components/navbar.rs.hero_admin_ui.mdinstead intends a generic, self-discovering admin shell: discoverservices + OpenRPC specs at runtime and render Docs/Playground from the spec — no
hardcoded URLs, method names, or per-method UI.
Goal
Make the Dioxus admin UI conform to
hero_admin_ui.md: drive the UI from OpenRPC specsfetched at runtime, over the multidomain contract, with the server contract isolated in a
single module so the cutover is a constant flip — not a component rewrite.
Key enabler
The server already ships 10 real, standard OpenRPC 1.3.2 specs in
crates/hero_aibroker_server/specs/*.openrpc.json(methods/params/result/servers). The spec-driven renderer can be built and tested against these today — itsparser does not care whether a method is named
models.listormodels_list. The oschemaPR only regenerates these (new names, new serving paths); the parsed shape is unchanged.
Scope
In scope (Dioxus side):
rpc.rs./api/domains.json+ per-domain/api/{domain}/openrpc.json).MethodDocconsts).Out of scope:
openrpc_server!adoption (server side, separate PR/owner).Approach — can start now, contract-isolated
Develop against the existing
specs/*.openrpc.json. Keep everything that depends onthe server contract (base path, endpoint shape, dotted→underscore mapping, per-call domain)
in one place (
rpc.rs) so the cutover after the server PR is a constant change.Tasks — start now (not blocked)
rpc.rs: endpoint constants (/api/{domain}/rpc,/api/domains.json,/api/{domain}/openrpc.json), base-path handling, and acentral dotted→underscore + per-call domain map.
rpc(domain, method, params)layer (keep currentrpc()as a thin wrapperduring transition).
specs/*.openrpc.json; real URLs behind the isolated constants).methods/params/result).MethodDocconsts inapi_docs_tab.rswith rendering from the fetched spec.rpc(domain, method, …)layer./openrpc.json.Tasks — after server oschema/multidomain PR lands (blocked)
/api/{domain}/…paths.app.rs(info/config/metrics/mcp→meta/admindomains;
models.*→modelsdomain).hero_admin_ui.md(markup-string tabs,build.rs+dx,serve_admin_dioxus).(B) couples to the serving model and is not fully parallelizable.
Acceptance criteria
MethodDocconsts./rpcor dotted method names outside the single contract module./openrpc.json)./api/{domain}/…is a constant change in onemodule, verified end-to-end against the migrated server.
Open questions (confirm with oschema/server owner)
/api/domains.json+/api/{domain}/openrpc.json(skill) vs the
/users/api.jsonshorthand discussed. Lock this before wiring.References
crates/hero_aibroker_app/src/rpc.rs— single/rpcclient (contract lives here)crates/hero_aibroker_app/src/app.rs— root component, polling, tab listcrates/hero_aibroker_app/src/components/api_docs_tab.rs— static docs to replacecrates/hero_aibroker_app/src/types.rs— hand-written DTOscrates/hero_aibroker_app/src/components/navbar.rs— fixed/openrpc.jsonlinkcrates/hero_aibroker_server/specs/*.openrpc.json— existing OpenRPC specs to build against