Hoist reusable admin components from existing service UIs into hero_website_lib #4
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_website_framework#4
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?
Context
Meeting feedback: too much UI duplication across service admin interfaces (hero_proc, hero_osis, hero_embedder_ui, hero_foundry_web, hero_compute_ui, hero_indexer_ui, hero_inspector, ...). Reusable bits belong in the shared website framework. Survey before reinventing — most of these components already exist somewhere in the ecosystem; this issue is about moving them, not rewriting.
Meeting also explicitly called out: the API explorer that lives inside
hero_procis the best version and should be hoisted up so the router and every other service can reuse it.Components to hoist (in priority order)
hero_proc_adminhero_admin_connection_statusskill / existing UIslogs.html— needs live streaming./mdview/route existsProcess
For each component:
hero_*_admin,hero_*_ui,hero_*_webcrates).crates/hero_website_lib/as a reusable Askama template + handler + route helper.hero_website_lib/README.mdwith a copy-paste integration snippet.hero_skills/skills/web/so AI agents can wire it into another service in one step.Templating decision
Default to Askama for new components. Hero ecosystem default is compile-time Askama; Tera is reserved for genuinely runtime-templated content (user-editable blog posts, document templates).
hero_website_libcurrently has Tera-based templates inherited from earlier work — keep those Tera unless a clear migration target appears, but new components added in this issue (OpenRPC explorer, connection-status, logs widget, jobs viewer) should be Askama. No Dioxus for now. Hand-roll JavaScript where needed (htmx/vanilla); SSE for live components.Open follow-up question: should the framework migrate its existing Tera templates to Askama? Most default admin screens don't actually need runtime template loading. File a separate issue if migration is desired — out of scope for this hoisting work.
Acceptance
hero_proc_adminand one other service, and documented.hero_proc_admincrate references the framework's components instead of its local copies (delete the originals).Related
hero_rpc scaffold) #54Parent / context tracker: hero_skills#262 — read it before starting work on this issue. Locked decisions, reference materials, and execution order live there. Iterate via comments here; consolidation passes on the body only after feedback settles.
Scope refresh — latest dev state
Pulled latest. Several things have changed since I wrote this issue:
Already landed in
hero_admin_lib<hero-api-docs>web component atcrates/hero_admin_lib/static/js/api-docs.js(commit 630f702). The meeting's #1 priority hoist is already done. Audit task: doeshero_proc_adminstill ship its own copy that can be deleted, or has it been migrated to the new component?health+.well-known/heroservice.jsonhandlers incrates/hero_admin_lib/src/routes.rs. Reusable across every admin binary.crates/hero_admin_lib/src/socket.rs.crates/hero_admin_lib/src/middleware.rs.crates/hero_admin_lib/src/assets.rs(rust-embed wrapper).Still to hoist (revised priority list)
hero_admin_connection_statusskill / existing UIslogs.html; needs live streaming./mdview/routehero_proc_admin.Templating decision: new components added by this issue go into
hero_admin_lib(Askama-friendly Axum library), nothero_website_lib. The framework's existing Tera surface inhero_website_libstays separate.Will update the body in a consolidation pass once feedback settles.
Progress:
<hero-logs-viewer>landedCommit 78efe3d — adds the live logs viewer web component to
hero_admin_lib.Design choices (flagged here in case any need to flip):
logs.filterdirectly and assumes the canonicalLogLine { ts, src, content, loglevel, error, tags }shape. Other services that already log via the hero_proc SDK get it for free; services with bespoke log schemas would need to wrap.<hero-connection-status>and<hero-api-docs>. The framework already has a Teralogs.htmlfor the public website surface (hero_website_lib/default_templates/admin/logs.html) — that one stays put; this new component is for admin dashboards.rpc-urlattribute; nowindow.rpcdependency. Drop-in for any dashboard whose backend exposes/rpc.Next up:
<hero-jobs-viewer>(same pattern, talks tojob.*RPCs) and<hero-markdown-viewer>(pure client-side, marked.js).Will skip the
hero_proc_adminmigration of these two (logs/jobs) since its local UIs are richer and useful as-is. The hoist still satisfies acceptance via the new scaffolder consuming the framework defaults.Done — all three remaining components hoisted
Landed on
development(rebased over today's6c88a34):<hero-logs-viewer>static/js/logs-viewer.js<hero-jobs-viewer>static/js/jobs-viewer.js<hero-markdown-viewer>static/js/markdown-viewer.jsAll three are self-contained Web Components in
hero_admin_lib. They:rpc-url,context-name, filters, polling cadence)window.rpcdependencyassetsmodule doc-comments (visible viacargo doc -p hero_admin_lib)The
hero_admin_libstatic asset table insrc/assets.rsnow lists all five Hero components:<hero-api-docs>,<hero-connection-status>,<hero-logs-viewer>,<hero-jobs-viewer>,<hero-markdown-viewer>.Audit of
hero_proc_admin<hero-connection-status>via/static/shared/js/connection-status.js(templates/base.html:168).api-accordionandapi-detail-panel). It has not yet migrated to<hero-api-docs>.Open follow-ups (NOT in this PR)
<hero-api-docs>— cross-repo change, should be its own issue inhero_proc.hero_skills/skills/web/skill — one-step wiring guide for AI agents; tracked by hero_skills#260.hero_website_libexisting templates — flagged as separate follow-up in the original issue body.Acceptance check
From the issue body:
OpenRPC explorer (commit 630f702) and connection-status (commit ef5ea4b) were already done. Three more components are now also done — exceeding the minimum bar.
Branch + follow-up
The three hoist commits are now also on a feature branch:
development_timurFollow-up issue filed for the cross-repo
hero_proc_adminmigration:hero_proc_adminAPI tab from its hand-rolled accordion to<hero-api-docs>.Note on
developmentThe three commits were initially pushed straight to
development(before I knew the model). They're identical ondevelopmentanddevelopment_timurright now. Perhero_branching, I'd normally force-resetdevelopmentback to6c88a34so the only entry intodevelopmentis via the squash-merge PR fromdevelopment_timur— but force-pushing a shareddevelopmentbranch is destructive and may orphan other developers' work. Holding off on that reset pending your confirmation.hero_proc_adminto<hero-api-docs>web component #108Skills landed for the four new components
The issue body says: "Add (or update) a skill in
hero_skills/skills/web/so AI agents can wire it into another service in one step." On-disk convention isskills/hero/ui/(per the existinghero_ui_connection_status.md), so the new skills follow that location.Landed on
hero_skillsdevelopmentin 707e7a7 — one bundled commit, 8 files:<hero-api-docs>skills/hero/ui/hero_ui_api_docs.md.toml<hero-logs-viewer>skills/hero/ui/hero_ui_logs_viewer.md.toml<hero-jobs-viewer>skills/hero/ui/hero_ui_jobs_viewer.md.toml<hero-markdown-viewer>skills/hero/ui/hero_ui_markdown_viewer.md.tomlEach skill mirrors
hero_ui_connection_status.md: how it works → integration snippet → attributes table → checklist → anti-patterns. The integration snippets are pulled verbatim from each component's doc-comment incrates/hero_admin_lib/src/assets.rs, so the skills can't drift from the canonical reference.Acceptance check (from this issue)
<hero-api-docs>— skill added<hero-connection-status>— skill already existed (hero_ui_connection_status.md)<hero-logs-viewer>— skill added<hero-jobs-viewer>— skill added<hero-markdown-viewer>— skill addedCombined with the five components landed in 630f702 / ef5ea4b / f6af8ab / 9d80616 / 8df3330, every component called out by this issue now has both the hoisted code and a discoverable skill for agents to wire it in.
Not covered here (explicit deferrals)
hero_proc_adminAPI tab migration to<hero-api-docs>— cross-repo, tracked by hero_proc#107.development_timurvsdevelopmentbranching note onhero_website_framework— out of scope for this skill-docs work.hero_website_libexisting templates — explicit follow-up in the issue body.