Skip to content

Remove batch of dead code#5918

Merged
lkostrowski merged 8 commits intomainfrom
remove-dead-code-5
Oct 1, 2025
Merged

Remove batch of dead code#5918
lkostrowski merged 8 commits intomainfrom
remove-dead-code-5

Conversation

@lkostrowski
Copy link
Member

@lkostrowski lkostrowski commented Oct 1, 2025

Summary

This PR removes a significant batch of unused code across multiple modules, improving codebase maintainability and reducing bundle size. The changes primarily remove:

  • Deprecated webhook components from custom-apps/ that have been superseded by implementations in extensions/
  • Unused plugin UI components including authorization, settings, and channel configuration
  • Legacy sale discount components that are no longer in use
  • Dead code across various modules including fixtures, utilities, type definitions, and URL helpers

Key Changes

Webhook Management (src/custom-apps/components/)

  • Removed deprecated WebhookDetailsPage, WebhookEvents, WebhookHeaders, WebhookInfo, WebhookStatus, and WebhookSubscriptionQuery components
  • Updated remaining components to import from @dashboard/extensions/ instead
  • Cleaned up related handlers, utilities, and test files

Plugin System (src/plugins/)

  • Removed unused plugin UI components: PluginAuthorization, PluginDetailsChannelsCard, PluginInfo, PluginSecretFieldDialog, PluginSettings, PluginsDetailsPage
  • Removed PluginDetails.test.ts and PluginsDetails.tsx view
  • Cleaned up plugin fixtures, utilities, and URL helpers

Discounts (src/discounts/)

  • Removed deprecated Sale components: SaleDetailsPage, SaleInfo, SaleListPage, SaleType, SaleValue
  • Removed sale-related handlers and sort utilities
  • Updated channel utilities to remove sale-specific functions

Other Modules

  • Removed ControlledSwitch component from src/components/
  • Cleaned up unused fixtures in apps, channels, and modeling modules
  • Removed unused type exports and URL helpers across multiple files
  • Simplified filter utilities in giftCards and modeling modules

Impact

  • 4,512 lines removed across 79 files
  • Improved code maintainability by removing unused components
  • Reduced potential confusion from duplicate/deprecated implementations
  • No functional changes to existing features

Testing

  • Verified that removed code has no active references in the codebase
  • Confirmed that remaining webhook functionality uses the correct implementations from extensions/
  • All existing functionality continues to work as expected

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings October 1, 2025 10:28
@changeset-bot
Copy link

changeset-bot bot commented Oct 1, 2025

⚠️ No Changeset found

Latest commit: 63f8cbe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Oct 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
saleor-dashboard-storybook Ignored Ignored Preview Oct 1, 2025 11:41am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

A comprehensive cleanup of dead code across the dashboard application, focusing on removing unused functions, components, and utilities primarily in the plugins, filtering, and channel management modules.

  • Removed entire plugin management system including views, components, and utilities
  • Cleaned up unused filter helper functions and autocomplete field implementations
  • Removed unused channel and discount management utilities

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/filters/fields.ts Removed unused createAutocompleteField function and related imports
src/plugins/views/utils.ts Deleted entire utility file containing plugin helper functions
src/plugins/views/PluginsDetails.tsx Removed complete plugin details view component
src/plugins/views/PluginDetails.test.ts Deleted test file for removed plugin details functionality
src/plugins/utils.ts Removed plugin utility functions
src/plugins/urls.ts Cleaned up unused URL constants and functions
src/plugins/fixtures.ts Deleted plugin test fixtures
src/plugins/components/... Removed multiple plugin component files
src/modeling/views/PageList/sort.ts Removed unused filter function
src/modeling/views/PageList/filters.ts Cleaned up unused filter creation utilities
src/giftCards/GiftCardsList/filters.ts Removed unused filter structure and variable functions
src/discounts/views/SaleList/sort.ts Removed unused sort utilities
src/discounts/handlers.ts Deleted unused sale channel handler function
src/discounts/components/... Cleaned up unused default exports
src/custom-apps/utils.tsx Removed unused GraphQL introspection query
src/custom-apps/urls.ts Cleaned up unused URL utilities
src/custom-apps/components/WebhookDetailsPage/WebhookDetailsPage.tsx Changed export from named to default
src/components/Filter/index.ts Removed unused default export
src/channels/utils.ts Removed unused sale-related channel utilities
src/apps/urls.ts Cleaned up unused URL path functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot temporarily deployed to pr-5918 October 1, 2025 10:31 Destroyed
Copilot AI review requested due to automatic review settings October 1, 2025 11:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 79 out of 79 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot temporarily deployed to pr-5918 October 1, 2025 11:14 Destroyed
@lkostrowski lkostrowski added skip changeset Use if your changes doesn't need entry in changelog run pw-e2e Run e2e (basic suite from PR automation) labels Oct 1, 2025
@lkostrowski lkostrowski marked this pull request as ready for review October 1, 2025 11:38
@lkostrowski lkostrowski requested a review from a team as a code owner October 1, 2025 11:38
@lkostrowski lkostrowski enabled auto-merge (squash) October 1, 2025 11:45
@lkostrowski lkostrowski merged commit 0cb3eb6 into main Oct 1, 2025
15 of 17 checks passed
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.64%. Comparing base (ac446a7) to head (63f8cbe).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5918      +/-   ##
==========================================
- Coverage   39.69%   39.64%   -0.05%     
==========================================
  Files        2624     2582      -42     
  Lines       41667    40888     -779     
  Branches     9398     9219     -179     
==========================================
- Hits        16538    16210     -328     
+ Misses      25102    23444    -1658     
- Partials       27     1234    +1207     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lkostrowski lkostrowski deleted the remove-dead-code-5 branch October 1, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run pw-e2e Run e2e (basic suite from PR automation) skip changeset Use if your changes doesn't need entry in changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants