refactor: dead code cleanup#1873
Conversation
WalkthroughThis PR reduces the frontend module public API surface by deleting six unused modules entirely ( ChangesFrontend Public API Surface Reduction
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/lib/task-utils.ts (1)
171-175: 💤 Low value
countTaskFilesByCategoryappears to be dead code.This function is no longer exported and has no internal callers within this file. The similar
countTaskFileEntriesByCategory(line 153) is exported and used externally. Consider removing this function entirely rather than just de-exporting it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/lib/task-utils.ts` around lines 171 - 175, Remove the countTaskFilesByCategory function entirely (lines 171-175) as it is not exported and has no internal callers within the file. Since countTaskFileEntriesByCategory is already exported and serves the same purpose, the countTaskFilesByCategory wrapper function is redundant dead code that should be deleted completely rather than preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@frontend/lib/task-utils.ts`:
- Around line 171-175: Remove the countTaskFilesByCategory function entirely
(lines 171-175) as it is not exported and has no internal callers within the
file. Since countTaskFileEntriesByCategory is already exported and serves the
same purpose, the countTaskFilesByCategory wrapper function is redundant dead
code that should be deleted completely rather than preserved.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fc6f2d6b-4041-4d45-8fe9-27b89a3359b0
⛔ Files ignored due to path filters (1)
frontend/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (23)
frontend/app/api/mutations/useDeleteDocument.tsfrontend/app/api/mutations/useUpdateSettingsMutation.tsfrontend/app/api/queries/useGetConnectorsQuery.tsfrontend/app/api/queries/useGetOnboardingStatusQuery.tsfrontend/app/api/queries/useGetTaskQuery.tsfrontend/app/settings/_components/model-selectors.tsxfrontend/app/settings/_helpers/model-select-item.tsxfrontend/components/brand-switcher.tsxfrontend/components/cloud-picker/onedrive-v8-handler.tsfrontend/components/cloud-picker/provider-handlers.tsfrontend/components/ui/banner.tsxfrontend/components/ui/sheet.tsxfrontend/components/ui/sidebar.tsxfrontend/enhancements/connectors/ibm-cos/useIBMCOSBucketsQuery.tsfrontend/hooks/use-mobile.tsxfrontend/lib/analytics.tsfrontend/lib/brand.tsfrontend/lib/filter-normalization.tsfrontend/lib/task-error-display.tsfrontend/lib/task-utils.tsfrontend/lib/time-utils.tsfrontend/lib/url-utils.tsfrontend/package.json
💤 Files with no reviewable changes (8)
- frontend/enhancements/connectors/ibm-cos/useIBMCOSBucketsQuery.ts
- frontend/components/brand-switcher.tsx
- frontend/hooks/use-mobile.tsx
- frontend/components/ui/sidebar.tsx
- frontend/app/settings/_components/model-selectors.tsx
- frontend/app/api/queries/useGetOnboardingStatusQuery.ts
- frontend/components/ui/sheet.tsx
- frontend/components/cloud-picker/onedrive-v8-handler.ts
useGetOnboardingStatusQuery.tsmodel-selectors.tsxonedrive-v8-handler.tssheet.tsx,sidebar.tsx,use-mobile.tsx(dead subgraph — sidebar was the only consumer of the other two)useIBMCOSBucketsQuery.tsuseDeleteDocument.ts,useUpdateSettingsMutation.ts,useGetConnectorsQuery.ts,useGetTaskQuery.ts,model-select-item.tsx,brand-switcher.tsx,provider-handlers.ts,banner.tsx,analytics.ts,brand.ts,filter-normalization.ts,task-error-display.ts,task-utils.ts,time-utils.ts,url-utils.tsuseGetFiltersSearchQueryanduseDebounce(both are actually imported by multiple files)Summary by CodeRabbit
Removals
Refactor
Chores