refactor: remove dead code across server, templ pages, and client modules
Deadcode-verified removals (RTA reachability from main, cross-checked with -test and textual xrefs): Go server: - whole files: middleware/transaction.go, middleware/error_handler.go, middleware/password_validator.go (live registration machinery kept), handlers/sync.go, sync/offline.go - unrouted endpoints: auth UpdateUsername/UpdateEmail, timezone settings handler, OPDS RegisterOPDS, Kobo LibrarySync handler, ReaderHandler.ShowReader, JSON-data twins on collections/library - duplicate book-matching handlers (book_matching.go Handler twins, matching.go MatchingHandler twins), superseded helpers (router.parseUUID, handlers.ValidateDeviceToken, normalizePath, userExists, generateLockID) Templ/client: - never-routed pages: api_explorer.templ, queue.templ and their client modules api-explorer.ts, api-explorer-docs.ts, queue.ts - fully orphaned wrapper modules events.ts, dom.ts - broken clearSyncQueue (called a nonexistent endpoint) and the hidden, never-populated sync-queue section on the devices page - 166+ unused exports demoted to private (knip-verified); ~85 truly dead declarations removed via tsc noUnusedLocals fixpoint - stale 'interactive API Explorer' claims dropped from docs The docs drift-gate package (internal/docs), templ-bound modules (dashboard, stats, header, index, login, profile*, bookshelf, collections, toast-error), sqlc-generated code, and web/static are intentionally untouched.
This commit is contained in:
1 parent
8733e83f1f
commit
8631aa00bf
107 files changed
+689
-3443
No files matched your search
@@ -24,15 +24,6 @@ func activeClass(current, target string) string {
|
||||
return base + "text-content-muted hover:bg-surface-hover hover:text-content"
|
||||
}
|
||||
|
||||
// navItemClass returns classes for top-nav links, marking the active route.
|
||||
func navItemClass(current, target string) string {
|
||||
base := "text-sm font-medium px-3 py-2 rounded-lg transition-colors "
|
||||
if current == target {
|
||||
return base + "text-content bg-surface-hover"
|
||||
}
|
||||
return base + "text-content-muted hover:text-content hover:bg-surface-hover"
|
||||
}
|
||||
|
||||
// docsNavClass returns classes for docs sidebar links (server-rendered active
|
||||
// state — there is no client-side highlighter). indent sets the left padding,
|
||||
// deeper for subcategory group items.
|
||||
@@ -322,30 +313,6 @@ func getDomainName(rawURL string) string {
|
||||
return strings.TrimPrefix(hostname, "www.")
|
||||
}
|
||||
|
||||
// formatAlternateInfo formats alternate series info as readable string
|
||||
func formatAlternateInfo(data []byte) string {
|
||||
if len(data) == 0 {
|
||||
return ""
|
||||
}
|
||||
var result map[string]interface{}
|
||||
if err := json.Unmarshal(data, &result); err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
var parts []string
|
||||
if series, ok := result["alternate_series"].(string); ok && series != "" {
|
||||
parts = append(parts, series)
|
||||
}
|
||||
if num, ok := result["alternate_number"].(float64); ok && num > 0 {
|
||||
parts = append(parts, fmt.Sprintf("#%d", int(num)))
|
||||
}
|
||||
if count, ok := result["alternate_count"].(float64); ok && count > 0 {
|
||||
parts = append(parts, fmt.Sprintf("(of %d)", int(count)))
|
||||
}
|
||||
|
||||
return strings.Join(parts, " ")
|
||||
}
|
||||
|
||||
// FormatInTimezone formats a time.Time in the specified timezone as MM-DD-YYYY HH:MM
|
||||
func FormatInTimezone(t time.Time, timezone string) string {
|
||||
if t.IsZero() {
|
||||
@@ -375,10 +342,6 @@ func textToString(t pgtype.Text) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func tagSliceToString(tags []string) string {
|
||||
return strings.Join(tags, ", ")
|
||||
}
|
||||
|
||||
func stringSliceToString(s []string) string {
|
||||
return strings.Join(s, ", ")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user