Skip to content

feat(omnigraph): ENSIP-15 beautified Name & Label fields#2161

Merged
shrugs merged 3 commits into
mainfrom
feat/beautified-name-label-fields
May 20, 2026
Merged

feat(omnigraph): ENSIP-15 beautified Name & Label fields#2161
shrugs merged 3 commits into
mainfrom
feat/beautified-name-label-fields

Conversation

@shrugs
Copy link
Copy Markdown
Member

@shrugs shrugs commented May 20, 2026

Summary

  • enssdk: add beautifyInterpretedLabel (Encoded LabelHashes verbatim, else ens_beautify) + BeautifiedLabel branded type; beautifyInterpretedName now maps over it.
  • omnigraph: add BeautifiedName/BeautifiedLabel scalars, CanonicalName.beautified: BeautifiedName!, and Label.beautified: BeautifiedLabel! (beautified per ENSIP-15).

Why

  • expose ENSIP-15 beautification server-side so consumers render canonical { name { beautified } } directly instead of calling beautifyInterpretedName client-side. closes Return beautified display names #1501.

Testing

  • added beautifyInterpretedLabel unit tests (normalized label + Encoded LabelHash passthrough).
  • pnpm generate, full pnpm typecheck, pnpm lint, and affected pnpm test --project enssdk --project ensapi all pass.

Notes for Reviewer (Optional)

Checklist

  • This PR does not change runtime behavior or semantics
  • This PR is low-risk and safe to review quickly

Add display-only `CanonicalName.beautified` and `Label.beautified` fields
(new BeautifiedName/BeautifiedLabel scalars) and a `beautifyInterpretedLabel`
helper in enssdk. Closes #1501.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 20, 2026 19:45
@shrugs shrugs requested a review from a team as a code owner May 20, 2026 19:45
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

🦋 Changeset detected

Latest commit: ab136c7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
ensapi Minor
enssdk Minor
ensindexer Minor
ensrainbow Minor
@ensnode/datasources Minor
@namehash/ens-referrals Minor
@ensnode/ensdb-sdk Minor
enskit Minor
@ensnode/ensnode-sdk Minor
@ensnode/ensrainbow-sdk Minor
@namehash/namehash-ui Minor
ensadmin Minor
fallback-ensapi Minor
@ensnode/integration-test-env Minor
@docs/ensnode Minor
@docs/ensrainbow Minor
enscli Minor
ensskills Minor
@ensnode/ponder-sdk Minor
@ensnode/ponder-subgraph Minor
@ensnode/shared-configs Minor
@ensnode/ensindexer-perf-testing Minor

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment May 20, 2026 7:56pm
enskit-react-example.ensnode.io Ready Ready Preview, Comment May 20, 2026 7:56pm
ensnode.io Ready Ready Preview, Comment May 20, 2026 7:56pm
ensrainbow.io Ready Ready Preview, Comment May 20, 2026 7:56pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Warning

Rate limit exceeded

@shrugs has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 40 minutes and 54 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: eb1a1b97-b81c-4b17-8a21-c4fd0412a67b

📥 Commits

Reviewing files that changed from the base of the PR and between 0086b7b and ab136c7.

⛔ Files ignored due to path filters (2)
  • packages/enssdk/src/omnigraph/generated/introspection.ts is excluded by !**/generated/**
  • packages/enssdk/src/omnigraph/generated/schema.graphql is excluded by !**/generated/**
📒 Files selected for processing (10)
  • .changeset/ensapi-beautified-fields.md
  • .changeset/enssdk-beautify-interpreted-label.md
  • apps/ensapi/src/omnigraph-api/builder.ts
  • apps/ensapi/src/omnigraph-api/schema/canonical-name.ts
  • apps/ensapi/src/omnigraph-api/schema/label.ts
  • apps/ensapi/src/omnigraph-api/schema/scalars.ts
  • packages/enssdk/src/lib/beautify.test.ts
  • packages/enssdk/src/lib/beautify.ts
  • packages/enssdk/src/lib/types/ens.ts
  • packages/enssdk/src/omnigraph/graphql.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/beautified-name-label-fields

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds ENSIP-15 “beautified” (display-only) name/label representations to the Omnigraph API and the ENS SDK, so consumers can render beautified canonical names/labels directly from GraphQL without client-side beautification.

Changes:

  • enssdk: introduce beautifyInterpretedLabel + BeautifiedLabel branded type, and refactor beautifyInterpretedName to use it.
  • ensapi Omnigraph: add BeautifiedName/BeautifiedLabel scalars and expose CanonicalName.beautified + Label.beautified.
  • Update generated Omnigraph schema/types + add Changesets for enssdk and ensapi.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/enssdk/src/omnigraph/graphql.ts Adds scalar mappings for BeautifiedName/BeautifiedLabel in gql.tada client types.
packages/enssdk/src/omnigraph/generated/schema.graphql Regenerated schema reflecting new scalars and fields.
packages/enssdk/src/lib/types/ens.ts Introduces BeautifiedLabel branded type and ENSIP-15 docs for beautified types.
packages/enssdk/src/lib/beautify.ts Adds beautifyInterpretedLabel and refactors beautifyInterpretedName to map per-label.
packages/enssdk/src/lib/beautify.test.ts Adds unit tests for beautifyInterpretedLabel and keeps name beautification coverage.
apps/ensapi/src/omnigraph-api/schema/scalars.ts Adds Pothos scalar definitions for BeautifiedName/BeautifiedLabel.
apps/ensapi/src/omnigraph-api/schema/label.ts Adds Label.beautified resolver using SDK beautification.
apps/ensapi/src/omnigraph-api/schema/canonical-name.ts Adds CanonicalName.beautified resolver using SDK beautification.
apps/ensapi/src/omnigraph-api/builder.ts Extends builder scalar typing to include BeautifiedName/BeautifiedLabel.
.changeset/enssdk-beautify-interpreted-label.md Changeset for new SDK helper/type.
.changeset/ensapi-beautified-fields.md Changeset for new Omnigraph scalars/fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/ensapi/src/omnigraph-api/schema/scalars.ts
Comment thread apps/ensapi/src/omnigraph-api/schema/scalars.ts Outdated
Comment thread apps/ensapi/src/omnigraph-api/schema/label.ts
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 20, 2026

Greptile Summary

This PR introduces ENSIP-15 beautification server-side, exposing a new beautified field on CanonicalName and Label in the GraphQL schema, backed by a new beautifyInterpretedLabel helper function and a BeautifiedLabel branded type in enssdk.

  • beautifyInterpretedLabel is extracted from inline logic in beautifyInterpretedName, handling Encoded LabelHashes verbatim and passing normalized labels through ens_beautify; beautifyInterpretedName is refactored to delegate to it, dropping a now-redundant ENS_ROOT_NAME guard (the behavior is preserved because interpretedNameToInterpretedLabels("") returns [] and [].join(".") returns "").
  • BeautifiedName / BeautifiedLabel GraphQL scalars and their branded TypeScript types are added and wired through builder, schema, introspection, and gql.tada scalar mappings, with consistent serialize/parseValue implementations matching the existing scalar pattern.

Confidence Score: 5/5

Safe to merge — purely additive changes with no modifications to existing resolution or lookup paths.

All changes are additive: new fields, new types, and a clean refactor of beautifyInterpretedName into beautifyInterpretedLabel. The removed ENS_ROOT_NAME guard is correctly handled by interpretedNameToInterpretedLabels returning an empty array for the root name, covered by the existing test. The new GraphQL scalars follow the same pattern as existing ones, and the resolvers are well-guarded.

No files require special attention.

Important Files Changed

Filename Overview
packages/enssdk/src/lib/beautify.ts Extracts beautifyInterpretedLabel from inline logic and simplifies beautifyInterpretedName; the removed ENS_ROOT_NAME guard is correctly covered by interpretedNameToInterpretedLabels's empty-array short-circuit.
packages/enssdk/src/lib/types/ens.ts Adds BeautifiedLabel branded type with clear documentation; @see link added to existing BeautifiedName doc comment.
apps/ensapi/src/omnigraph-api/schema/canonical-name.ts Adds beautified: BeautifiedName! field with a null-guard consistent with the existing interpreted resolver.
apps/ensapi/src/omnigraph-api/schema/label.ts Adds beautified: BeautifiedLabel! field delegating to beautifyInterpretedLabel(parent.interpreted); shares the same null-safety assumption as the existing interpreted field.
apps/ensapi/src/omnigraph-api/schema/scalars.ts Registers BeautifiedName and BeautifiedLabel scalars; parseValue uses a plain cast (no runtime validation), which is appropriate for output-only scalars produced server-side; also corrects "a enssdk#" to "an enssdk#" across all scalar descriptions.
packages/enssdk/src/omnigraph/graphql.ts Adds BeautifiedName/BeautifiedLabel to OmnigraphScalars for gql.tada type inference; straightforward mapping change.
packages/enssdk/src/lib/beautify.test.ts Adds unit tests for the new beautifyInterpretedLabel covering the normalized-label and Encoded-LabelHash cases.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[InterpretedLabel] --> B{isEncodedLabelHash?}
    B -- yes --> C[return label verbatim]
    B -- no --> D[ens_beautify label]
    D --> E[BeautifiedLabel]
    C --> E

    F[InterpretedName] --> G[interpretedNameToInterpretedLabels]
    G -- empty string root --> H["[] join dot returns empty"]
    H --> I[BeautifiedName]
    G -- normal name --> J["[InterpretedLabel, ...]"]
    J --> K[map beautifyInterpretedLabel]
    K --> L["join dot"]
    L --> I

    M[CanonicalName.beautified resolver] --> N{domain.canonicalName?}
    N -- null --> O[throw Invariant Error]
    N -- present --> F

    P[Label.beautified resolver] --> Q[parent.interpreted]
    Q --> A
Loading

Reviews (3): Last reviewed commit: "fix(ensapi): grammar in omnigraph scalar..." | Re-trigger Greptile

@shrugs
Copy link
Copy Markdown
Member Author

shrugs commented May 20, 2026

@greptile review

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.

Return beautified display names

2 participants