Skip to content

feat(ui): add htmx ui foundation#188

Merged
angela-helios merged 4 commits into
HeliosSoftware:feat/htmx-ui-foundationfrom
angela-helios:feat/htmx-ui-foundation
Jul 6, 2026
Merged

feat(ui): add htmx ui foundation#188
angela-helios merged 4 commits into
HeliosSoftware:feat/htmx-ui-foundationfrom
angela-helios:feat/htmx-ui-foundation

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Summary

Adds a minimal HTMX-based UI foundation for HFS.

This introduces a new optional helios-ui crate under crates/ui, mounted by the hfs binary when the ui feature is enabled. The UI currently exposes a small proof-of-concept page at /ui that displays the running HFS version, plus an HTMX-powered /ui/version partial refresh endpoint.

The headless feature path is also included so HFS can be built without compiling or mounting the UI.

Changes

  • Add new helios-ui crate for optional web UI code
  • Add ui default feature to helios-hfs
  • Add headless feature flag for no-UI builds
  • Mount /ui and /ui/version from the HFS binary when UI is enabled
  • Add minimal HTMX interaction for refreshing the displayed HFS version
  • Keep FHIR routes available as fallback behind the UI routes

Testing

  • cargo fmt --all
  • cargo test -p helios-ui
  • cargo check -p helios-hfs
  • cargo check -p helios-hfs --no-default-features --features R4,sqlite,headless

@smunini smunini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@angela-helios I would prefer to name the crate 'ui' on disk instead of 'web' and have the crate name be 'helios-ui' instead of 'helios-web' I think web is too much of a generic term.

@angela-helios angela-helios requested a review from smunini July 3, 2026 15:19
@doug-helios

Copy link
Copy Markdown
Contributor

NIT should we update CLAUDE.md? @angela-helios @smunini @mauripunzueta

Comment thread crates/web/Cargo.toml Outdated
@angela-helios angela-helios merged commit 5f1c68d into HeliosSoftware:feat/htmx-ui-foundation Jul 6, 2026
angela-helios added a commit that referenced this pull request Jul 6, 2026
Plug the locale structure from feat/i18n-foundation into the helios-ui
crate from #186 — the runtime wiring #187 deliberately deferred:

- crates/ui/src/i18n.rs: negotiate_locale middleware producing one
  RequestLocale per request (?lang= override -> hfs_lang cookie ->
  Accept-Language via RFC 4647 Lookup -> en), an explicit ?lang= choice
  persisted in the cookie, Vary: Accept-Language, Cookie on responses,
  and the I18n Fluent lookup helper templates resolve keys through.
- Catalogs embedded at compile time via fluent-templates static_loader
  (no runtime file/CDN dependency, same stance as the vendored assets),
  falling back negotiated locale -> en, key echo for unknown keys.
- Templates now hold catalog keys, not prose; <html lang> reflects the
  negotiated locale; no-JS language switcher with aria-current.
- New keys (home-lede, status-version, status-last-checked,
  action-refresh-status) seeded across en/es/de; en stays the source
  of truth and a test parses all three .ftl files to enforce key-set
  parity.
- tests/i18n_http.rs drives the mounted router end to end: header
  negotiation, override cookie, persistence, localized htmx fragments.
- docs/multi-language.md: crate name updated to helios-ui post-#188
  review; point at the now-existing wiring.
@angela-helios angela-helios deleted the feat/htmx-ui-foundation branch July 6, 2026 18:53
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.

3 participants