Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| ) | ||
|
|
||
| func (s *Server) Index(c *gin.Context) { | ||
| Span(c, "ui.index") |
There was a problem hiding this comment.
Span return values discarded, trace never completed
Medium Severity
The Span function returns (context.Context, trace.Span) but in Index, both return values are discarded. The existing usage in status.go captures the span and calls defer span.End(). Without ending the span, the OpenTelemetry trace is never completed or exported, causing observability data loss for the index page.
|
|
||
| func static(path string) string { | ||
| return filepath.Join("/static", path) | ||
| } |
There was a problem hiding this comment.
Using filepath.Join for URL paths is incorrect
Low Severity
The static template function uses filepath.Join to construct URL paths, but filepath.Join uses OS-specific separators. On Windows, this produces backslash-separated paths (e.g., \static\favicon.ico) in HTML output, which browsers cannot resolve. The path.Join from the path package always uses forward slashes and is correct for URL construction.
| // Any file matching one of these patterns will be a partial template and will be | ||
| // available to render as a template but with no includes or other template files. | ||
| partials = []string{"partials/*.html", "partials/*/*.html"} | ||
| ) |
There was a problem hiding this comment.
Missing maintenance template causes nil panic
High Severity
The new template rendering system is wired up in setupRoutes, but the embedded templates/errors/ directory only contains 404.html, 405.html, and 500.html. The pre-existing Maintenance() handler references "errors/maintenance/index.html", which doesn't exist. When maintenance mode is active and an HTML response is negotiated, r.templates["errors/maintenance/index.html"] returns nil, and gin will panic with a nil pointer dereference trying to execute the template.


Scope of changes
Implements a web user interface for the status service.
Estimated PR Size:
Acceptance criteria
This PR will be merged without review.
Author checklist
Note
Medium Risk
Introduces new HTTP routes and a custom Gin HTML renderer backed by embedded assets, which could affect request routing and error-page rendering if templates or paths are misconfigured.
Overview
Adds a foundational web UI: the server now initializes a custom Gin
HTMLRender, serves embedded static assets at/static, and exposes an unauthenticated/route (Index) that renderspages/index.html.Introduces a new
pkg/webpackage that embedsstatic/andtemplates/, builds page/partial templates with shared includes, and provides common template helpers (e.g.,static,titlecase,datetime) with unit tests.Updates server error handlers to use the new template paths (
errors/404.html,errors/405.html,errors/500.html) and extendsscene.ScenewithForPageto tag the current page in template context.Written by Cursor Bugbot for commit f61377e. Configure here.