Skip to content

refactor: dead code cleanup#1873

Open
mfortman11 wants to merge 1 commit into
mainfrom
dead-code-cleanup
Open

refactor: dead code cleanup#1873
mfortman11 wants to merge 1 commit into
mainfrom
dead-code-cleanup

Conversation

@mfortman11

@mfortman11 mfortman11 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor
  • 7 unused files deleted:
    • useGetOnboardingStatusQuery.ts
    • model-selectors.tsx
    • onedrive-v8-handler.ts
    • sheet.tsx, sidebar.tsx, use-mobile.tsx (dead subgraph — sidebar was the only consumer of the other two)
    • useIBMCOSBucketsQuery.ts
  • 32 unused exports de-exported (removed export keyword, kept functions that are used internally) across 15 files: useDeleteDocument.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.ts
  • 2 unused dependencies removed: radix-ui, zustand
  • 2 false positives skipped: useGetFiltersSearchQuery and useDebounce (both are actually imported by multiple files)

Summary by CodeRabbit

  • Removals

    • Removed OneDrive File Picker support for personal accounts.
    • Removed sidebar navigation UI component.
    • Removed sheet/modal UI component.
    • Removed onboarding status detection.
  • Refactor

    • Consolidated internal API functions and made query helpers module-private to reduce public API surface.
    • Removed mobile detection utilities.
  • Chores

    • Updated UI library dependencies.

@github-actions github-actions Bot added community frontend 🟨 Issues related to the UI/UX refactor labels Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR reduces the frontend module public API surface by deleting six unused modules entirely (sheet.tsx, sidebar.tsx, onedrive-v8-handler.ts, useIBMCOSBucketsQuery.ts, useGetOnboardingStatusQuery.ts, model-selectors.tsx, use-mobile.tsx) and removing export keywords from symbols that are only consumed within their own files across API queries, mutations, lib utilities, and UI components. Two package dependencies (radix-ui, zustand) are also removed.

Changes

Frontend Public API Surface Reduction

Layer / File(s) Summary
Deleted unused modules
frontend/components/ui/sheet.tsx, frontend/components/ui/sidebar.tsx, frontend/components/cloud-picker/onedrive-v8-handler.ts, frontend/enhancements/connectors/ibm-cos/useIBMCOSBucketsQuery.ts, frontend/app/api/queries/useGetOnboardingStatusQuery.ts, frontend/app/settings/_components/model-selectors.tsx, frontend/hooks/use-mobile.tsx, frontend/components/brand-switcher.tsx, frontend/components/cloud-picker/provider-handlers.ts, frontend/components/ui/banner.tsx
Six files are deleted entirely (Sheet, Sidebar, OneDriveV8Handler, IBM COS buckets query, onboarding status query, ModelSelectors component, useIsMobile hook). BrandSwitcher is converted from default to named export. GoogleDriveHandler, OneDriveHandler, BannerContext, and BannerClose are made module-internal.
Internalized exports in API queries and mutations
frontend/app/api/mutations/useDeleteDocument.ts, frontend/app/api/mutations/useUpdateSettingsMutation.ts, frontend/app/api/queries/useGetConnectorsQuery.ts, frontend/app/api/queries/useGetTaskQuery.ts
deleteDocumentByFilename, UpdateSettingsError, CONNECTORS_QUERY_KEY_ROOT, connectorsQueryKey, useConnectorsQueryKey, connectorUserAccessQueryKey, and TASK_DETAIL_QUERY_KEY have their export keywords removed; all remain used internally.
Internalized exports in lib utilities
frontend/lib/analytics.ts, frontend/lib/brand.ts, frontend/lib/filter-normalization.ts, frontend/lib/task-error-display.ts, frontend/lib/task-utils.ts, frontend/lib/time-utils.ts, frontend/lib/url-utils.ts
Twenty helpers across seven utility modules lose their export declarations: analytics tracking helpers, isConnectorAllowedByWorkspace, normalizeSelectedFilters, task failure summary builders, nine task-utils helpers, time formatting helpers, and Langflow URL derivers.
Package dependency removal
frontend/package.json
radix-ui and zustand removed from dependencies.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • langflow-ai/openrag#1696: Modifies useDeleteDocument.ts in the same area as this PR, previously exporting deleteDocumentByFilename which this PR internalizes.
  • langflow-ai/openrag#1700: Touches task-error-display.ts and useGetTaskQuery.ts — the same files where this PR strips buildFailureSummary, buildPipelineStepsFromFailurePhase, and TASK_DETAIL_QUERY_KEY exports.
  • langflow-ai/openrag#1609: Modifies OneDriveHandler in provider-handlers.ts, the same class this PR makes module-internal.

Suggested reviewers

  • lucaseduoli
  • ricofurtado
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: dead code cleanup' is clear, concise, and accurately describes the main objective of the changeset—removing unused code, exported functions, and dead dependencies.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dead-code-cleanup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
frontend/lib/task-utils.ts (1)

171-175: 💤 Low value

countTaskFilesByCategory appears 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

📥 Commits

Reviewing files that changed from the base of the PR and between 14b1646 and a582437.

⛔ Files ignored due to path filters (1)
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (23)
  • frontend/app/api/mutations/useDeleteDocument.ts
  • frontend/app/api/mutations/useUpdateSettingsMutation.ts
  • frontend/app/api/queries/useGetConnectorsQuery.ts
  • frontend/app/api/queries/useGetOnboardingStatusQuery.ts
  • frontend/app/api/queries/useGetTaskQuery.ts
  • frontend/app/settings/_components/model-selectors.tsx
  • frontend/app/settings/_helpers/model-select-item.tsx
  • frontend/components/brand-switcher.tsx
  • frontend/components/cloud-picker/onedrive-v8-handler.ts
  • frontend/components/cloud-picker/provider-handlers.ts
  • frontend/components/ui/banner.tsx
  • frontend/components/ui/sheet.tsx
  • frontend/components/ui/sidebar.tsx
  • frontend/enhancements/connectors/ibm-cos/useIBMCOSBucketsQuery.ts
  • frontend/hooks/use-mobile.tsx
  • frontend/lib/analytics.ts
  • frontend/lib/brand.ts
  • frontend/lib/filter-normalization.ts
  • frontend/lib/task-error-display.ts
  • frontend/lib/task-utils.ts
  • frontend/lib/time-utils.ts
  • frontend/lib/url-utils.ts
  • frontend/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

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

Labels

community frontend 🟨 Issues related to the UI/UX refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant