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:
John O'Keefe committed 2026-10-25 11:06:08 -04:00
1 parent 8733e83f1f
commit 8631aa00bf
107 files changed
+689 -3443

No files matched your search

-40
View File
@@ -967,45 +967,6 @@ func findNodeAtCharOffset(root *html.Node, targetOffset int) (*html.Node, int) {
return found, currentOffset
}
func (c *CFIConverter) computePercentage(xp *CREXPointer, target *html.Node, remainingOffset int) float64 {
spine, err := c.loadSpine()
if err != nil {
return -1
}
charOffset := 0
for i := 1; i < xp.FragmentIndex; i++ {
doc, _, err := c.getContentDoc(i)
if err != nil {
continue
}
body := findBody(doc)
if body != nil {
charOffset += countTextChars(body)
}
}
charOffset += countTextCharsBefore(target)
charOffset += remainingOffset
totalChars := int64(0)
for i := range spine.items {
doc, _, err := c.getContentDoc(i + 1)
if err != nil {
continue
}
body := findBody(doc)
if body != nil {
totalChars += int64(countTextChars(body))
}
}
if totalChars <= 0 {
return -1
}
return float64(charOffset) / float64(totalChars)
}
type indexedNode struct {
node *html.Node
textChunk []*html.Node
@@ -1157,7 +1118,6 @@ func findTextChunk(parent *html.Node, textNode *html.Node) (int, int, string) {
return -1, 0, ""
}
func findElementCFIIndex(parent *html.Node, element *html.Node) int {
indexed := indexChildNodes(parent)
for i, node := range indexed {