Skip to content

refactor: standardize shared configs, dialogs, and component structure#627

Merged
nanaf6203-bit merged 4 commits into
MettaChain:mainfrom
suleimanjem-hash:newIssue
Jun 30, 2026
Merged

refactor: standardize shared configs, dialogs, and component structure#627
nanaf6203-bit merged 4 commits into
MettaChain:mainfrom
suleimanjem-hash:newIssue

Conversation

@suleimanjem-hash

Copy link
Copy Markdown
Contributor

Summary

This PR improves the application's maintainability, consistency, and user experience by centralizing shared configuration, standardizing confirmation dialogs, refactoring large components into reusable modules, and enhancing the gas estimator with a user-friendly cost breakdown.

Changes

Refactoring

  • Centralized chain IDs and wallet identifiers into shared configuration modules to eliminate scattered magic strings and numbers.
  • Replaced ad-hoc confirmation flows with a shared confirmation dialog component to provide a consistent user experience across the application.
  • Refactored large components by extracting shared helper functions, reusable components, and type definitions into dedicated files, improving readability and maintainability.

UX Improvements

  • Enhanced the Gas Estimator to display:

    • Approximate USD equivalent of the estimated gas fee.
    • Confidence indicator for gas estimates.
    • Informational disclaimer clarifying that gas costs are estimates and may vary based on network conditions.

Testing

  • Added/updated unit tests covering:

    • Shared configuration modules.
    • Shared dialog behavior.
    • Extracted helper functions.
    • Gas estimator UI and estimation logic.

Documentation

  • Updated relevant documentation and inline comments to reflect the new shared configuration, dialog system, refactored component structure, and gas estimation behavior.

Benefits

  • Removes duplicated configuration values and improves consistency.
  • Standardizes confirmation dialogs throughout the application.
  • Improves component organization and maintainability.
  • Provides users with more informative and transparent gas fee estimates.
  • Preserves existing functionality while improving code quality and user experience.

Closes #509

Closes #511

Closes #513

Closes #521

@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@suleimanjem-hash Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Copy link
Copy Markdown
Contributor

Nice refactor — unifying configs and dialogs into one shape is exactly the cleanup this codebase needed. LGTM. Merging.

@nanaf6203-bit nanaf6203-bit merged commit 0e286e7 into MettaChain:main Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants