feat(app): spec-driven, multidomain admin UI (#161) #163
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_aibroker!163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/dioxus-spec-driven-multidomain-ui"
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
Migrates the Dioxus admin UI (
hero_aibroker_app) to the post-oschemamultidomain server contract, per the hero_skills (
web/hero_admin_ui.md,web/dioxus_bootstrap.md,blueprint/server/hero_server_implemenation.md).It replaces the old hard-wired design — single
/rpc, dotted method names,hand-written static API docs — with a spec-driven UI that reads OpenRPC specs
at runtime, with all server-contract knowledge isolated in one module.
Part of #161 (Dioxus side).
What's included
rpc.rscontract) — single source of truth:Domainenum,
/api/{domain}/rpc+/api/{domain}/openrpc.json+/api/domains.jsonpaths,
domain_for()method→domain map,wire_name().rpc()routes throughit; adds
rpc_in()/get_json()/fetch_spec()/fetch_domains().openrpc.rs) — methods/params/result,$refresolution,ParamKind+ type labels. Pure serde.specs.rs) — one flattenedMethodEntrymodel + ause_specs()hook, used by both spec-driven tabs.MethodDocconsts, renders methods/params/returns from the fetched specs, and warns when
a domain's spec fails to load.
ParamKind, dispatch viarpc_inon the method's own domain./openrpc.jsonlink → discoveryDomainslink.demofeature +src/bin/standalone.rs+ aDioxus.toml/apiproxy for localdx serve. No effect on default builds.Design decisions
(deliberate; it won't talk to the current server until the server PR lands).
domain_for()(reads →models;writes + control-plane →
admin), derived from the existing specs.Verification
wasm32-unknown-unknownbuilds clean.dx serve+ a local mock of the multidomain contract:Docs and Playground render from the fetched specs, and the failed-domain
banner appears for a domain whose spec 500s.
loader,
get_jsonnon-2xx handling, failed-domain banner, filtered-selectionfix,
contract::rpc_path).Deferred — depends on the server oschema/multidomain PR (TODO(#161))
These are determined by the generated specs, not by us, so they're handled
when those land (the spec-driven tabs already auto-adapt to whatever names/domains
the specs contain):
reconcile
wire_name()/domain_for()/ the remaining hardcoded call sitesthen (mostly by making more of the app spec-driven).
/api/domains.jsondiscovery (currently enumeratescontract::Domain::ALL).plumbing/rendering, not naming/dispatch).
Not done (optional polish)
Concurrent spec fetch (
join_all), dropping per-render clones, dead-codecleanup, and deriving
domain_forfrom discovery — cosmetic, left for themerge-cleanup pass.
Migrate the Dioxus admin UI to the multidomain Hero server contract. - openrpc.rs: OpenRPC spec parser (methods/params/result, $ref resolution, ParamKind + type labels). Pure serde, reusable. - rpc.rs: `contract` module as the single source of truth — Domain enum, domain_for() method->domain map (model reads -> models; writes + all control-plane -> admin), wire_name() dotted->underscore, and /api/{domain}/rpc + per-domain spec + discovery paths. rpc() routes via the contract; adds rpc_in/get_json/fetch_spec/fetch_domains. No legacy fallback. - api_docs_tab.rs: rewritten spec-driven; removes static MethodDoc consts, fetches per-domain specs and renders methods/params/return types. - playground_tab.rs: new tab — pick a method, spec-driven param form by ParamKind, dispatch via rpc_in on the method's own domain. - navbar: dead /openrpc.json link -> discovery "Domains" link. Dev/verification aids (gated; no effect on default builds): - `demo` feature + src/bin/standalone.rs (dx serve launcher) - Dioxus.toml /api proxy + scripts/mock_multidomain.py (serves the existing specs at the new paths). Verified in-browser via dx serve + headless Chrome: Docs renders 99 methods across domains end-to-end. 12 unit tests pass; compiles host + wasm32. TODO(#161): confirm exact endpoint paths, the naming rule, and the domain split with the oschema/server owner. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Per skills/web/dioxus.md ("never use raw Bootstrap classes; use the typed RSX components"), migrate the API Docs and Playground tabs off raw Bootstrap component classes onto typed components: Card, Alert, Badge, Table, ListGroup/ListGroupItem, and Input/Select/Textarea/FormText. ListGroupItem's `active` prop + auto-button-on-onclick replaces the hand-rolled active class. Plain utility classes (text-muted, small, d-flex, gap-*) and non-component elements (code, pre, label) are left as-is. Like-for-like markup — verified in-browser (dx serve) that both tabs render identically. 12 unit tests pass; host + wasm32 build clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Pull request closed