Slice 13: repo search + filtering (+ no-cache dev assets)
<repo-list> gains a search box (name/path) and Dirty/Ahead-behind filter chips with an N-of-M count; filtering is client-side and the state persists in localStorage (gitmanager.repolist.filters, §4). Refresh/selection re-apply filters. cmd/server sends Cache-Control: no-cache for /components and /static so hot-reloaded asset edits show on reload. Server-verified (curl); live click-through pending an unresponsive browser pane. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
@@ -109,6 +110,18 @@ func main() {
|
||||
e.Use(middleware.Recover())
|
||||
e.Use(middleware.RequestID())
|
||||
|
||||
// Ask browsers to revalidate component/static assets so edits show up on
|
||||
// reload (the dev server hot-reloads; cached ES modules would defeat that).
|
||||
e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
p := c.Request().URL.Path
|
||||
if strings.HasPrefix(p, "/components/") || strings.HasPrefix(p, "/static/") {
|
||||
c.Response().Header().Set("Cache-Control", "no-cache")
|
||||
}
|
||||
return next(c)
|
||||
}
|
||||
})
|
||||
|
||||
// Static assets and component sources.
|
||||
e.Static("/static", "web/static")
|
||||
e.Static("/components", "components")
|
||||
|
||||
Reference in New Issue
Block a user