Skip to content

chore(web): remove unused code and dead exports#1070

Merged
brendan-kellam merged 2 commits intomainfrom
brendan/remove-unused-web-code
Apr 1, 2026
Merged

chore(web): remove unused code and dead exports#1070
brendan-kellam merged 2 commits intomainfrom
brendan/remove-unused-web-code

Conversation

@brendan-kellam
Copy link
Copy Markdown
Contributor

@brendan-kellam brendan-kellam commented Apr 1, 2026

Summary

  • Delete 6 unused files: connection.ts, useBrowsePath.ts, useFindLanguageDescription.ts, lineOffsetExtension.ts, codeHostIconButton.tsx, addRepositoryDialog.tsx
  • Remove unused functions/schemas from actions.ts, serviceError.ts, schemas.ts, utils.ts, publicApiSchemas.ts
  • Clean up orphaned imports (StatusCodes, ErrorCode, NextRequest, TenancyMode, git schema imports)

Test plan

  • tsc --noEmit passes with no errors
  • Verify app builds and runs normally

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Removed deprecated and unused helper functions, React hooks, and components throughout the codebase.
    • Eliminated service error factories and schema validation definitions no longer in use.
    • Removed editor customization extensions and code host integration UI components.
    • Cleaned up onboarding workflow references and database lookup functions.

Remove unused functions, components, hooks, and schemas identified
via ts-unused-exports analysis across the web package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

@brendan-kellam your pull request is missing a changelog!

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

Walkthrough

This PR removes a large set of unused exports and files across the web package, including action helpers, React hooks, components, constants, utility functions, and schema definitions. The changes span multiple feature areas including tenancy enforcement, code editor functionality, repository management, onboarding, and various data utilities.

Changes

Cohort / File(s) Summary
Action & Server-Side Helpers
packages/web/src/actions.ts, packages/web/src/data/connection.ts, packages/web/src/lib/serviceError.ts
Removed tenancy-mode enforcement helper, database connection lookup functions, and error factory utilities (invalidZoektResponse, orgDomainExists, secretAlreadyExists).
Client-Side Hooks
packages/web/src/hooks/useFindLanguageDescription.ts, packages/web/src/app/[domain]/browse/hooks/useBrowsePath.ts
Removed React hooks for language description matching and browse path computation.
UI Components
packages/web/src/app/[domain]/components/codeHostIconButton.tsx, packages/web/src/app/[domain]/components/configEditor.tsx, packages/web/src/app/[domain]/repos/components/addRepositoryDialog.tsx
Removed three client components: code host connection button, JSON config editor with CodeMirror and schema validation, and repository URL dialog form.
Constants & Schemas
packages/web/src/lib/constants.ts, packages/web/src/lib/schemas.ts
Removed OnboardingSteps enum and secret-related Zod request validation schemas.
Utilities & Extensions
packages/web/src/lib/utils.ts, packages/web/src/lib/extensions/lineOffsetExtension.ts, packages/web/src/openapi/publicApiSchemas.ts
Removed utility helpers (isAuthSupportedForCodeHost, isDefined, requiredQueryParamGuard), CodeMirror line offset extension, and OpenAPI schema wrappers for file operations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • PR #588: Modifies the same packages/web/src/lib/utils.ts file to update utility exports and type signatures.
  • PR #597: Modifies packages/web/src/actions.ts with overlapping changes to tenancy-related imports and logic.

Suggested labels

sourcebot-team

Suggested reviewers

  • msukkari
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main objective of the changeset: removing unused code and dead exports from the web package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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 brendan/remove-unused-web-code

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.

@brendan-kellam brendan-kellam merged commit 331f025 into main Apr 1, 2026
8 checks passed
@brendan-kellam brendan-kellam deleted the brendan/remove-unused-web-code branch April 1, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant