dashboard.js: dead code — write-only localStorage key and unused sortTable() function #79

Open
opened 2026-09-01 00:07:13 -04:00 by jared · 0 comments
Owner

Severity: Low (cleanup)

Two small dead-code items found during a deep pass on dashboard.js state management:

  1. ticketViewMode localStorage key is write-only. setViewMode() (~line 1218) writes localStorage['ticketViewMode'], but nothing anywhere reads that key back — the actual table/kanban view-mode restoration on page load (~lines 1365-1372) reads a completely different key, lt_activeTab_<path>, written by lt.tabs in base.js:286. Not a functional bug (the real state persists correctly via the other mechanism) but confusing dead code that looks load-bearing and isn't.
  2. The local sortTable(table, column) function (~lines 384-449, ~65 lines) has zero callers. Table sorting is actually wired via initTableSorting()lt.sortTable.init() in base.js.

Fix: Delete both — the unused ticketViewMode write and the dead sortTable() function — to reduce confusion for future maintainers.

**Severity:** Low (cleanup) Two small dead-code items found during a deep pass on dashboard.js state management: 1. **`ticketViewMode` localStorage key is write-only.** `setViewMode()` (~line 1218) writes `localStorage['ticketViewMode']`, but nothing anywhere reads that key back — the actual table/kanban view-mode restoration on page load (~lines 1365-1372) reads a completely different key, `lt_activeTab_<path>`, written by `lt.tabs` in `base.js:286`. Not a functional bug (the real state persists correctly via the other mechanism) but confusing dead code that looks load-bearing and isn't. 2. **The local `sortTable(table, column)` function (~lines 384-449, ~65 lines) has zero callers.** Table sorting is actually wired via `initTableSorting()` → `lt.sortTable.init()` in base.js. **Fix:** Delete both — the unused `ticketViewMode` write and the dead `sortTable()` function — to reduce confusion for future maintainers.
jared added the dead-codepriority/low labels 2026-09-08 10:15:48 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#79