Skip to content

feat: batch claim fraction #378

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

Merged
merged 22 commits into from
Feb 7, 2025
Merged

feat: batch claim fraction #378

merged 22 commits into from
Feb 7, 2025

Conversation

refactored unclaimed hypercerts list to use a table-based UI with:
- new table components for unclaimed fractions
validation
- added row selection and pagination
- implemented dropdown actions for each row
- disabled to click "claim" button if the connected address !== user_address to prevent from unintended behavier
…onent

Moved the `createExtraContent` function from the `useMintHypercert` hook to a new global component file, improving code organization and reusability.
Implemented a new batch claim button that enables claiming multiple hypercert fractions in a single transaction
this component has replaced to table component
Copy link

vercel bot commented Feb 4, 2025

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

Name Status Preview Comments Updated (UTC)
hypercerts-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 2:12am

@tnkshuuhei tnkshuuhei self-assigned this Feb 4, 2025
Implemented table filtering functionality for unclaimed hypercerts. This is necessary to batch claim function because user cannot claim on multiple chain in a single transaction
This improves UX when user try to claim hypercert on specific chain which is not connected chain.
This change is intended to show unclaimed hypercert on connected chainId so that user can easily claim them. If user wallet is not connected, then show all unclaimed hypercerts
This change is intended to prevent selecting rows from different chains.
And pass selected chain ID to batch claim button.
set default pageSize to 25 from 10 for better UX
This change is intended to avoid confusion
…units columns

merged chain and time_frame column into title column because setting multiple hypercert_id accessor breaks filter. Title and time frame should be queried from metadata field.
changes:
- refactor handleRowSelectionChange function and made it more simple logic
- add description for functions inside the unclaimed-fraction-table component
- harmonize button styling
@holkexyz
Copy link
Member

holkexyz commented Feb 5, 2025

Some suggested changes

  • Change text from "0 of 2 row(s) selected" to "0 of 2 hypercert(s) selected"
  • The hypercert can be opened by clicking on the title, then I don't think we need the additional menu at the end of the row (even though it is nice, if we want to add other functions)
  • Instead of the ID, display the actual title
  • Switch the "claim" button at the end of the row to the default black button
  • Call the "Title" column "Hypercert" as it includes multiple parts
  • For mobile: Maybe we drop all columns except the first that is now called "Hypercert" and only add the "Claim" button (not sure if this is the best way of improving the mobile version

Only if it is simple

  • Combine the columns "Claimable Units" and "Total Units" to a column "Claimable fraction", which then displays 20% or 63% (rounding to 2 digits behind the comma)

- apply responsive design for mobile friendly
- change columns display to proper column title
- change claimable units row to show portion of fraction user can claim
@tnkshuuhei
Copy link
Member Author

tnkshuuhei commented Feb 6, 2025

@holkexyz thank you for review. working on it

Some suggested changes

  • Change text from "0 of 2 row(s) selected" to "0 of 2 hypercert(s) selected"
  • The hypercert can be opened by clicking on the title, then I don't think we need the additional menu at the end of the row (even though it is nice, if we want to add other functions)
  • Instead of the ID, display the actual title
  • Switch the "claim" button at the end of the row to the default black button
  • Call the "Title" column "Hypercert" as it includes multiple parts
  • For mobile: Maybe we drop all columns except the first that is now called "Hypercert" and only add the "Claim" button (not sure if this is the best way of improving the mobile version
  • Combine the columns "Claimable Units" and "Total Units" to a column "Claimable fraction", which then displays 20% or 63% (rounding to 2 digits behind the comma)

fetched hypercert metadata inside the hypercerts tab content component because this should be done before rendering client component. ideally image url should be fetched at the same time.
@tnkshuuhei tnkshuuhei changed the title [WIP] feat: batch claim fraction feat: batch claim fraction Feb 6, 2025
@tnkshuuhei tnkshuuhei marked this pull request as ready for review February 6, 2025 03:05
@tnkshuuhei tnkshuuhei requested a review from bitbeckers February 6, 2025 03:05
Copy link
Contributor

@bitbeckers bitbeckers left a comment

Choose a reason for hiding this comment

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

The UI/UX is a huge improvement, thank you!

Two points outside of the comments:

  • The refresh of the Claimable and Owner tabs tooks longer than expected, is the cache invalidation triggered?

  • Actionable buttons have a black fill with white text

Screenshot 2025-02-06 at 10 48 40

… fetch hypercert metadata

This change is intended to improve efficiency by focusing data on metadata rather than executing unnecessary queries.
@bitbeckers bitbeckers linked an issue Feb 6, 2025 that may be closed by this pull request
Changes include:
- Replaced "hypercert" with "fraction" in UI text and error messages
- Updated claim button styling and disabled state logic
- Modified revalidation paths after claiming
- Added getAddress utility to ensure consistent address comparison
@tnkshuuhei
Copy link
Member Author

@bitbeckers

  • The refresh of the Claimable and Owner tabs tooks longer than expected, is the cache invalidation triggered?

I thought this is because block confirmation was set to 3, so removed it here: 0b5088f

I'm not sure whether this is enough or not...

`/hypercerts/${selectedHypercert?.hypercert_id}`,
`/profile/${account.address}?tab=hypercerts-claimable`,
`/profile/${account.address}?tab=hypercerts-owned`,

Changes include:
- Modify createExtraContent to use object parameter
- Remove unnecessary console.log
Copy link
Contributor

@Jipperism Jipperism left a comment

Choose a reason for hiding this comment

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

Let's continue the revalidation stuff in #420 , lgtm now

@bitbeckers bitbeckers merged commit 9e52170 into dev Feb 7, 2025
2 checks passed
@bitbeckers bitbeckers deleted the feat/batch-claim-fraction branch February 7, 2025 18:10
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
4 participants