chore: delete dead code (#104) - #110
Open
rahulkr182 wants to merge 1 commit into
Open
rahulkr182 wants to merge 1 commit into
rahulkr182 wants to merge 1 commit into
Conversation
- Delete unused NavLink component (src/components/NavLink.tsx) - Delete uncalled deleteAvatar and deleteBanner functions in storage.ts - Delete unused useTags hook in usePrompts.ts - Remove unused ExternalLink import in Profile.tsx - Remove unused mobileTags/mobileExcludedTags in Index.tsx - Remove unused refreshKey state and redundant onDelete callback in Index.tsx - Remove Sonner component, mounting in App.tsx, and uninstall sonner dependency - Remove redundant .slice(0, 8) on recommendations list capped at 4 in PromptDetail.tsx - Render viewCount in PromptCard and PromptDetail stats - Add verified to UserProfile interface and map in useAuth
aashu2006
requested changes
Sep 8, 2026
aashu2006
left a comment
Member
There was a problem hiding this comment.
the deletions all check out, nice work @rahulkr182 . Two things before merge:
- package-lock.json strips
libcfrom 64 lines with no version changes, which means it was regenerated on an older npm than the repo is on. Please regenerate on current npm so it stops flip-flopping. verifiedonUserProfilehas no consumer.Profile.tsxbuilds its own object and the auth profile never reads it. Either drop it or say what is going to use it. Also needs a rebase because #111 has changedPromptCard.tsxandPromptCard.test.tsx
The view count is fine to keep, viewCount was already a declared but unrendered prop so wiring it up fits the issue.
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.
What does this change?
Fixes #104.
NavLink: deleted unusedsrc/components/NavLink.tsx.deleteAvatar&deleteBanner: removed uncalled functions fromsrc/services/supabase/storage.ts.useTags: removed uncalled hook fromsrc/hooks/usePrompts.ts.ExternalLink: removed unused import fromsrc/pages/Profile.tsx.mobileTags&mobileExcludedTags: removed unused computed state insrc/pages/Index.tsx.refreshKey: removed unusedrefreshKeystate fromsrc/pages/Index.tsx(feed refresh on delete is already handled by TanStack Query's cache invalidation inPromptCard).sonner: removed Sonner component mount insrc/App.tsx, deletedsrc/components/ui/sonner.tsx, and uninstalledsonnerpackage dependency..slice(0, 8): removed redundant.slice(0, 8)insrc/pages/PromptDetail.tsxwhere recommendation queries already cap results at 4.viewCount: renderedviewCountstat withEyeicon insrc/components/prompts/PromptCard.tsxandsrc/pages/PromptDetail.tsx, and added a test inPromptCard.test.tsx.UserProfile.verified: addedverified?: booleantoUserProfileinsrc/lib/types.tsand mappedverified: supabaseProfile.verified ?? falseinsrc/hooks/useAuth.tsx.getProfileByUsernameandgetFollowingCountas noted in the issue for future following feed and username routing.Why?
Removes dead exports, unused components, uncalled hooks, redundant slices, and an unused dependency (
sonner), while displaying the existingviewCountmetric and correctly preservingverifiedon authenticated user profiles.How was it tested?
npm test(all 15 test files, 81 tests passing, including newviewCounttest inPromptCard.test.tsx).npm run lint(0 errors).npm run typecheck(0 errors).npm run build(successful production bundle build; bundle size reduced).npm run db:schema:check(up to date).Checklist
npm run lintpassesnpm run typecheckpassesnpm testpassesnpm run buildpasses/foo.png) is inpublic/, notsrc/assets/.envfiles are included