refactor: simplify PWA handlers and fix review findings
Address code review findings from reuse, quality, and efficiency agents: - Cache manifest JSON and service worker JS at init (was rebuilt per request with allocations and JSON encoding on every hit) - Add ImagePathsByUser store method for targeted image cleanup (was loading 100k full fave objects just to read image_path) - Add missing aria-label on privacy toggle in fave_list.html (inline copy had drifted from the partial — accessibility bug) - Fix comment/function name mismatch in pwa.go - Remove redundant user nil-check in handleShare (requireLogin guards) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
254573316a
commit
e379039fe8
5 changed files with 54 additions and 37 deletions
|
|
@ -36,6 +36,7 @@
|
|||
hx-target="#privacy-{{.ID}}"
|
||||
hx-swap="outerHTML"
|
||||
class="fave-action-btn {{if eq .Privacy "private"}}secondary{{end}}"
|
||||
aria-label="{{if eq .Privacy "public"}}Gjør privat{{else}}Gjør offentlig{{end}}"
|
||||
title="{{if eq .Privacy "public"}}Gjør privat{{else}}Gjør offentlig{{end}}"
|
||||
>{{if eq .Privacy "public"}}Offentlig{{else}}Privat{{end}}</button>
|
||||
</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue