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

✨ Integrate NameGraph SDK API call into Explore Collections page and make collections exploring page work #499

Merged
merged 20 commits into from
Dec 23, 2024

Conversation

FrancoAguzzi
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented Dec 19, 2024

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

Name Status Preview Comments Updated (UTC)
namegraph.dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 23, 2024 2:21am
namekit ❌ Failed (Inspect) Dec 23, 2024 2:21am
namekit.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 23, 2024 2:21am
namerank-io ❌ Failed (Inspect) Dec 23, 2024 2:21am
namerank.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 23, 2024 2:21am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples.nameguard.io ⬜️ Skipped (Inspect) Dec 23, 2024 2:21am
nameguard.io ⬜️ Skipped (Inspect) Dec 23, 2024 2:21am
namehashlabs.org ⬜️ Skipped (Inspect) Dec 23, 2024 2:21am
storybook.namekit.io ⬜️ Skipped (Inspect) Dec 23, 2024 2:21am

Copy link

changeset-bot bot commented Dec 19, 2024

⚠️ No Changeset found

Latest commit: bcd1816

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

…ections page and make collections exploring page work
@vercel vercel bot temporarily deployed to Preview – namehashlabs.org December 20, 2024 04:37 Inactive
@vercel vercel bot temporarily deployed to Preview – storybook.namekit.io December 20, 2024 04:37 Inactive
@vercel vercel bot temporarily deployed to Preview – nameguard.io December 20, 2024 04:37 Inactive
@vercel vercel bot temporarily deployed to Preview – examples.nameguard.io December 20, 2024 04:37 Inactive
@FrancoAguzzi FrancoAguzzi changed the title Francoaguzzi/sc 25978/new namegraph mini app 2 ✨ Integrate NameGraph SDK API call into Explore Collections page and make collections exploring page work Dec 20, 2024
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.

@FrancoAguzzi Hey, appreciate the updates here. Exciting to see. I've approved this PR so that you can merge it, but please carefully review my feedback and either resolve it in this PR, or create a separate PR that resolves it. Thank you!

"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
],
safelist: [
Copy link
Member

Choose a reason for hiding this comment

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

Can you help me understand the goal here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes! Safelist makes it possible to generate programatically the bg colors used by the name ideas pills.

It seems like Tailwind runs in a different "time-space" (😅) than programatic JS, which can be attested by removing the "safelist" from Tailwind config: when we do so, the bg-[#SOMECOLOR] is not applied. Safelisting in Tailwind means including this class in Tailwind's bundle upfront, guaranteeing the classes inside "safelist" array will have corresponding Tailwind styling config present in the CSS bundle. 🙂 Does this help?

packages/namegraph-sdk/src/utils.ts Show resolved Hide resolved
packages/namegraph-sdk/src/utils.ts Show resolved Hide resolved
apps/namegraph.dev/lib/utils.ts Outdated Show resolved Hide resolved
}

// This array is used for checking when a category is not a "related" category
const NameGraphSuggestionCategoryTypes = Object.values(
Copy link
Member

Choose a reason for hiding this comment

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

Seems this idea should be moved into the SDK?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As this is a representation of the same NameGraph SDK present utility, but, with a different data structure, this is very much related to clients. I say this because apps might want to use this is different ways and mapping from one data structure to another one may be a responsibility of the client side, I think, so I wouldn't migrate this, what do you think?

apps/namegraph.dev/lib/utils.ts Outdated Show resolved Hide resolved
apps/namegraph.dev/lib/utils.ts Outdated Show resolved Hide resolved
export const generateNamesByQuery = async (
input: LabelAndModeQueryParams,
): Promise<NameGraphSuggestion[]> => {
if (input.label.includes("."))
Copy link
Member

Choose a reason for hiding this comment

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

Why are we using this strategy? Why aren't we implementing the same strategy as before where if the input includes "." that we internally process that so as to only use the childmost label for our query?

Here we should identify back to the user the exact label that we're using to generate ideas with. Please note the related UX for this that we implemented here: https://www.namerank.io/?name=example.name.with.multiple.labels

CleanShot 2024-12-20 at 17 29 48

  1. The users raw input query, which may include any number of labels.
  2. We show back to the user the label we're actually going to use in the query.
  3. We show the result of the query.

Please study the UX and implementation referenced above. We should follow the same pattern here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now following the same pattern of using the childmost label for search. Mini-app is also displaying both the complete and the query-used strings, alongside with the results!

@vercel vercel bot temporarily deployed to Preview – storybook.namekit.io December 23, 2024 02:19 Inactive
@vercel vercel bot temporarily deployed to Preview – examples.nameguard.io December 23, 2024 02:19 Inactive
@vercel vercel bot temporarily deployed to Preview – nameguard.io December 23, 2024 02:19 Inactive
@vercel vercel bot temporarily deployed to Preview – namehashlabs.org December 23, 2024 02:19 Inactive
@FrancoAguzzi FrancoAguzzi merged commit 501b1ae into main Dec 23, 2024
17 checks passed
@FrancoAguzzi FrancoAguzzi deleted the francoaguzzi/sc-25978/new-namegraph-mini-app-2 branch December 23, 2024 02:24
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