Fix deployed-UI feedback: dashboard 500, checkbox grids, manage-access cards #3
Loading…
Reference in a new issue
No description provided.
Delete branch "redesign/tailwind-v4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #2 (deployed feedback). Three commits on top of what was merged.
1. Root page returned 500 for every logged-in user (
65ab273)The redesigned dashboard template executes the shared flash partial, which evaluates
.Flash— but the/handler rendereddashboardData{User, Apps}with no such field, so every GET / failed with a template error. Reproduced locally before fixing.Fix: the handler moved from an untestable
run.goclosure intouser.Handler.GetDashboard, following the package's existing consumer-interface pattern:user.AppLister(backed by*app.Servicein run.go)userContextReaderfunc type (wired tosession.UserFromContext; avoids the session→user import cycle)dashboardDatagainsFlash, populated from?flash=like the other pagesRegression tests (
internal/user/handler_test.go): empty state; apps + flash partial end-to-end (fails if theFlashfield disappears again); lister error → 500. Alluser.NewHandlercall sites updated.2. Checkbox grids + manage-access cleanup (
65ab273+4c9fe38).check-listgrid component (1-col mobile / 2-col ≥sm): applied to role-edit and role-add group checkboxes, and the app-assignments Roles/Groups fieldsets — name + muted description, aligned, no clusteringapp_id,groups.<id>,roles.<id>) and select-all JS untouched3. CSP was silently killing inline JS (
ef1c991)Verified live during doc work: the global CSP (
script-src 'self') silently blocks inline scripts andon*=handlers — the manage-access Select All button did nothing, the OAuth Copy button was inert, and rotate-secret / passkey-delete submitted without their confirmation dialogs. All pre-existing (CSP unchanged since the Bulma era), but destructive actions running unconfirmed is a real hazard.Fix: new
internal/web/static/app.js(defer, CSP-safe) drives behavior viadata-copy/data-confirmattributes plus select-all wiring; inline handlers removed from templates.Documentation (
ef1c991)AGENTS.md now documents the flash-partial data contract (missing
.Flash= runtime 500), the strict-CSP rules (UI conventions + must-not-do), load-bearing template strings asserted by tests, the dashboard handler location, and the CI CSS drift check. README gains themake cssworkflow and a corrected Go version.Verification
go test -race ./...all green; build/vet/gofmt clean; committed CSS reproduces byte-for-byte frommake cssReview
Second code review returned approve (0 blocking, 0 should-fix); its 4 actionable nits are incorporated in
4c9fe38. Known pre-existing issue left out of scope: an app with an emptyNamewould still 500 the dashboard via{{slice .Name 0 1}}(guarded by the required form field today).