Repository navigation
Daily dead-code sweep 2026-10-10: the gesture teardown nothing calls - #176
Open
EnesYilmazcode wants to merge 2 commits into
Open
EnesYilmazcode wants to merge 2 commits into
EnesYilmazcode wants to merge 2 commits into
Conversation
attachGestures returned a closure that removed its listeners and put the canvas's touch-action back. Both callers, js/app.js and dev/index.html, call it as a bare statement and throw the return value away, and no test, spike or script imports attachGestures, so nothing in the repo can ever reach that closure. priorTouchAction existed only for it. Runtime coverage agrees: precise V8 coverage unioned across every state the app has (the question, card, way, list, room and its day nav, the buildings, picker and browse screens, every refusal, the evening gate, offline and cold boots, boot failure, ?dev=1 and /dev/, desktop with a fine pointer) records zero calls of it. Nothing about how the map handles a finger changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J1FPsM3kXNTAGmu8tYszr3
`git show HEAD:<file> | gzip -9 -c | wc -c` over the shell list: 168,778 bytes, data 116,297. js/map.js went from 9,540 to 9,466. The README's rounded shell figure moves from 164 to 165 KB with it; most of that drift was already on main, which measured 168,852 before this branch. Shell cache restamped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J1FPsM3kXNTAGmu8tYszr3
This was referenced Oct 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checked against the open sweep PRs first: #175, #169, #148, #147, #146, #144, #143 are all still open. Read every diff before sweeping, and left their claims alone even where I re-encountered the same code (
inBounds,bestGap,inScheduledHours,allWeekCodes,directions.matrix/MATRIX_MAX, thegenerationgetter,i-bin/i-tick,TERM_NAMES,#chips) — nothing below duplicates them.Baseline
node --teston main: 938 tests, 934 pass, 4 skipped, 0 fail. Same on this branch.node scripts/check-dead-code.mjssays "no dead code" on both (this finding is a return value nothing ever assigns, which that checker doesn't look for).Removed
js/map.js:627/js/map.js:710-719— the teardown closureattachGesturesreturns, and thepriorTouchActionit exists to restore.attachGestures(canvas, {...})ends withreturn () => { removeEventListener × 6; canvas.style.touchAction = priorTouchAction; pointers.clear(); }. It has exactly two call sites in the whole repo,js/app.js:3972anddev/index.html:203, and both are bare statements —attachGestures($('map'), {...});— that discard the return value.priorTouchActionexists only to be restored inside that same closure, so it goes with it.How I proved it dead:
attachGestures's return value. It's unchanged since the initial squash commit (8323b68), with no DECISIONS.md entry asking to keep it.scripts/lib/browser.mjs+scripts/lib/pinned-clock.mjs, the wayscripts/shoot.mjsdoes) drove ~207 steps across the question screen, every card gesture, the way screen, the ranked list, room selection and its day calendar with both day-nav arrows, the buildings screen via the evening gate (five different pinned times), the building picker, "What Vacant knows", every refusal state (campus closed, exam week, between terms, term ended, schedule-dark, truncated index), offline reload (both cache-controlled and cold), the boot-failure card, install prompts on three platforms, desktop hover/pointer states, and?dev=1//dev//dev/warp.htmlin full. Precise V8 coverage over all of it recorded zero calls for the closure.What would make this wrong: a consumer outside this repo importing
js/map.jsdirectly (none exists — it's a static site with no package boundary), or a planned future caller that was going to start assigning the return value. It's the same shape as #175'sgenerationgetter.Also re-measured and re-stamped, since this changes
js/map.js's gzipped size:scripts/test/sw.test.mjsre-derives the header's byte figures from the committed blobs, so leaving them stale would turn the suite red.sw.js: header comment now says Shell 168,778 bytes (was 167,466),SHELL_CACHErestamped vianode scripts/stamp-sw.mjs.README.md: "164 KB of shell" → "165 KB", whichscripts/test/readme.test.mjsrequires to match the rounded shell figure.Most of that byte drift (168,852 measured vs. 167,466 in the stale header) predates this PR — it's what the other six open sweep PRs are also catching up on. This PR's own deletion is small:
js/map.jsalone goes from 9,540 to 9,466 gzipped bytes.I did not run
scripts/shoot.mjs --checkfor this one: the deleted code is an unreachable return value with no behavioral path, so it can't affect a rendered frame. (For what it's worth,--checkalready reports 3 pre-existing FAILs on an untouched main worktree — unrelated to this change.)Heads up on merge order: the
sw.jsheader/stamp lines and the README KB line are also touched by the 2026-09-27, 2026-09-29 and 2026-10-04 branches, so whichever of these merges last will need its author (or me, next run) to re-measure and restamp again. Same situation those earlier PRs already have with each other.Not removed, not proven
A real bug, not dead code — flagging it here since the coverage run surfaced it, but I didn't touch it (behavior change, out of scope for a dead-code sweep):
js/app.js:1155reads a variablefilteredthat commit b9397a6 ("Remove the room needs filter", 2026-09-23) deleted the declaration of. Whenever the ranked answer is empty (!state.results.length),paintList()throwsReferenceError: filtered is not defined, which aborts before the empty-state screen renders. Reproduced it 20 times while driving dead rooms/truncated-index states in the sweep harness. Worth a look — possibly a one-line fix (drop the deadfiltered ? asked() : ''clause, sincefilteredcan't exist).Everything else flagged by zero coverage and checked off as legitimately kept (accessibility affordances, defensive/error branches, tested-but-rare ladder rungs, the Google-success path which is blocked by design in headless, pinch gestures CDP can't drive, writing-direction and reduced-motion CSS, etc.) — full list and the proof for each is in the sweep notes below, kept out of the diff itself.
Full "not removed, not proven" list
syncPaneTouch/closeMenuinitial no-op placeholders (reassigned before use); the empty-cardc-listhandler (unreachable only because of thefilteredbug above);noDoors;locate'sfail/error callback;loadShorts/openDevcatches; the Google steps render (blocked on purpose); thebrowse-search/findformpreventDefaulthandlers.opens-at,further,anywhere,longest— all inRUNGSand pinned by tests; the array-shapedclosedtolerance.closed; thenextDoortie-break (needs an exact walk-distance tie);createWatch'sget id/get open(asserted in follow.test.mjs).plainText(Google success path, tested); the maps loader/callback; theconsentdefault parameter.get pending(map.test.mjs);spread(two-finger pinch — CDP touch events hang the map's animation loop, documented in shoot.mjs).metresToPoint— called bydocs/research/walking-graph-sample.mjs, a runnable script, not a bare doc mention.reg.updatecatch; the Refresh button's reload.[dir="rtl"] .ico-mirror(writing-direction affordance, unreachable in an LTR run by design);.blk.tight(needs a sufficiently short block, none in the driven data);.steps-list/.steps-m/.steps-src(Google success path); reduced-motion.c-card.snap/.bar(accessibility);@container … .b-row .b-hours(needs closed rows in a narrow container);body.carding .c-admits …(needs a card with admits text); warp's.out.bad(error state).🤖 Generated with Claude Code
https://claude.ai/code/session_01J1FPsM3kXNTAGmu8tYszr3
Generated by Claude Code