UI: build and serve the Mantine application at /ui/

Author: siavashsCreated Aug 29, 2026Updated Aug 31, 2026
Labelskind/enhancementcomponent/ui

Parent: #5451

Summary

Build, embed, and release the Mantine application alongside the Elm UI, serving it permanently at <route-prefix>/ui/ with clean client-side routes.

The existing Elm application remains at the route-prefix root and remains the default UI.

Build and packaging

  • Add first-class Mantine build, test, and lint targets to the root Makefile without duplicating expensive work.
  • Configure Vite for hashed assets, third-party license attribution, and gzip/Brotli output compatible with the existing Go asset server.
  • Preserve a small uncompressed index.html as a no-cache runtime template while precompressing immutable JS, CSS, fonts, images, and license assets.
  • Embed both ui/app/dist and ui/mantine-ui/dist in Alertmanager binaries.
  • Update CI artifacts and release builds to carry both distributions.
  • Preserve the current Elm prebuilt-assets tarball extraction contract; add a separate Mantine prebuilt-assets tarball rather than silently changing its layout.

Runtime paths and routing

Register route-prefix-aware handlers for:

  • /ui/ui/.
  • /ui/ → the Mantine index.
  • /ui/assets/* → immutable static assets.
  • /ui/* → the Mantine index for valid clean client routes and direct refreshes.

The SPA fallback must be bounded to the UI mount and must not replace missing assets or shadow /, /favicon.ico, /assets/*, /api/*, /-/*, /metrics, or /debug/*.

Inject an escaped <base href="<route-prefix>/ui/"> and non-inline bootstrap metadata for UI and API base paths into the no-cache index response. This must support nested routes such as /ui/silences/:id/edit, arbitrary route prefixes, and CSP hardening without inline executable configuration.

Add a route-prefix-safe “New UI” link to Elm and a “Classic UI” link to Mantine.

Acceptance criteria

  • One Alertmanager binary serves Elm at <route-prefix>/ and Mantine at <route-prefix>/ui/.
  • Root and non-root route prefixes are covered.
  • Direct loads and refreshes work for /ui/status, /ui/silences/:id, and /ui/silences/:id/edit.
  • Missing /ui/assets/* files return 404 and are not replaced by the SPA shell.
  • Dynamic HTML is no-cache and safely injects the runtime base paths.
  • Hashed assets retain immutable caching and identity, gzip, and Brotli negotiation.
  • Third-party license notices are generated and shipped.
  • Root Make targets, UI CI, common CI, release builds, clean targets, and prebuilt asset workflows include the Mantine distribution.
  • Existing Elm routes, compression, caching, and prebuilt tarball behavior remain unchanged.
  • Go UI tests walk and serve both embedded filesystems under root and prefixed routers.

Likely code areas

  • Makefile
  • ui/mantine-ui/package.json, package-lock.json, vite.config.mjs, index.html
  • ui/web.go, ui/web_test.go
  • ui/app/src/Views/NavBar/{Types,Views}.elm
  • .github/workflows/{ci,ui-ci,release}.yml
  • README.md, CHANGELOG.md