-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: send send form high fee dialog #5350
base: dev
Are you sure you want to change the base?
Conversation
a28df65
to
6c4cee0
Compare
Important Auto Review SkippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent updates focus on enhancing the handling of high fee warnings across various components in a React application. The primary change involves centralizing the state management for high fee warnings using a context provider, thereby simplifying interactions and improving maintainability. This affects multiple components related to transaction forms and fee handling, streamlining their integration and interaction with the new context system. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
Actions PerformedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (14)
- src/app/features/stacks-high-fee-warning/stacks-high-fee-dialog.tsx (3 hunks)
- src/app/features/stacks-high-fee-warning/stacks-high-fee-warning-container.tsx (1 hunks)
- src/app/features/stacks-transaction-request/stacks-transaction-signer.tsx (5 hunks)
- src/app/features/stacks-transaction-request/submit-action.tsx (1 hunks)
- src/app/pages/rpc-sign-stacks-transaction/rpc-sign-stacks-transaction.tsx (2 hunks)
- src/app/pages/send/send-crypto-asset-form/family/stacks/use-stacks-common-send-form.tsx (4 hunks)
- src/app/pages/send/send-crypto-asset-form/form/btc/btc-send-form.tsx (1 hunks)
- src/app/pages/send/send-crypto-asset-form/form/stacks-sip10/use-sip10-send-form.tsx (1 hunks)
- src/app/pages/send/send-crypto-asset-form/form/stacks/stacks-common-send-form.tsx (5 hunks)
- src/app/pages/send/send-crypto-asset-form/form/stx/stx-send-form.tsx (3 hunks)
- src/app/pages/send/send-crypto-asset-form/form/stx/use-stx-send-form.tsx (2 hunks)
- src/app/pages/send/send-crypto-asset-form/send-crypto-asset-form.routes.tsx (3 hunks)
- src/app/pages/transaction-request/transaction-request.tsx (4 hunks)
- src/app/routes/request-routes.tsx (2 hunks)
Files skipped from review due to trivial changes (2)
- src/app/pages/send/send-crypto-asset-form/form/stacks-sip10/use-sip10-send-form.tsx
- src/app/pages/send/send-crypto-asset-form/form/stacks/stacks-common-send-form.tsx
Additional Context Used
GitHub Check Runs (1)
typecheck failure (4)
src/app/pages/send/send-crypto-asset-form/form/btc/btc-send-form.tsx: [failure] 11-11:
Cannot find module '@app/features/high-fee-dialog/high-fee-dialog' or its corresponding type declarations.
src/app/pages/transaction-request/transaction-request.tsx: [failure] 1-1:
'useState' is declared but its value is never read.
Additional comments not posted (17)
src/app/pages/rpc-sign-stacks-transaction/rpc-sign-stacks-transaction.tsx (2)
1-1
: Ensure that the imported modules are used appropriately and check for any unnecessary imports.Verification successful
The verification script executed successfully and did not find any instances where the specified imports were unused in the file
rpc-sign-stacks-transaction.tsx
. This indicates that all the imports mentioned in the script are indeed utilized within the file, confirming the appropriate use of imported modules.
- All imports in
rpc-sign-stacks-transaction.tsx
are confirmed to be used appropriately.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all imported modules in `rpc-sign-stacks-transaction.tsx` are used. # Test: Search for unused imports. Expect: No output if all imports are used. rg --type typescript --files-without-match 'StacksHighFeeWarningContainer|StacksTransactionSigner|useRpcSignStacksTransaction|useBreakOnNonCompliantEntity' src/app/pages/rpc-sign-stacks-transaction/rpc-sign-stacks-transaction.tsxLength of output: 266
Script:
#!/bin/bash # Description: Verify that all imported modules in `rpc-sign-stacks-transaction.tsx` are used. # Test: Search for unused imports. Expect: No output if all imports are used. rg --glob '*.tsx' --files-without-match 'StacksHighFeeWarningContainer|StacksTransactionSigner|useRpcSignStacksTransaction|useBreakOnNonCompliantEntity' src/app/pages/rpc-sign-stacks-transaction/rpc-sign-stacks-transaction.tsxLength of output: 228
20-29
: The usage ofStacksHighFeeWarningContainer
andStacksTransactionSigner
appears to be correctly implemented according to the new context-based management system.src/app/features/stacks-transaction-request/submit-action.tsx (2)
9-10
: The import ofuseStacksHighFeeWarningContext
is correctly placed and used within the component to manage high fee warnings.
21-28
: The functiononConfirmTransaction
correctly uses the high fee context to manage the display of high fee warnings. Ensure that the logic for handling form errors and high fees is thoroughly tested.src/app/pages/send/send-crypto-asset-form/form/stx/stx-send-form.tsx (2)
13-13
: The constantsymbol
is correctly defined and used within the component. Ensure that it matches the expected type fromCryptoCurrencies
.
29-29
: TheautoComplete="off"
attribute is correctly used in theAmountField
to enhance security by preventing browsers from storing input values.src/app/features/stacks-high-fee-warning/stacks-high-fee-warning-container.tsx (1)
1-51
: The implementation of theStacksHighFeeWarningContext
and its provider is robust, providing clear methods for managing the high fee warning state. Ensure that the context is correctly integrated across all components that require access to high fee information.Verification successful
The
useStacksHighFeeWarningContext
hook is indeed integrated across multiple components within the application, as evidenced by its presence in various files related to different features and pages. This confirms that the context is being utilized as intended across the application.
- Files using
useStacksHighFeeWarningContext
:
src/app/features/stacks-high-fee-warning/stacks-high-fee-warning-container.tsx
src/app/features/stacks-high-fee-warning/stacks-high-fee-dialog.tsx
src/app/features/stacks-transaction-request/submit-action.tsx
src/app/pages/send/send-crypto-asset-form/family/stacks/use-stacks-common-send-form.tsx
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of `StacksHighFeeWarningContext` across the application. # Test: Search for the usage of `useStacksHighFeeWarningContext`. Expect: Multiple files using this context. rg --type typescript 'useStacksHighFeeWarningContext' --files-with-matches src/Length of output: 114
Script:
#!/bin/bash # Description: Verify the integration of `StacksHighFeeWarningContext` across the application. # Test: Search for the usage of `useStacksHighFeeWarningContext`. Expect: Multiple files using this context. rg 'useStacksHighFeeWarningContext' --files-with-matches src/Length of output: 358
src/app/features/stacks-high-fee-warning/stacks-high-fee-dialog.tsx (1)
Line range hint
14-60
: TheHighFeeDialog
component correctly utilizes the high fee warning context for managing dialog visibility and actions. The implementation of the dialog's buttons for editing fees and confirming transactions is appropriate. Ensure that the dialog's behavior is consistent with user expectations and that all edge cases are handled.src/app/pages/send/send-crypto-asset-form/family/stacks/use-stacks-common-send-form.tsx (1)
Line range hint
15-53
: TheuseStacksCommonSendForm
hook correctly integrates the high fee warning context and provides comprehensive form validation logic. Ensure that the initial form values and validation schema are correctly set up and that the hook's functionality is covered by unit tests.src/app/routes/request-routes.tsx (1)
Line range hint
10-27
: The integration ofStacksHighFeeWarningContainer
in the routing configuration is correctly implemented, ensuring that the high fee warning functionality is available across different routes. Verify that the routes are correctly set up and that there are no accessibility or performance issues.src/app/pages/send/send-crypto-asset-form/form/stx/use-stx-send-form.tsx (1)
25-25
: The import and use ofuseStacksCommonSendForm
withinuseStxSendForm
is correctly implemented, ensuring that common functionalities are reused effectively. Verify that the integration works as expected and that there are no issues with data flow or state management.src/app/pages/send/send-crypto-asset-form/send-crypto-asset-form.routes.tsx (2)
87-94
: Integration ofStacksHighFeeWarningContainer
for STX transactions.This change aligns with the PR's objective to centralize high fee warning management using a context provider. Ensure that all dependent components are updated to use this new structure.
105-112
: Integration ofStacksHighFeeWarningContainer
for SIP10 token transactions.This modification is consistent with the PR's goal of improving fee management across different assets. Verify that the SIP10 token send form and other related components are properly utilizing the new context provider.
src/app/pages/transaction-request/transaction-request.tsx (2)
126-126
: Addition ofHighFeeDialog
to the transaction request flow.This addition is crucial for informing users about high fees, which enhances transparency and user decision-making. Ensure that the
learnMoreUrl
is correctly set and accessible.
124-124
: Addition ofStacksTxSubmitAction
to handle transaction submissions.Integrating
StacksTxSubmitAction
helps centralize the transaction submission logic, which is a positive change for maintainability and consistency. Confirm that this component interacts correctly with the form's state and handles submissions appropriately.src/app/features/stacks-transaction-request/stacks-transaction-signer.tsx (2)
133-133
: Addition ofHighFeeDialog
to the Stacks transaction signer.This is a beneficial addition for user awareness regarding high transaction fees. Ensure that the
learnMoreUrl
is properly set to provide users with additional information on high fees.
132-132
: Addition ofStacksTxSubmitAction
in the Stacks transaction signer.This change centralizes the submission logic within the Stacks transaction signer, which is a good practice for reducing redundancy and improving code clarity. Verify that this component is properly integrated and interacts correctly with the transaction signing flow.
src/app/pages/send/send-crypto-asset-form/form/btc/btc-send-form.tsx
Outdated
Show resolved
Hide resolved
effefd5
to
9e64286
Compare
9e64286
to
c9d0ae5
Compare
c9d0ae5
to
acfa71a
Compare
warning looks good, I can transmit the transaction again with this fix. I noticed these only cover bitcoin transaction fees Want to link this older guide for now? |
Related, users have shown interest in also seeing similar warning when increasing fees (typos have been made, leading to some unintended excessive fees) #4800 Probably out of scope for this. |
@kyranjamie should I rebase this and take it over to see if helps the fee loading issue? Our fee row seems really broken atm. |
Needs test |
In investigating the Gamma issue, I noticed the Stacks send form is broken in a few ways. Also some funky type casting, where a type is cast to a type it isn't to satisfy the compiler.
TODO:
Summary by CodeRabbit
New Features
Refactor
Bug Fixes
Documentation