Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 2.2 KB

File metadata and controls

70 lines (52 loc) · 2.2 KB

Deduplication Report - PR #3090 Phase 2

Summary

Removed ~580 lines of duplicate code from tangle-dapp and tangle-cloud that already exist in tangle-shared-ui.

Completed Deduplication

1. ErrorMessage.tsx (90 lines removed)

Files Deleted:

  • apps/tangle-cloud/src/components/ErrorMessage.tsx
  • apps/tangle-dapp/src/components/ErrorMessage.tsx

Imports Updated: 20 files now import from @tangle-network/tangle-shared-ui/components/ErrorMessage

2. InputWrapper.tsx (166 lines removed)

Files Deleted:

  • apps/tangle-dapp/src/components/InputWrapper.tsx

Imports Updated: AmountInput, TextInput, PercentageInput, AddressInput

3. InputAction.tsx (41 lines removed)

Files Deleted:

  • apps/tangle-dapp/src/components/InputAction.tsx

4. useInputAmount.ts (192 lines removed)

Files Deleted:

  • apps/tangle-dapp/src/hooks/useInputAmount.ts

Imports Updated: AmountInput.tsx

5. parseChainUnits.ts (64 lines removed)

Files Deleted:

  • apps/tangle-dapp/src/utils/parseChainUnits.ts

6. cleanNumericInputString.ts (19 lines removed)

Files Deleted:

  • apps/tangle-dapp/src/utils/cleanNumericInputString.ts

Imports Updated: useCustomInputValue.ts

7. ErrorsContext/ directory (55 lines removed)

Files Deleted:

  • apps/tangle-dapp/src/context/ErrorsContext/ErrorsContext.ts
  • apps/tangle-dapp/src/context/ErrorsContext/useErrorCountContext.ts
  • apps/tangle-dapp/src/context/ErrorsContext/index.ts

Build Status

  • ✅ tangle-cloud: Builds successfully
  • ⚠️ tangle-dapp: Has pre-existing build errors unrelated to this PR (graphql export issue)

Files Not Deduplicated (Intentionally Different)

AmountInput.tsx

  • tangle-dapp version is almost identical but kept for now
  • Only difference is import paths (uses full package path vs relative)
  • Could be unified in future PR

OperatorsTable.tsx

  • Different implementations serving different purposes
  • tangle-dapp version wraps the shared-ui version
  • Intentionally different

Total Line Reduction

Category Lines Removed
Components 297
Hooks 192
Utils 83
Context 55
Total ~580 lines