Skip to content
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

feat: use pagination in transaction inputs/outputs list #188

Closed
wants to merge 12 commits into from

Conversation

zhangyouxin
Copy link

Copy link

vercel bot commented Dec 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ckb-explorer-frontend-in-magickbase-repo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2024 5:28pm

src/components/TransactionItem/index.tsx Outdated Show resolved Hide resolved
src/components/TransactionItem/index.tsx Outdated Show resolved Hide resolved
src/components/TransactionItem/index.tsx Outdated Show resolved Hide resolved
@Keith-CY
Copy link
Member

image The count of outputs is for per page, not for the transaction, and the indices of cells are not paged correctly.

src/services/ExplorerService/fetcher.ts Outdated Show resolved Hide resolved
src/pages/Transaction/index.tsx Outdated Show resolved Hide resolved
src/services/ExplorerService/fetcher.ts Outdated Show resolved Hide resolved
@@ -18,18 +23,57 @@ const handleCellbaseInputs = (inputs: Cell[], outputs: Cell[]) => {
}

export const TransactionComp = ({ transaction }: { transaction: Transaction }) => {

Choose a reason for hiding this comment

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

Based on the requirements here: #177 (comment)

This component should not be modified to use pagination mode, as it would result in multiple pages making a large number of requests, as seen in #177.

Copy link
Author

Choose a reason for hiding this comment

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

this file is meant to be changed, I reverted src/components/TransactionItem/index.tsx

@zhangyouxin
Copy link
Author

image The count of outputs is for per page, not for the transaction, and the indices of cells are not paged correctly.

updated by e7ac2d2

}: {
inputs?: Cell[]
outputs?: Cell[]
txHash?: string
showReward?: boolean
total?: number
indiceOffset?: number
Copy link
Member

Choose a reason for hiding this comment

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

How about loading offset from the url, the page_number and page_size parameters, and get the offset by (page_number - 1) * page_size

Copy link
Author

Choose a reason for hiding this comment

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

There are input_cells_page_size/number and output_page_size/number params, if offset is removed, then need to add another field like cell_input_output_type to distinguish them

Copy link
Member

Choose a reason for hiding this comment

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

In what case will the sizes of input cells and output cells be different? I didn't find an entry to update the size on the page.

Copy link
Author

Choose a reason for hiding this comment

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

43894e5 has added page size change for pagination component, but there is no design yet, I may change the appearance according to design, please have a look @Sven-TBD
image

Choose a reason for hiding this comment

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

Ya, we could add a drop box with some default options for the user @Kirl70 , like 5,10,15.

Copy link

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I found the page size component exists in input list and output list, so their sizes are independent, am I right? @Sven-TBD

src/pages/Transaction/TransactionComp/TransactionComp.tsx Outdated Show resolved Hide resolved
src/pages/Transaction/TransactionComp/TransactionComp.tsx Outdated Show resolved Hide resolved
src/pages/Transaction/TransactionComp/TransactionComp.tsx Outdated Show resolved Hide resolved
@Keith-CY
Copy link
Member

Keith-CY commented Jan 15, 2024

https://ckb-explorer-frontend-in-magickbase-repo-git-913f8b-magickbase.vercel.app/transaction/0xc0d63615267e6a30d871b6d35551619641ba699138c1337470f4cdb7f8b91f1b
When I visit this page, and want to update the page size to 10 by deleting 12 entirely(char by char), I got an unremovable 1

I have to select the 10 entirely and replace it with 20

@Keith-CY
Copy link
Member

Keith-CY commented Jan 15, 2024

go back of the browser doesn't work after visiting another page number

@Keith-CY
Copy link
Member

Further updates will be submitted on #222

@Keith-CY Keith-CY closed this Jan 19, 2024
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.

Increase pagination for inputs and outputs on the transaction details page
6 participants