From 25de37978c8ece88cfe2fa41c6bccbd4be84f3e1 Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Wed, 29 Apr 2026 10:21:19 +0100 Subject: [PATCH] webui: redesign UI with Material 3 and update logo - Replace the minimal Tailwind table UI with a full Material 3 React UI built on React 18 + Babel Standalone (CDN, no build step). Features include a KPI hero bar, ring chart, filter/search, bulk actions, a JSON object-data drawer, timeline view, toast rail, light/dark themes, five tonal colour seeds, density modes, and keyboard shortcuts. - Switch home.go from html/template to text/template with [[ ]] delimiters so JSX {{ }} syntax and arrow-function attributes pass through unmodified. - Wire up real API calls (list, update, objectData) via window.__API_PATHS injected by the Go template; remove all mock-data generation. - Add SVG logo files (light + dark variants) and update README and the webui sidebar brand to use them, with CSS-based theme switching. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 2 +- adapters/webui/internal/frontend/home.go | 45 +- adapters/webui/internal/frontend/home.html | 2122 +++++++++++++++++++- logo/logo.svg | 12 + logo/logo_dark.svg | 10 + 5 files changed, 2063 insertions(+), 128 deletions(-) create mode 100644 logo/logo.svg create mode 100644 logo/logo_dark.svg diff --git a/README.md b/README.md index c4aeb37d..f258f6da 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- Workflow Logo + Workflow Logo
diff --git a/adapters/webui/internal/frontend/home.go b/adapters/webui/internal/frontend/home.go index f3a6e1f9..f35bc436 100644 --- a/adapters/webui/internal/frontend/home.go +++ b/adapters/webui/internal/frontend/home.go @@ -2,55 +2,20 @@ package frontend import ( _ "embed" - "html/template" "net/http" - "strings" + "text/template" ) -// Embed the template file -// //go:embed home.html var homeTemplate string -//go:embed main.js -var mainJS string - func HomeHandlerFunc(paths Paths) http.HandlerFunc { + // Use [[ ]] delimiters so JSX {{ }} syntax passes through unmodified. + t := template.Must(template.New("home.html").Delims("[[", "]]").Parse(homeTemplate)) return func(w http.ResponseWriter, r *http.Request) { - t, err := template.New("home.html").Parse(homeTemplate) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - jsTemplate, err := template.New("main.js").Parse(mainJS) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - // Build the JS using the provided paths - var builder strings.Builder - err = jsTemplate.Execute(&builder, struct { - Paths Paths - }{ - Paths: paths, - }) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - err = t.Execute(w, struct { - Paths Paths - Javascript template.JS - }{ - Paths: paths, - Javascript: template.JS(builder.String()), - }) - if err != nil { + w.Header().Set("Content-Type", "text/html; charset=utf-8") + if err := t.Execute(w, paths); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) - return } } } diff --git a/adapters/webui/internal/frontend/home.html b/adapters/webui/internal/frontend/home.html index bfe00054..1e89758e 100644 --- a/adapters/webui/internal/frontend/home.html +++ b/adapters/webui/internal/frontend/home.html @@ -1,120 +1,2068 @@ - - - - Workflow | Search Filters and Records + + +Workflow · Runs + + + + + + + + + + + - + + +
+ + + -
-

Search Filters

+ + + + + + + + + + diff --git a/logo/logo.svg b/logo/logo.svg new file mode 100644 index 00000000..b0682895 --- /dev/null +++ b/logo/logo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + workflow + \ No newline at end of file diff --git a/logo/logo_dark.svg b/logo/logo_dark.svg new file mode 100644 index 00000000..6ad886c1 --- /dev/null +++ b/logo/logo_dark.svg @@ -0,0 +1,10 @@ + + + + + + + + + workflow + \ No newline at end of file