From 8ca1f686bd7d495322a36b5260ce7a303505d8b9 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 15 Jul 2026 02:13:28 +0000 Subject: chore: remove dead code (unused atom constants, orphaned handler) - SourceMeal/TypeMeal (AtomSource/AtomType): leftover from the removed MealToAtom conversion (b2d8fc4); zero references anywhere else. - HandleGetSourceOptions: never registered as a route, and its own test comment already noted "may fail if template not found, which is acceptable" -- the settings-source-options template it rendered doesn't exist in web/templates/ at all. Fully unreachable/broken, not just unused. go build/vet/test all clean, no behavior change for anything reachable. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01VTUSAEKfsPc6WGDq45yPHD --- internal/handlers/settings.go | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'internal/handlers/settings.go') diff --git a/internal/handlers/settings.go b/internal/handlers/settings.go index dc345db..28988b1 100644 --- a/internal/handlers/settings.go +++ b/internal/handlers/settings.go @@ -154,28 +154,6 @@ func (h *Handler) HandleToggleSourceConfig(w http.ResponseWriter, r *http.Reques json.NewEncoder(w).Encode(map[string]bool{"enabled": enabled}) } -// HandleGetSourceOptions returns available options for a source (HTMX partial) -func (h *Handler) HandleGetSourceOptions(w http.ResponseWriter, r *http.Request) { - source := chi.URLParam(r, "source") - if source == "" { - JSONError(w, http.StatusBadRequest, "Source required", nil) - return - } - - configs, err := h.store.GetSourceConfigsBySource(source) - if err != nil { - JSONError(w, http.StatusInternalServerError, "Failed to load configs", err) - return - } - - data := struct { - Source string - Configs []models.SourceConfig - }{source, configs} - - HTMLResponse(w, h.renderer, "settings-source-options", data) -} - // HandleToggleFeature toggles a feature flag func (h *Handler) HandleToggleFeature(w http.ResponseWriter, r *http.Request) { name, ok := requireFormValue(w, r, "name") -- cgit v1.2.3