Skip to content

Conversation

@notrab
Copy link
Member

@notrab notrab commented Jan 27, 2025

CleanShot 2025-01-27 at 16 37 05@2x
CleanShot 2025-01-27 at 16 36 59@2x

@changeset-bot
Copy link

changeset-bot bot commented Jan 27, 2025

⚠️ No Changeset found

Latest commit: 959393b

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

@vercel
Copy link
Contributor

vercel bot commented Jan 27, 2025

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

Name Status Preview Comments Updated (UTC)
ensnode.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 7:24pm
examples.nameguard.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 7:24pm
nameai.dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 7:24pm
namegraph.dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 7:24pm
nameguard.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 7:24pm
namehashlabs.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 7:24pm
namekit.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 7:24pm
storybook.namekit.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 7:24pm

@vercel vercel bot temporarily deployed to Preview – storybook.namekit.io January 27, 2025 16:38 Inactive
@vercel vercel bot temporarily deployed to Preview – namegraph.dev January 27, 2025 16:38 Inactive
@vercel vercel bot temporarily deployed to Preview – namehashlabs.org January 27, 2025 16:38 Inactive
@vercel vercel bot temporarily deployed to Preview – examples.nameguard.io January 27, 2025 16:38 Inactive
@vercel vercel bot temporarily deployed to Preview – nameguard.io January 27, 2025 16:38 Inactive
Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@notrab Hey good to see these enhancements. Approving this PR now to help unblock merging it in. Also shared some suggestions with feedback that are fine to action in a separate future PR 👍

}

try {
const normalizedLabel = ens_normalize(label);
Copy link
Member

Choose a reason for hiding this comment

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

We also need to check if label includes any "." characters. If it does, that should be another error case, because the input is more than 1 label.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I added this as client side validation for MVP as waiting for a network response for the validation seemed overkill for something that can be detected on the client.

if (inputValue) {
let error = null;

if (inputValue.includes(" ")) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggest some refactoring such that you define just a single function in the whole app that takes as input a string (let's call it unvalidatedLabel). This function should then either return a validatedLabel that is guaranteed to not be an empty string, not to contain more than 1 label, and to be ENS normalized. If this function identifies any problems with unvalidatedLabel it should throw an exception with the appropriate error message. Callers of this function can then manage their own logic for how to take action if an exception is thrown by this function.

return (
<form onSubmit={handleSubmit} className="mb-6">
<div className="flex items-start justify-center space-x-2 flex-1">
<Input
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps there's an opportunity to define just a single "LabelInput" UI component / full "LabelInput" form and then reuse it across both of our example apps? The logic should be exactly the same. All that changes is dynamic behaviour for what happens when a valid label is submitted.

@notrab notrab merged commit 1f86da0 into main Jan 29, 2025
13 checks passed
@notrab notrab deleted the notrab/sc-26147/nameai-fix-ux-of-unnormalized-label-submissions branch January 29, 2025 17:52
FrancoAguzzi added a commit that referenced this pull request Jan 30, 2025
* feat: [SC-26223] ✨ Migrate NFTAvatar to namekit-react

* feat: [sc-26178] Create readme for NameAI SDK (#578)

* create readme for nameai-sdk; add license

* extend response example

* Fix links in NameAI API readme (#579)

* fix links in readme

* Update README.md

---------

Co-authored-by: kwrobel.eth <djstrong@gmail.com>

* feat: [sc-26164] Finish Transition of alpha.namekit.io landing page to namekit.io (#563)

* add ExploreNameGraphForm to Namegraph services section

* Add namekit react Button to ExploreNameGraphForm

* support empty input on ExploreNameGraphForm

* use namekit react Input on explore-namegraph-form

* improve button and text placement

---------

Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>

* feat: [sc-26169] Refine namekit.io landing page (#564)

* use namekit-react for X button

* add Try the Alpha to mobile navigation link

* avoid just 1 word wrapping to the next line on get-your-web3-name section

* add "try now" button on hero section

* fix button placement

* fix text placement on hero section

* fix screen limit

* fix balancer generated layout shifts

* add IconButton to mobile version of namekit.io

---------

Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>

* Notrab/sc 26147/nameai fix ux of unnormalized label submissions (#575)

* feat(nameai): turn off autoComplete

* add data-1p-ignore

* rename field

* add client side validation and loading states

* fix type issues

* fix rank form errors

* update tsconfig

* fix type

* sort page ux

* feat: [SC-26223] ✨ Migrate NFTAvatar to namegraph.dev based on next/image dependency

* feat: [SC-26223] 💄 Make NFTAvatar look shiny in the Ui

* fix: [SC-26223] 🐛 Update DisplayedName to fix labels displaying for subdomains

* fix: [SC-26223] 🐛 Clean unnecessary code and make it possible to switch suffixes and recharge avatars right away

* fix: [SC-26223] 🐛 Fix atropos react typescript alignment

* feat: [SC-26223] ✨ Remove file and optimize code syntax

---------

Co-authored-by: Piotr Zawiślan <59446552+Byczong@users.noreply.github.com>
Co-authored-by: kwrobel.eth <djstrong@gmail.com>
Co-authored-by: Eduardo <eduramme@gmail.com>
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Co-authored-by: Jamie Barton <jamie@notrab.dev>
FrancoAguzzi added a commit that referenced this pull request Feb 2, 2025
…#570)

* feat: [SC-26202] ✨  Build Name Details Page draft and most important features

* feat: [SC-26202] ✨ Make name details page beautiful

* feat: [SC-26202] ✨ Other name ideas in Name Details page

* feat: [SC-26202] 🐛 Fix build errors

* feat: [SC-26202] 💄 Improve visualization in Name Details page

* feat: [SC-26202] ✨ Add Skeletons to Name Details page

* feat: [SC-26202] ✨ Add possibility of not loading related collection from suggestionsByCategory NameGraph SDK endpoint

* feat: [SC-26202] 🐛 Fix Ui bug in Collection page

* fix: [SC-26202] 🐛 Align Ui type usage with API type

* feat: [SC-26202] ✨ Normalizing query name input

* feat: [SC-26202] ✨ Appending TLD usage from namegraph.dev in the URL

* [SC-26223] ✨  Migrate NFTAvatar (#583)

* feat: [SC-26223] ✨ Migrate NFTAvatar to namekit-react

* feat: [sc-26178] Create readme for NameAI SDK (#578)

* create readme for nameai-sdk; add license

* extend response example

* Fix links in NameAI API readme (#579)

* fix links in readme

* Update README.md

---------

Co-authored-by: kwrobel.eth <djstrong@gmail.com>

* feat: [sc-26164] Finish Transition of alpha.namekit.io landing page to namekit.io (#563)

* add ExploreNameGraphForm to Namegraph services section

* Add namekit react Button to ExploreNameGraphForm

* support empty input on ExploreNameGraphForm

* use namekit react Input on explore-namegraph-form

* improve button and text placement

---------

Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>

* feat: [sc-26169] Refine namekit.io landing page (#564)

* use namekit-react for X button

* add Try the Alpha to mobile navigation link

* avoid just 1 word wrapping to the next line on get-your-web3-name section

* add "try now" button on hero section

* fix button placement

* fix text placement on hero section

* fix screen limit

* fix balancer generated layout shifts

* add IconButton to mobile version of namekit.io

---------

Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>

* Notrab/sc 26147/nameai fix ux of unnormalized label submissions (#575)

* feat(nameai): turn off autoComplete

* add data-1p-ignore

* rename field

* add client side validation and loading states

* fix type issues

* fix rank form errors

* update tsconfig

* fix type

* sort page ux

* feat: [SC-26223] ✨ Migrate NFTAvatar to namegraph.dev based on next/image dependency

* feat: [SC-26223] 💄 Make NFTAvatar look shiny in the Ui

* fix: [SC-26223] 🐛 Update DisplayedName to fix labels displaying for subdomains

* fix: [SC-26223] 🐛 Clean unnecessary code and make it possible to switch suffixes and recharge avatars right away

* fix: [SC-26223] 🐛 Fix atropos react typescript alignment

* feat: [SC-26223] ✨ Remove file and optimize code syntax

---------

Co-authored-by: Piotr Zawiślan <59446552+Byczong@users.noreply.github.com>
Co-authored-by: kwrobel.eth <djstrong@gmail.com>
Co-authored-by: Eduardo <eduramme@gmail.com>
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Co-authored-by: Jamie Barton <jamie@notrab.dev>

* feat: [SC-26202] ✨ Align namegraph.dev "search" URL query param to Debounced Input in collections page

* feat: [SC-26202] ⚙️ Adjust query params provider in namegraph.dev

* feat: [SC-26202] ⚙️ Enhance namegraph.dev URLs and code reusing

---------

Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Co-authored-by: Piotr Zawiślan <59446552+Byczong@users.noreply.github.com>
Co-authored-by: kwrobel.eth <djstrong@gmail.com>
Co-authored-by: Eduardo <eduramme@gmail.com>
Co-authored-by: Jamie Barton <jamie@notrab.dev>
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.

3 participants