Skip to content

Daily dead-code sweep 2026-10-04: unused sprite symbols i-bin, i-tick - #169

Open
EnesYilmazcode wants to merge 4 commits into
mainfrom
deadcode/2026-10-04
Open

EnesYilmazcode wants to merge 4 commits into
mainfrom
deadcode/2026-10-04

Conversation

@EnesYilmazcode

Copy link
Copy Markdown
Owner

Checked against the open sweep PRs first, per the routine's rule: #148, #147, #146, #144, #143 are all still open, waiting on review. Read every diff before looking for anything new. Between them they already claim:

None of that is touched again here, and none of it is re-listed as a finding below.

Found: two unused SVG sprite symbols (certain)

index.html defines a shared <svg> sprite sheet once, up top, and every icon in the app is a <use href="#i-..."> against it. Two of the defined symbols are never referenced by any <use> anywhere:

  • #i-bin — a trash-can icon, index.html:1097-1099 (before this PR)
  • #i-tick — a checkmark icon, index.html:1100

How I proved it dead:

  • git log -S "i-bin" / -S "i-tick" on index.html turns up exactly one commit each, The answer is one card you swipe, not a list you scan #119 ("The answer is one card you swipe, not a list you scan"), which introduced the swipe-card deck. That deck's two verdict buttons (#c-no/#c-yes in js/app.js) render as a pin icon (#i-pin, "Show route") and a chevron (#i-chev, "Next room") plus text stamps — <span class="c-stamp no">NEXT</span> / <span class="c-stamp yes">GO</span> — not a tick or a bin. The two symbols are leftovers from a design that didn't ship this way.
  • Grepped i-bin and i-tick as literal strings across js/, index.html, dev/, scripts/, docs/, spikes/: the only hits are the two <symbol id="..."> definitions themselves.
  • Checked for any dynamic href construction (a template literal building #i-${name}) that could reach them indirectly — there is none. Every <use href="#i-..."> in the whole app is a static string literal, so this grep is exhaustive, not a sample: there is no code path, reachable or not, that can ever ask for #i-bin or #i-tick.
  • No test references either name (grep -rn "i-tick\|i-bin" scripts/test/) — nothing pins the sprite sheet's shape.

This is the one case in this sweep where static proof is actually stronger than a runtime trace: coverage can only tell you a reachable branch didn't run today, but there is no branch of any kind, anywhere in the shipped code, that can produce the string "i-bin" or "i-tick" at runtime. Driving the real app (card deck swipes, every refusal screen, the day calendar, the browse/pick/about panes, ?dev=1, offline reload, a blocked-fetch boot failure) only reconfirmed the same thing by absence: no screen ever lit either icon up, because nothing can ask for it.

What would make me wrong: a future PR that's already in flight and adds a delete/confirm icon reusing one of these ids by name instead of adding a new symbol. I didn't find any such branch or open PR, open or merged.

Also re-measured: sw.js shell gzip figure

Removing the two symbols shrinks index.html by 47 bytes gzipped. The header comment's figure had already drifted from several unrelated merges since it was last measured (2026-09-16 → today), so I re-measured all shell and data files exactly as the comment prescribes (git show HEAD:<file> | gzip -9 -c | wc -c, through the pipe) and ran node scripts/stamp-sw.mjs. scripts/test/sw.test.mjs's 1% shell tolerance was never actually at risk (the drift is ~0.2%), but the comment is a measurement record, not a guess, so it's updated rather than left stale.

Driven and checked

  • node --test: baseline green before touching anything (935 tests, 931 pass, 4 skipped, 0 fail) and green after (same counts).
  • Drove a real headless-Chrome instance (scripts/lib/browser.mjs + scripts/lib/pinned-clock.mjs, both wall clock and animation clock pinned) through: normal weekday boot, duration choice, the swipe-card deck (both verdict directions), the ranked list, a room's day calendar and its arrows, browse buildings, the building picker, "What Vacant knows", the menu, weekday-evening gate → buildings screen, Saturday 3am, Thanksgiving Day (CAMPUS_CLOSED), finals week (EXAM_REFUSAL), before-term-start (BETWEEN_TERMS), after-term-end (TERM_ENDED), ?dev=1, and /dev/.
  • Also ran static cross-checks: the existing scripts/check-dead-code.mjs (reports clean against current main, as expected — the sprite ids aren't identifiers it tracks), and a custom script to find every exported js//scripts/lib/ name whose only outside-file reference is a test file. That surfaced the five names the open PRs above already claim, plus scripts/lib/fetch.mjs's resetRequests/setRequests — which I did not remove, because the file says outright "Tests only, so the cap can be exercised without making 3000 stub calls". That's a deliberate test seam, not a fossil.
  • node scripts/shoot.mjs --check: three pre-existing failures (list: the map is on screen with nothing on it, list: the sheet rests at 324px, not over the map, room: the sheet did not drop) reproduce identically on unmodified main in this environment — confirmed by stashing this PR's changes and re-running against main's files directly. Not caused by this PR; not something I attempted to fix, since it's outside this sweep's scope and unrelated to the two deleted sprite symbols.

Not removed, not proven

Nothing else cleared the bar today. Everything flagged by the test-only-export search beyond the two sprite symbols and the already-claimed five either turned out to be a constant genuinely consumed inside its own module (ranking weights in js/engine.js, sheet geometry constants in js/sheet.js, etc. — reachable from production via the function that uses them, just not imported by name elsewhere) or the documented test seam in fetch.mjs noted above. I didn't find any CSS selector, data-* hook, or state field that failed every check — every class in index.html's stylesheet resolves to at least one use outside the <style> block.


🤖 Generated with Claude Code

https://claude.ai/code/session_01Ui7SPvLZPpTpR2fXhKEgSp


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants