ui

package
v1.801.413 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

Tasks UI (embedded)

dist/ is the built Hanzo Tasks SPA — the admin-tasks app (@hanzo/tasks, Vite + hanzogui) — baked into the cloud binary via //go:embed and served at /tasks/* by apps/tasks. This is the real UI behind tasks.hanzo.ai and console.hanzo.ai/tasks; cloud is the ONE process that serves it, which retires the standalone tasks-ui pod (a Temporal-Web-UI fork).

The SPA is built with base: '/tasks/' and VITE_API_PREFIX=/v1/tasks, so every asset and XHR is same-origin under paths cloud already serves (/tasks/* static, /v1/tasks/* API).

Regenerating dist/

Source of truth: the admin-tasks app. It composes @hanzogui/admin (from hanzoai/admin) with the hanzogui / @hanzogui/* v7 primitives (from the gui workspace). Build it in a workspace where BOTH resolve, then sync its dist/:

# in the workspace that provides hanzogui@7.3.x + @hanzogui/admin
cd apps/admin-tasks
bun install
bun run build            # → apps/admin-tasks/dist  (base=/tasks/, api=/v1/tasks)

# sync into cloud
rsync -a --delete apps/admin-tasks/dist/ <cloud>/apps/tasks/ui/dist/

Then go build ./cmd/cloud re-embeds it. Do NOT hand-edit files under dist/ — they are content-addressed Vite output. Keep .sync-stamp truthful (source repo

  • commit).

Documentation

Overview

Package ui embeds the built Hanzo Tasks SPA (@hanzo/tasks, the admin-tasks app in hanzoai/admin, Vite + hanzogui) directly into the cloud binary and serves it at /tasks/* (console.hanzo.ai/tasks + tasks.hanzo.ai/tasks).

WHY cloud owns this embed (not github.com/hanzoai/tasks/ui): the tasks module ships an EMPTY ui/dist placeholder ("No UI build present") because its bundle is produced in a separate frontend workspace and synced in at release time — a step the tasks module's own releases do not run, so cloud's tasks UI was a placeholder. cloud is the ONE process that serves tasks.hanzo.ai (durable.go's EmbeddedTasks engine + apps/tasks's /v1/tasks surface), so cloud owns the UI embed too: one binary, one origin, the real UI. This retires the standalone tasks-ui pod (a Temporal-Web-UI fork).

dist/ is the committed, content-addressed Vite build. The SPA is built with base '/tasks/' and API prefix '/v1/tasks' (see the admin-tasks vite.config), so every asset + XHR is same-origin under the paths cloud already serves. To refresh it, rebuild the admin-tasks app and sync its dist/ here — see apps/tasks/ui/README.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FS

func FS() fs.FS

FS returns the embedded built-UI filesystem rooted at dist/.

func Handler

func Handler() http.Handler

Handler returns an http.Handler that serves the embedded SPA. Mount it under StripPrefix("/tasks", …) so it sees root-relative paths.

  • Content-addressed assets under assets/ ship immutable cache hints (Vite hashes filenames).
  • Any path that is not a real file rewrites to index.html so the client-side router handles the route — the standard SPA fallback that lets a deep-link reload survive.
  • If the build is absent (index.html missing) every request returns 503, so a missing bundle is loud in staging, never a blank page in production.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL