Skip to content

Conversation

@GWSzeto
Copy link
Contributor

@GWSzeto GWSzeto commented Nov 15, 2024

https://linear.app/thirdweb/issue/DASH-469/small-changes-for-modules-ui


PR-Codex overview

This PR primarily focuses on enhancing the Transferable, Claimable, and Royalty components by adding new features, improving user interfaces, and correcting data handling related to ERC20 and ERC721 tokens.

Detailed summary

  • Added support for isErc20 state in Claimable and Royalty components.
  • Updated UI to conditionally render messages based on token type.
  • Introduced SequentialTokenIdFieldset for handling token ID inputs.
  • Changed bps to percentage in Royalty calculations and UI.
  • Improved input handling and validation for royalty percentage fields.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@vercel
Copy link

vercel bot commented Nov 15, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 11:12pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 11:12pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 11:12pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
thirdweb_playground ⬜️ Skipped (Inspect) Nov 25, 2024 11:12pm

@changeset-bot
Copy link

changeset-bot bot commented Nov 15, 2024

⚠️ No Changeset found

Latest commit: a98550d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 15, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Nov 15, 2024
@codecov
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.84%. Comparing base (0e98b09) to head (a98550d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5437   +/-   ##
=======================================
  Coverage   43.84%   43.84%           
=======================================
  Files        1081     1081           
  Lines       56186    56186           
  Branches     3929     3929           
=======================================
  Hits        24635    24635           
  Misses      30868    30868           
  Partials      683      683           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 0e98b09
packages 38.60% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 44.97 KB (0%) 900 ms (0%) 3.1 s (+23.63% 🔺) 4 s
thirdweb (cjs) 105.01 KB (0%) 2.2 s (0%) 4.1 s (-24.65% 🔽) 6.2 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 113 ms (0%) 227 ms (+39.37% 🔺) 339 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 209 ms (+464.84% 🔺) 219 ms
thirdweb/react (minimal + tree-shaking) 18.38 KB (0%) 368 ms (0%) 440 ms (+51.82% 🔺) 808 ms

@vercel vercel bot temporarily deployed to Preview – wallet-ui November 15, 2024 20:28 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 November 15, 2024 20:28 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground November 15, 2024 20:28 Inactive
@gregfromstl
Copy link
Contributor

Linear ticket please

@gregfromstl gregfromstl changed the title Modules UI changes [Dashboard]: Feature: Modules UI changes Nov 15, 2024
@gregfromstl gregfromstl changed the title [Dashboard]: Feature: Modules UI changes [Dashboard] Feature: Modules UI changes Nov 15, 2024
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground November 19, 2024 18:05 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 19, 2024 18:05 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 November 19, 2024 18:05 Inactive
Comment on lines +254 to +259
percentage: z
.string()
.min(1, { message: "Invalid BPS" })
.refine((v) => Number(v) >= 0, { message: "Invalid BPS" }),
.min(1, { message: "Invalid percentage" })
.refine((v) => Number(v) === 0 || (Number(v) >= 0.01 && Number(v) <= 100), {
message: "Invalid percentage",
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be conflicting validation logic for zero values. The min(1) string validation will reject "0" inputs, while the refine() check explicitly allows zero values with Number(v) === 0. To consistently support zero values, the min(1) validation should be removed, leaving only the refine() check to handle the full range of valid inputs (0 and 0.01-100).

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.


<FormErrorMessage>{props.errorMessage}</FormErrorMessage>

<FormHelperText className="!text-sm text-muted-foreground">
Copy link
Member

Choose a reason for hiding this comment

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

If you are using FormFieldSetup -
you can remove FormLabel, FormErrorMessage and FormHelperText and just pass those to props label , errorMessage, helperText etc to avoid adding chakra components

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground November 25, 2024 22:07 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 25, 2024 22:07 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 November 25, 2024 22:07 Inactive
@GWSzeto GWSzeto added the merge-queue Adds the pull request to Graphite's merge queue. label Nov 25, 2024
@github-actions github-actions bot removed the merge-queue Adds the pull request to Graphite's merge queue. label Nov 25, 2024
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 25, 2024

Merge activity

https://linear.app/thirdweb/issue/DASH-469/small-changes-for-modules-ui

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the functionality and user experience of the `Transferable`, `Claimable`, and `Royalty` components in the dashboard application, particularly by adding support for ERC20 tokens and improving form handling for royalties.

### Detailed summary
- Added support for `isErc20` state in `Transferable` and `Claimable` components.
- Updated UI to display messages related to transfer restrictions and accounts.
- Introduced `SequentialTokenIdFieldset` to handle token ID inputs.
- Changed royalty handling from BPS to percentage in `Royalty` component.
- Improved form validation and error messaging for royalty inputs.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 25, 2024 23:07 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground November 25, 2024 23:07 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 November 25, 2024 23:07 Inactive
@graphite-app graphite-app bot merged commit a98550d into main Nov 25, 2024
32 checks passed
@graphite-app graphite-app bot deleted the modules-ui-changes branch November 25, 2024 23:12
@vercel vercel bot temporarily deployed to Production – thirdweb_playground November 25, 2024 23:12 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui November 25, 2024 23:12 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 November 25, 2024 23:12 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants