diff --git a/internal/webui/embed.go b/internal/webui/embed.go index f46374c5..378b29a9 100644 --- a/internal/webui/embed.go +++ b/internal/webui/embed.go @@ -25,22 +25,16 @@ var templatesFS embed.FS // "content", and "scripts" blocks without colliding. var pageTemplates = []string{ "templates/run_detail.html", - "templates/personas.html", "templates/persona_detail.html", "templates/pipeline_detail.html", - "templates/contracts.html", "templates/contract_detail.html", "templates/skills.html", "templates/skill_detail.html", "templates/compose.html", - "templates/issues.html", "templates/issue_detail.html", - "templates/prs.html", "templates/pr_detail.html", - "templates/health.html", "templates/analytics.html", "templates/retros.html", - "templates/notfound.html", "templates/compare.html", "templates/webhooks.html", "templates/webhook_detail.html", @@ -62,6 +56,12 @@ var standalonePageTemplates = []string{ "templates/proposals/detail.html", "templates/runs.html", "templates/pipelines.html", + "templates/issues.html", + "templates/prs.html", + "templates/health.html", + "templates/contracts.html", + "templates/personas.html", + "templates/notfound.html", } // parseTemplates parses all embedded HTML templates using a clone-per-page diff --git a/internal/webui/handlers_contracts.go b/internal/webui/handlers_contracts.go index b48590f5..0ead194a 100644 --- a/internal/webui/handlers_contracts.go +++ b/internal/webui/handlers_contracts.go @@ -88,7 +88,7 @@ func (s *Server) handleContractsPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/contracts.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/contracts.html"].Execute(w, data); err != nil { http.Error(w, "template error: "+err.Error(), http.StatusInternalServerError) } } diff --git a/internal/webui/handlers_health.go b/internal/webui/handlers_health.go index 122f053c..074bf4cf 100644 --- a/internal/webui/handlers_health.go +++ b/internal/webui/handlers_health.go @@ -19,7 +19,7 @@ func (s *Server) handleHealthPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/health.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/health.html"].Execute(w, data); err != nil { http.Error(w, "template error: "+err.Error(), http.StatusInternalServerError) } } diff --git a/internal/webui/handlers_issues.go b/internal/webui/handlers_issues.go index 91527a67..a2538aac 100644 --- a/internal/webui/handlers_issues.go +++ b/internal/webui/handlers_issues.go @@ -31,7 +31,7 @@ func (s *Server) handleIssuesPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/issues.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/issues.html"].Execute(w, data); err != nil { http.Error(w, "template error: "+err.Error(), http.StatusInternalServerError) } } diff --git a/internal/webui/handlers_personas.go b/internal/webui/handlers_personas.go index 7fc47643..0e7768a5 100644 --- a/internal/webui/handlers_personas.go +++ b/internal/webui/handlers_personas.go @@ -26,7 +26,7 @@ func (s *Server) handlePersonasPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/personas.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/personas.html"].Execute(w, data); err != nil { http.Error(w, "template error: "+err.Error(), http.StatusInternalServerError) } } diff --git a/internal/webui/handlers_prs.go b/internal/webui/handlers_prs.go index 1db79f54..c468efc3 100644 --- a/internal/webui/handlers_prs.go +++ b/internal/webui/handlers_prs.go @@ -33,7 +33,7 @@ func (s *Server) handlePRsPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/prs.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/prs.html"].Execute(w, data); err != nil { log.Printf("[webui] template error rendering prs page: %v", err) http.Error(w, "template error", http.StatusInternalServerError) } diff --git a/internal/webui/routes.go b/internal/webui/routes.go index aed83db5..dc983b40 100644 --- a/internal/webui/routes.go +++ b/internal/webui/routes.go @@ -115,6 +115,6 @@ func (s *Server) handleNotFound(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotFound) tmpl := s.assets.templates["templates/notfound.html"] if tmpl != nil { - _ = tmpl.ExecuteTemplate(w, "templates/layout.html", nil) + _ = tmpl.Execute(w, nil) } } diff --git a/internal/webui/templates/contracts.html b/internal/webui/templates/contracts.html index 4fc5213f..ad08edab 100644 --- a/internal/webui/templates/contracts.html +++ b/internal/webui/templates/contracts.html @@ -1,43 +1,79 @@ -{{define "title"}}Contracts · Wave{{end}} -{{define "content"}} -

Contracts

+ + + + + + Contracts — Wave + + + {{if csrfToken}}{{end}} + + + -{{if .Contracts}} -
-
- - {{len .Contracts}} contracts +
+
+

Contracts

-
-
-{{range .Contracts}} - -
-
-
- {{.Name}} - {{if .Title}}{{.Title}}{{end}} -
- {{if .Description}}
{{.Description}}
{{end}} -
-
- {{.Filename}} + + {{if .Contracts}} +
+
+ + {{len .Contracts}} contracts +
+
+ +
-{{else}} -
No contracts found. Add schemas to .agents/contracts/
-{{end}} -{{end}} -{{define "scripts"}} - -{{end}} + {{.Filename}} + + {{end}} +
+ {{else}} +
+

No contracts found

+

Add schemas to .agents/contracts/

+
+ {{end}} +
+ + + + + diff --git a/internal/webui/templates/health.html b/internal/webui/templates/health.html index 6a2e08b7..70d5464d 100644 --- a/internal/webui/templates/health.html +++ b/internal/webui/templates/health.html @@ -1,42 +1,82 @@ -{{define "title"}}Health · Wave{{end}} -{{define "content"}} - -{{if .Checks}} -
+ + + + + + Health — Wave + + + {{if csrfToken}}{{end}} + + + + +
+
+

Health Checks

+ +
+ + {{if .Checks}} +
{{range .Checks}} -
-
- - {{if eq .Status "ok"}}✓{{else if eq .Status "warn"}}⚠{{else}}✗{{end}} - -

{{.Name}}

- {{.Status}} +
+
+ + {{if eq .Status "ok"}} + {{else if eq .Status "warn"}} + {{else}}{{end}} + + {{.Name}} + {{if eq .Status "ok"}}ok + {{else if eq .Status "warn"}}warn + {{else}}error{{end}}
-

{{.Message}}

+ {{if .Message}} +
{{.Message}}
+ {{end}} {{if .Details}} -
- Details - - {{range $key, $value := .Details}} - - - - - {{end}} -
{{$key}}{{$value}}
+
+ Details + + {{range $key, $value := .Details}} + + + + + {{end}} +
{{$key}}{{$value}}
{{end}} -
+
{{end}} -
-{{else}} -
-
-

No health checks available

-

Run wave doctor to check project health.

-
-{{end}} -{{end}} +
+ {{else}} +
+

No health checks available

+

Run wave doctor to check project health.

+
+ {{end}} +
+ + + + diff --git a/internal/webui/templates/issues.html b/internal/webui/templates/issues.html index 467f0c7a..92c0647e 100644 --- a/internal/webui/templates/issues.html +++ b/internal/webui/templates/issues.html @@ -1,90 +1,135 @@ -{{define "title"}}Issues · Wave{{end}} -{{define "content"}} -
-

Issues

-
+ + + + + + Issues — Wave + + + {{if csrfToken}}{{end}} + + + -
-
- Open - Closed - All +
+
+

Issues

-
- - - {{if .TotalOpen}}{{.TotalOpen}} open{{end}} - {{if .TotalClosed}} · {{.TotalClosed}} closed{{end}} + +
+ Open + Closed + All +
+ + + {{if .TotalOpen}}{{.TotalOpen}} open{{end}} + {{if .TotalClosed}} · {{.TotalClosed}} closed{{end}} +
-
-{{if .Message}} -
{{.Message}}
-{{else if .Issues}} -
-{{range .Issues}} - -
-
-
- #{{.Number}} {{.Title}} - {{if eq .State "open"}}open - {{else}}closed{{end}} -
-
- {{.Author}} - {{if .RunCount}}{{.RunCount}} runs{{end}} - {{if .TotalTokens}}{{formatTokensShort .TotalTokens}} tok{{end}} - {{if .Comments}}{{.Comments}} {{if eq .Comments 1}}comment{{else}}comments{{end}}{{end}} - {{range .Labels}}{{.Name}}{{end}} -
-
-
- {{.CreatedAt}} + {{if .Message}} +
+

{{.Message}}

+
+ {{else if .Issues}} +
-{{if .HasMore}} -
- Loading more... -
-{{end}} -{{else}} -
No issues found
-{{end}} -{{end}} -{{define "scripts"}} - -{{end}} + + {{end}} +
+ {{if .HasMore}} +
+ + Loading more... +
+ {{end}} + {{else}} +
+

No issues found

+
+ {{end}} +
+ + + + + + + diff --git a/internal/webui/templates/notfound.html b/internal/webui/templates/notfound.html index c8af4dfc..88489303 100644 --- a/internal/webui/templates/notfound.html +++ b/internal/webui/templates/notfound.html @@ -1,13 +1,46 @@ -{{define "title"}}Not Found · Wave{{end}} -{{define "content"}} -
-
404
-

Page not found

-

The page you requested does not exist or has been moved.

-
- - Go to Runs - View Pipelines + + + + + + Not Found — Wave + + + + +
-{{end}} + + +
+
+

404

+

Page not found

+

The page you requested does not exist or has been moved.

+
+ + Go to Runs + View Pipelines +
+
+
+ + + + diff --git a/internal/webui/templates/personas.html b/internal/webui/templates/personas.html index e8fbdd96..1b6ff5eb 100644 --- a/internal/webui/templates/personas.html +++ b/internal/webui/templates/personas.html @@ -1,41 +1,78 @@ -{{define "title"}}Personas · Wave{{end}} -{{define "content"}} -

Personas

+ + + + + + Personas — Wave + + + {{if csrfToken}}{{end}} + + + -{{if .Personas}} -
-
- - {{len .Personas}} personas +
+
+

Personas

-
-
-{{range .Personas}} - -
-
-
- {{.Name}} - {{if .Model}}{{friendlyModel .Model}}{{end}} - {{if .Adapter}}{{.Adapter}}{{end}} -
- {{if .Description}}
{{.Description}}
{{end}} + + {{if .Personas}} +
+
+ + {{len .Personas}} personas +
+
+ +
-{{else}} -
No personas configured
-{{end}} -{{end}} -{{define "scripts"}} - -{{end}} + + {{end}} +
+ {{else}} +
+

No personas configured

+
+ {{end}} +
+ + + + + diff --git a/internal/webui/templates/prs.html b/internal/webui/templates/prs.html index bc8cb337..70252a59 100644 --- a/internal/webui/templates/prs.html +++ b/internal/webui/templates/prs.html @@ -1,98 +1,146 @@ -{{define "title"}}Pull Requests · Wave{{end}} -{{define "content"}} -
-

Pull Requests

-
+ + + + + + Pull Requests — Wave + + + {{if csrfToken}}{{end}} + + + -
-
- Open - Closed - All +
+
+

Pull Requests

-
- - - {{if .TotalOpen}}{{.TotalOpen}} open{{end}} - {{if .TotalClosed}} · {{.TotalClosed}} closed{{end}} + +
+ Open + Closed + All +
+ + + {{if .TotalOpen}}{{.TotalOpen}} open{{end}} + {{if .TotalClosed}} · {{.TotalClosed}} closed{{end}} +
-
-{{if .Message}} -
{{.Message}}
-{{else if .PullRequests}} -
-{{range .PullRequests}} - -
-
-
- #{{.Number}} {{.Title}} - {{if .Merged}}merged - {{else if .Draft}}draft - {{else if eq .State "open"}}open - {{else}}closed{{end}} - {{if eq .CheckStatus "success"}} - {{else if eq .CheckStatus "failure"}} - {{else if eq .CheckStatus "pending"}}{{end}} -
-
- {{.Author}} - {{if .HeadBranch}}☍ {{.HeadBranch}}{{end}} - {{if .RunCount}}{{.RunCount}} runs{{end}} - {{if .TotalTokens}}{{formatTokensShort .TotalTokens}} tok{{end}} - {{if .Comments}}{{.Comments}} {{if eq .Comments 1}}comment{{else}}comments{{end}}{{end}} - +{{.Additions}} -{{.Deletions}} - {{.ChangedFiles}} files - {{range .Labels}}{{.Name}}{{end}} -
-
-
- {{.CreatedAt}} + {{if .Message}} +
+

{{.Message}}

+
+ {{else if .PullRequests}} +
-{{if .HasMore}} -
- Loading more... -
-{{end}} -{{else}} -
No pull requests found
-{{end}} -{{end}} -{{define "scripts"}} - -{{end}} + + {{end}} +
+ {{if .HasMore}} +
+ + Loading more... +
+ {{end}} + {{else}} +
+

No pull requests found

+
+ {{end}} +
+ + + + + + +