Skip to content

Conversation

@khanti42
Copy link
Collaborator

@khanti42 khanti42 commented Apr 3, 2025

Requirements:

Screen.Recording.2025-04-03.at.20.09.59.mov

Note

Implements cursor-based pagination with infinite scroll for the transactions list, updating state, service API, and UI styling accordingly.

  • Transactions Pagination/Infinite Scroll
    • TransactionsList.view.tsx: Add cursor-based fetching (wallet.transactionCursor), seenCursors, isFetchingMore, onScroll handler, and fetchMore using getTransactions(cursor); remove obsolete args (txnsInLastNumOfDays, onlyFromState).
    • useStarkNetSnap.ts: Change getTransactions to accept optional cursor and return { transactions, cursor }; append or replace transactions via Redux; set transactionCursor; skip fetch when a deploy transaction exists.
  • State Management (Redux)
    • walletSlice.ts: Add transactionCursor to state; new actions appendTransactions, setTransactionCursor; export them; initialize in state.
  • UI/Styling
    • List.style.ts: Set List height to 100vh for scrollable area.
  • Call Sites Updated
    • SendSummaryModal.view.tsx and TransactionsList.view.tsx: Update getTransactions calls to new signature.
  • Misc
    • useEstimateFee.ts: Remove debug logging.
    • useStarkNetSnap.ts: Clear transactionDeploy when switching selected token.

Written by Cursor Bugbot for commit 08f8cf9. This will update automatically on new commits. Configure here.

@khanti42 khanti42 changed the base branch from main to feat/sf-815-pagination-on-snap April 3, 2025 18:07
@khanti42 khanti42 force-pushed the feat/sf-815-pagination-on-wallet-ui branch from 5bde256 to 85477d7 Compare April 3, 2025 18:09
@khanti42 khanti42 marked this pull request as ready for review April 6, 2025 19:05
@khanti42 khanti42 requested review from a team as code owners April 6, 2025 19:05
@khanti42 khanti42 requested review from Julink-eth and jonesho and removed request for a team April 6, 2025 19:05
@khanti42 khanti42 marked this pull request as draft April 6, 2025 19:05
@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-wallet-ui'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-starknet-snap'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@stanleyyconsensys stanleyyconsensys marked this pull request as ready for review October 24, 2025 01:28
) {
seenCursors.current.add({
txnHash: walletTransactionsCursor.txnHash,
blockNumber: walletTransactionsCursor.blockNumber,
Copy link

Choose a reason for hiding this comment

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

Bug: Set Comparison Fails for Object References

The seenCursors Set uses object references, but JavaScript Sets compare objects by reference, not by value. This means has() always returns false for new object instances, leading to duplicate transaction fetches for the same cursor.

Fix in Cursor Fix in Web

) => {
if (transactionDeploy) {
return;
}
Copy link

Choose a reason for hiding this comment

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

Bug: State Persistence Blocks Transaction Fetching

The getTransactions function returns early if transactionDeploy is set in the state. Since transactionDeploy persists after a deploy transaction is found, this prevents any subsequent transaction fetches, breaking pagination and refresh functionality until the transactionDeploy state is cleared.

Fix in Cursor Fix in Web


const setErc20TokenBalance = (erc20TokenBalance: Erc20TokenBalance) => {
dispatch(setErc20TokenBalanceSelected(erc20TokenBalance));
dispatch(setTransactionDeploy(null));
Copy link

Choose a reason for hiding this comment

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

Bug: Null Assignment Causes TypeScript Errors

Setting transactionDeploy to null when changing the selected token causes TypeScript type errors. The transactionDeploy state is typed to accept Transaction | undefined, but not null.

Fix in Cursor Fix in Web


const setErc20TokenBalance = (erc20TokenBalance: Erc20TokenBalance) => {
dispatch(setErc20TokenBalanceSelected(erc20TokenBalance));
dispatch(setTransactionDeploy(null));
Copy link

Choose a reason for hiding this comment

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

Bug: Token Change Incorrectly Resets Deploy Transaction

Setting transactionDeploy to null when changing token selection clears the deploy transaction state, which may be unintended. This could cause issues if the deploy transaction is still relevant or needed by other parts of the UI. The deploy transaction is account-specific, not token-specific, so clearing it on token change seems incorrect.

Fix in Cursor Fix in Web

@stanleyyconsensys stanleyyconsensys marked this pull request as draft October 24, 2025 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants