Skip to content

feat(ui): HTMX-first web UI foundation (helios-ui)#192

Merged
smunini merged 7 commits into
mainfrom
feat/htmx-ui-foundation
Jul 6, 2026
Merged

feat(ui): HTMX-first web UI foundation (helios-ui)#192
smunini merged 7 commits into
mainfrom
feat/htmx-ui-foundation

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Delivers the HTMX-first web UI foundation from #186: a working POC, the crate structure, and the conventions ("rules of the road") that subsequent UI PRs follow.

What this adds

  • crates/ui (helios-ui) — an optional, deliberately thin server-rendered UI crate:
    • Askama 0.16 compile-time, type-checked, auto-escaping templates. All markup lives in templates/; handlers only gather data and render.
    • Vendored, pinned htmx and CSS embedded at compile time (rust-embed + axum-embed with br/gzip/deflate negotiation) — no runtime CDN, air-gap-friendly.
    • Fragment vs full page via the HX-Request header (axum_htmx::HxRequest), with AutoVaryLayer emitting Vary: HX-Request so caches never cross the two. Every htmx control is a real link/form first — the UI degrades to full-page navigation without JavaScript.
    • A small real read path (server status panel) as the working example of the pattern.
  • hfs wiring behind an off-by-default ui featurehelios_ui::mount(app, version) mounts the UI under /ui and falls back to the FHIR REST app for every other path. The UI depends on the server, never the reverse.
  • crates/ui/README.md — structure and conventions: where markup, assets, and handlers go; the hypermedia-first stance; how richer read paths plug in.

Review focus / heads-up

Closes #186.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.50000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ui/src/lib.rs 92.50% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Codecov flagged the patch at 45%: the unit tests only exercised template
rendering and asset embedding, leaving mount(), both handlers, the
fragment-vs-full-page branch, and the FHIR fallback unexecuted.

Drive the mounted router with tower::ServiceExt::oneshot the way a
browser would: full page at /ui, hard navigation vs HX-Request fragment
at /ui/status (including the Vary: HX-Request contract from
AutoVaryLayer), embedded assets, and passthrough of non-/ui paths to the
wrapped FHIR app. Only the template-render error branch stays uncovered.
@smunini smunini merged commit bf3eb1b into main Jul 6, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Foundation: HTMX-first web UI (POC, structure, and rules of the road)

2 participants