Repository navigation
Dead code: remove unused entries (3 commits) - #26
Open
Avithegod2010 wants to merge 3 commits into
Open
Avithegod2010 wants to merge 3 commits into
Avithegod2010 wants to merge 3 commits into
Conversation
Proof: a repo-wide import scan of every tracked file (case-sensitive, incl.
config/tests/manifests) found zero importers for these 25 UI components; the
other 5 (separator, skeleton, toggle, tooltip, use-mobile) were imported only
by two of the removed files (sidebar/toggle-group), so they orphan in the same
group. Apparent hits were unrelated: CSS theme tokens (--card, --sidebar-*),
lucide CalendarRange icon, 'report card' prose, document.createElement('textarea'),
and the local ui/toaster's Toaster (not sonner's). compose-worker/filter-worker
were NOT removed - they are loaded via new Worker(new URL(...)) at runtime.
src/lib/server-api.ts exported HAS_SERVER_API but had zero importers: every consumer (doctor-card, listen-button, presets-card, printifier-app, stats-strip, upload-step, voice-bar, printify-store) declares its own inline const for build-time constant folding. Repo-wide case-sensitive search found the name only in those inline declarations and in comments explaining why the shared export is NOT imported; no test, config, route table or dynamic import references it. It is not an entry point.
- useCanInstall (install-prompt.tsx): zero callers; comment said 'kept for future mobile-menu placement'. InstallButton uses the same module-scope subscribe/canInstall store directly, so the import stays needed. - buildErasedOverlay (filters.ts): DOM data-URL wrapper around buildErasedOverlayPixels; no caller. The preview path uses the pixel core directly in filter-preview-core/filter-worker, so this is the orphaned predecessor implementation. - OcrLang (ocr.ts): exported string-literal type, never imported; callers use string[]/FilterSettings['ocrLangs']. Proved by case-sensitive repo-wide search over all tracked files: each name's only occurrence was its own definition.
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.
Dead-code removal found by a per-repo audit thread (free model) and verified against this repo's own checks.
Commits:
Per-repo report (removed / kept-with-reason / verification):
src/components/ui/{alert-dialog,aspect-ratio,avatar,breadcrumb,calendar,card,carousel,checkbox,context-menu,drawer,dropdown-menu,form,hover-card,input-otp,menubar,navigation-menu,pagination,resizable,scroll-area,sidebar,sonner,table,tabs,textarea,toggle-group,separator,skeleton,toggle,tooltip}.tsxplussrc/hooks/use-mobile.ts; the last 5 were cascading orphans whose only importers were the removedsidebar/toggle-group);src/lib/server-api.ts(HAS_SERVER_API, orphaned by inline copies in 8 consumers); unreferenced exportsuseCanInstall(install-prompt.tsx),buildErasedOverlay(filters.ts, superseded bybuildErasedOverlayPixels+ worker preview),OcrLang(ocr.ts). Three commits:589fe73(files),efeb952(module),abee7b0(symbols).compose-worker.ts/filter-worker.ts(loaded vianew Worker(new URL('./…', import.meta.url)));android/res/values/{strings,styles}.xml(manifest@string/app_name,@style/AppTheme); 6 Tesseract.traineddata.gzfiles (guj,kan,mal,ori,pan,tel) loaded vialangPath+ UI<SelectItem>codes; 2 PDF.jsLICENSE_*notices (legal artifacts, not code); 11scripts/*.tsabsent from package.json (standalone CLI entry points runnable viabun <path>— absence fromscriptsis not proof of being dead). Also left alone: unused Radix/embla/vaul/etc. dependencies (hard rule forbids dependency changes) and orphaned--sidebar-*CSS theme tokens (minimum-edit rule).node node_modules/typescript/bin/tsc --noEmit --incremental false(exit 0 before and after);bun testper unit file (filters 8/8, ink-stats 11/11, rate-limit 7/7, ssrf-guard 37/37, version 5/5, ai-access 32/32; savings, recipe-link and settings-validate each had the same pre-existing 5sdone-callback timeout flake on one test at baseline and after, never a new failure);git diff --checkclean.tests/api/routes.test.tshung >180s at baseline (network/DB), so it was not used as a gate. Branchcode-audit/Notes-printifierfromsecurity/audit-2026-11at019ae83; nothing pushed.