-
Notifications
You must be signed in to change notification settings - Fork 61
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
squashed: web-ui/staging #1374
squashed: web-ui/staging #1374
Conversation
WalkthroughThe recent updates focus on enhancing the web UI's functionality and user experience across various components. Key improvements include the addition of new features like support for Dymension, weight options, UI/UX enhancements, and the integration of dynamic fee estimation. Components related to assets, staking, and modals have seen significant refinements, including better handling of interchain details, deposit/withdraw functionality, and a more intuitive layout. Documentation and code readability have also been improved, streamlining the development process. 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 (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
vercel deployment succesful
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: 25
Review Status
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
web-ui/package.json
is excluded by!**/*.json
Files selected for processing (31)
- web-ui/README.md (1 hunks)
- web-ui/components/Assets/assetsGrid.tsx (5 hunks)
- web-ui/components/Assets/intents.tsx (7 hunks)
- web-ui/components/Assets/modals/qTokenDepositModal.tsx (5 hunks)
- web-ui/components/Assets/modals/qTokenWithdrawlModal.tsx (6 hunks)
- web-ui/components/Assets/modals/qckDepositModal.tsx (6 hunks)
- web-ui/components/Assets/modals/qckWithdrawModal.tsx (6 hunks)
- web-ui/components/Assets/modals/rewardsModal.tsx (1 hunks)
- web-ui/components/Assets/modals/signalIntentProcess.tsx (2 hunks)
- web-ui/components/Assets/portfolio.tsx (5 hunks)
- web-ui/components/Assets/quickbox.tsx (3 hunks)
- web-ui/components/Assets/rewardsClaim.tsx (3 hunks)
- web-ui/components/Assets/unbondingTable.tsx (4 hunks)
- web-ui/components/Governance/VoteModal.tsx (3 hunks)
- web-ui/components/Staking/assetsAccordion.tsx (2 hunks)
- web-ui/components/Staking/modals/revertSharesProcessModal.tsx (5 hunks)
- web-ui/components/Staking/modals/stakingProcessModal.tsx (3 hunks)
- web-ui/components/Staking/modals/transferProcessModal.tsx (6 hunks)
- web-ui/components/Staking/networkSelectButton.tsx (1 hunks)
- web-ui/components/Staking/stakingBox.tsx (11 hunks)
- web-ui/components/react/accountControlModal.tsx (7 hunks)
- web-ui/components/react/chain-dropdown.tsx (6 hunks)
- web-ui/components/react/index.ts (1 hunks)
- web-ui/components/wallet.tsx (3 hunks)
- web-ui/hooks/useGrpcQueryClient.ts (2 hunks)
- web-ui/hooks/useQueries.ts (15 hunks)
- web-ui/pages/assets.tsx (6 hunks)
- web-ui/pages/staking/[chainId]/[valoperAddress].tsx (1 hunks)
- web-ui/pages/staking/index.tsx (3 hunks)
- web-ui/utils/maths.ts (1 hunks)
- web-ui/utils/string.ts (1 hunks)
Additional comments not posted (52)
web-ui/components/react/index.ts (1)
1-3
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-7]
The changes align with the PR objectives of cleaning up unused components. Ensure that any dependent code has been updated accordingly.
web-ui/README.md (1)
53-53
: Complete the documentation for adding networks to enhance developer guidance.web-ui/hooks/useGrpcQueryClient.ts (1)
1-1
: Ensure that all environment variables used here are correctly set in your deployment configuration.web-ui/components/wallet.tsx (1)
6-15
: > 📝 NOTEThis review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]
The removal of unused components and simplification of the component structure contribute to a cleaner and more maintainable codebase.
web-ui/components/Assets/quickbox.tsx (1)
52-99
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-96]
The integration of the
RewardsModal
component and the addition of the "Unwind" button enhance the component's functionality and user experience.web-ui/components/Staking/networkSelectButton.tsx (1)
80-86
: The addition of_active
and_focus
styles to theNetworkSelect
component ensures consistent styling across different states, enhancing the user experience.web-ui/components/Staking/assetsAccordion.tsx (1)
19-19
: Ensure theaddress
prop is validated or sanitized before use in queries or transactions to prevent potential security issues.web-ui/pages/staking/index.tsx (1)
31-31
: Validate or sanitize theaddress
obtained fromuseChain
before using it in downstream components or API calls.web-ui/components/Assets/rewardsClaim.tsx (3)
58-58
: Confirm the increase in the reward amount from '50' to '5000' aligns with the intended business logic and is not an error.
69-76
: Ensure that the conditional logic for executingmsgRevokeBad
andmsgGrant
based onauthData
presence is intentional and correctly implemented.
107-107
: Verify that settingproofType
to an empty string is the intended behavior and does not impact the functionality negatively.web-ui/components/Assets/portfolio.tsx (2)
10-10
: Ensure the addition of thechainId
field toPortfolioItemInterface
is utilized appropriately in the component and aligns with the intended functionality.
46-52
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [49-62]
Validate the loading state logic to ensure it provides a smooth user experience and accurately reflects the loading status of portfolio data.
web-ui/components/react/chain-dropdown.tsx (1)
226-226
: Confirm the change of theisClearable
prop fromtrue
tofalse
in theChangeChainDropdown
component aligns with the desired user experience and functionality.web-ui/components/Staking/modals/revertSharesProcessModal.tsx (1)
152-152
: Ensure that theestimateFee
function's failure does not prevent the transaction from proceeding. Consider adding a fallback mechanism or user notification in case of fee estimation failure.- const fee = await estimateFee(address, [msg]) + let fee; + try { + fee = await estimateFee(address, [msg]); + } catch (error) { + console.error('Error estimating fee:', error); + // Fallback fee or user notification logic here + return; + }web-ui/components/Assets/intents.tsx (2)
16-19
: Ensure that theuseCallback
hook is utilized effectively for memoizing thehandleScroll
function to avoid unnecessary re-creations on component re-renders.
235-249
: The implementation of theFade
component to indicate more content at the bottom is a good UX practice. Ensure that theFade
component's visibility is tested across different browsers for consistent behavior.web-ui/components/Assets/modals/qTokenWithdrawlModal.tsx (3)
31-31
: The integration of theuseFeeEstimation
hook for dynamic fee estimation in withdrawal transactions is a significant improvement. Ensure that error handling is implemented for the hook.
145-145
: When using theestimateFee
function, consider implementing a fallback mechanism or user notification in case of fee estimation failure to enhance the user experience.- const fee = await estimateFee(qAddress ?? '', [msg]); + let fee; + try { + fee = await estimateFee(qAddress ?? '', [msg]); + } catch (error) { + console.error('Error estimating fee:', error); + // Fallback fee or user notification logic here + return; + }
193-193
: The logic to prevent the user from entering an amount greater than the maximum is well-implemented. However, consider adding a visual indicator or tooltip to inform users when their input exceeds the maximum allowed amount.web-ui/components/Assets/modals/qTokenDepositModal.tsx (3)
31-31
: The use of theuseFeeEstimation
hook for dynamic fee estimation in deposit transactions is a positive change. Ensure that error handling is in place for the hook to manage potential failures gracefully.
146-146
: Implement a fallback mechanism or user notification for theestimateFee
function's failure to ensure the transaction can proceed or the user is informed appropriately.- const fee = await estimateFee(address ?? '', [msg]); + let fee; + try { + fee = await estimateFee(address ?? '', [msg]); + } catch (error) { + console.error('Error estimating fee:', error); + // Fallback fee or user notification logic here + return; + }
194-194
: The logic to limit the user's input to the maximum amount is correctly implemented. Consider adding feedback for users when their input exceeds the maximum to improve the user experience.web-ui/components/Assets/unbondingTable.tsx (2)
30-30
: The simplification of theformatDenom
function to directly useformatQasset
is a good improvement for code readability and maintainability.
65-65
: FilteringunbondingData
to only include entries relevant to the user's address is a crucial step for displaying accurate information. Ensure that this filtering logic is thoroughly tested to confirm its correctness.web-ui/pages/assets.tsx (3)
13-22
: Consider using a custom hook to encapsulate multiple related queries.To improve code readability and maintainability, consider encapsulating the multiple query hooks (
useAPYQuery
,useAPYsQuery
,useLiquidRewardsQuery
, etc.) into a single custom hook. This approach can simplify the component logic and make it easier to manage the state and lifecycle of related data fetching operations.
50-53
: Ensure error handling for therefetchAll
function.Given the critical nature of refetching data, verify that appropriate error handling is implemented for the
refetchAll
function to ensure the application's resilience against network or query failures.
152-175
: Refactor the assetsData calculation to improve readability.Consider refactoring the
assetsData
calculation to improve code readability. Extracting parts of the logic into separate functions or using more descriptive variable names can make the code easier to understand and maintain.web-ui/components/Assets/assetsGrid.tsx (2)
28-40
: Ensure theliquidRewards
prop is properly documented.Given the addition of the
liquidRewards
prop toAssetCardProps
, ensure that this prop is properly documented, including its type and usage, to facilitate understanding and maintenance by other developers.
162-376
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [287-413]
Refactor the AssetsGrid component to improve readability.
The
AssetsGrid
component's rendering logic, especially the conditional rendering and mapping overassets
, could be refactored for better readability. Consider extracting parts of the JSX into smaller, reusable components or using more descriptive variable names.web-ui/components/Assets/modals/signalIntentProcess.tsx (2)
28-28
: Ensure theuseFeeEstimation
hook is properly utilized.The integration of the
useFeeEstimation
hook for dynamic fee calculation in theSignalIntentModal
component is a significant improvement, enhancing the accuracy of transaction cost estimations.
189-189
: Validate the fee estimation logic with real transaction data.Given the critical nature of fee estimation for transactions, verify that the
estimateFee
logic is validated with real transaction data to ensure accuracy and prevent potential issues during transaction submission.web-ui/components/Staking/modals/stakingProcessModal.tsx (4)
85-85
: Add PropTypes or TypeScript interfaces for new props to ensure type safety.For maintainability and to prevent bugs, it's a good practice to define types for all props in a React component. This helps in catching type-related errors during development. Since
refetch
is a new prop, its type should be defined.
276-276
: Ensure theuseFeeEstimation
hook is used correctly and efficiently.Given the dynamic nature of fee estimation, it's crucial to verify that the
useFeeEstimation
hook is used in a way that doesn't lead to unnecessary re-renders or performance issues. Consider checking if the hook's dependencies are optimized and if its usage aligns with the expected behavior in the UI.
284-284
: Validate the error handling for theestimateFee
async call.Asynchronous calls can fail for various reasons, such as network issues or server errors. It's important to ensure that there's proper error handling for the
estimateFee
call. This could include try-catch blocks, error state management, and user-friendly error messages.
291-291
: Confirm that therefetch
function is called at the appropriate time.The
refetch
function is called upon the successful completion of a transaction. It's important to verify that this is the correct behavior in the context of the application. Consider whether there are any edge cases whererefetch
should be called under different conditions or if there are any potential side effects.web-ui/pages/staking/[chainId]/[valoperAddress].tsx (1)
697-697
: Ensure the padding adjustment aligns with the design requirements.Changing the padding from
mt={-8}
topt={2}
alters the spacing above theHStack
component. It's important to verify that this adjustment meets the design requirements and does not negatively impact the layout or user experience of the staking/unstaking interface.web-ui/hooks/useQueries.ts (9)
6-6
: Ensure that the importedQueryAllBalancesResponse
type is used appropriately in the new functions.
83-87
: Renameproof_ops
toproofOps
andproof_type
toproofTypes
for consistency with JavaScript naming conventions.
71-71
: Addingrefetch
functions to various query return types is a good practice for enabling manual query refreshes.Also applies to: 151-151, 281-281, 367-367, 487-487, 1010-1010
117-119
: Initialization ofskipClient
withSKIP_API_URL
is correctly implemented.
117-119
: Ensure thatSKIP_API_URL
is correctly configured in the environment or configuration files.
117-119
: Consider adding error handling for theskipClient
initialization to gracefully handle potential issues with the API URL or network connectivity.
642-653
: The implementation offetchAPYs
to fetch APYs for multiple chains is a useful addition. Ensure that the API endpoint used returns the expected data format.
1014-1038
: TheuseSkipAssets
hook for querying assets usingskipClient
is a valuable addition. Verify that thechainId
parameter is correctly passed and handled by theskipClient.assets
method.
1040-1061
: TheuseRecommendations
hook for fetching asset recommendations is well-implemented. Ensure that theskipClient.recommendAssets
method correctly handles the input parameters and returns the expected response format.web-ui/components/Staking/stakingBox.tsx (6)
41-41
: Consider memoizing theuseFeeEstimation
hook's return value.To ensure optimal performance, especially in components with frequent re-renders, consider memoizing the return value of
useFeeEstimation
usinguseMemo
if the estimated fee calculation is expensive or if it depends on inputs that change infrequently.
172-172
: Memoize theestimateFee
function to avoid unnecessary recalculations.Given that
estimateFee
is derived from a custom hook and might be computationally expensive, consider memoizing its result withuseMemo
to prevent unnecessary recalculations, especially if it's used in a context where its dependencies change infrequently.
211-211
: Verify the error handling strategy foruseNativeStakeQuery
.Ensure that the UI gracefully handles errors from
useNativeStakeQuery
. Consider displaying an error message or providing a retry mechanism ifdelegationsIsError
is true.
571-571
: Ensurerefetch
inStakingProcessModal
is properly utilized.Confirm that the
refetch
prop passed toStakingProcessModal
is used effectively within the modal to trigger necessary data refetching operations upon successful transactions or other relevant events.
706-706
: Validate the use ofrefetchDelegations
inTransferProcessModal
.Ensure that
refetchDelegations
is correctly implemented withinTransferProcessModal
to update the delegation data after a successful transfer operation, enhancing data accuracy and user experience.
716-716
: Check the implementation ofrefetchDelegations
inRevertSharesProcessModal
.Double-check that
refetchDelegations
is effectively used inRevertSharesProcessModal
to refresh delegation information post-reversion, ensuring the UI reflects the most current state.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1374 +/- ##
=======================================
Coverage 63.60% 63.60%
=======================================
Files 171 171
Lines 11652 11652
=======================================
Hits 7411 7411
Misses 3497 3497
Partials 744 744
Flags with carried forward coverage won't be shown. Click here to find out more. |
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: 2
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: 4
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (1)
- web-ui/pages/assets.tsx (6 hunks)
Additional comments not posted (1)
web-ui/pages/assets.tsx (1)
250-250
: Verify the consistent application of responsive design styling across components.Ensure that the responsive design styling, particularly the width properties, is consistently applied across components to maintain a uniform user experience on different devices.
This pull request has been deployed to Vercel.
|
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 Status
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
web-ui/package.json
is excluded by!**/*.json
Files selected for processing (7)
- web-ui/components/Assets/modals/rewardsModal.tsx (1 hunks)
- web-ui/components/Assets/portfolio.tsx (5 hunks)
- web-ui/components/Assets/rewardsClaim.tsx (4 hunks)
- web-ui/components/Assets/unbondingTable.tsx (2 hunks)
- web-ui/hooks/useQueries.ts (16 hunks)
- web-ui/hooks/useSkipExecute.ts (1 hunks)
- web-ui/pages/assets.tsx (7 hunks)
Files skipped from review as they are similar to previous changes (2)
- web-ui/components/Assets/modals/rewardsModal.tsx
- web-ui/components/Assets/unbondingTable.tsx
Additional comments not posted (16)
web-ui/hooks/useSkipExecute.ts (2)
14-14
: Consider adding type definitions for theroute
anduserAddresses
parameters to improve type safety.
77-77
: Consider adding type definitions for theroute
parameter to improve type safety inuseSkipMessages
.web-ui/components/Assets/portfolio.tsx (2)
10-10
: The addition of thechainId
field inPortfolioItemInterface
supports enhanced functionality for handling assets across different chains.
80-169
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [49-123]
The adjustments to the rendering logic, including the use of
SkeletonText
for loading states and the restructuring of the portfolio display, contribute to a better user experience.web-ui/components/Assets/rewardsClaim.tsx (3)
63-63
: The increase in the reward amount from '50' to '1000000' reflects a significant change likely based on business or functional requirements.
72-85
: The modifications to the transaction logic, including calls to bothmsgRevokeBad
andmsgGrant
with separate fees, enhance the flexibility and robustness of transaction handling.
96-112
: The addition of thetransformProofs
function supports new or updated transaction requirements by transforming proofs for submission.web-ui/pages/assets.tsx (3)
13-22
: The addition of new data querying hooks is necessary for fetching the required data for the assets page, including token prices, balances, APYs, redemption rates, and liquid rewards.
80-108
: The restructuring of data processing functions, including the creation ofportfolioItems
andassetsData
arrays usinguseMemo
, contributes to more effective handling of the new data and optimized performance.
111-125
: The updates to portfolio calculations and the display of asset information, including calculations for total portfolio value, average APY, and total yearly yield, enhance the functionality and user experience of the assets page.web-ui/hooks/useQueries.ts (6)
152-152
: Add a comment explaining the purpose ofrefetchBalance
and under what circumstances it should be used. This will help future developers understand its intended use case.
215-215
: Consider adding a brief comment explaining the purpose ofauthRefetch
for clarity and maintainability.
283-283
: Ensure that therefetch
method is documented, explaining when and why it might be necessary to manually trigger a refetch of all balances.
644-655
: Consider caching the results offetchAPYs
to improve performance, especially if this data does not change frequently. You can adjust thestaleTime
or use a more sophisticated caching strategy.
1017-1039
: Ensure that the results fromuseSkipAssets
are cached appropriately to avoid unnecessary network requests. Consider documenting the expected structure of the assets for better maintainability.
1042-1063
: Consider adding error handling logic within thequeryFn
ofuseSkipReccomendedRoutes
anduseSkipRoutesData
to gracefully handle any issues that may arise during the data fetching process.
1. Summary
All
web-ui/*
changes from web-ui/staging branch without breaking non web-ui changes.Summary by CodeRabbit