feat: beautifyInterpretedName helper + example usage#2050
Conversation
🦋 Changeset detectedLatest commit: fa8b516 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the change is additive, well-tested, and correctly scoped to UI display paths. The core function is simple and exercised by four targeted test cases. The branded No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[InterpretedName] --> B{name === ENS_ROOT_NAME?}
B -- Yes --> C[return as BeautifiedName verbatim]
B -- No --> D[interpretedNameToInterpretedLabels\nsplit by '.']
D --> E{For each label}
E --> F{isEncodedLabelHash?}
F -- Yes --> G[preserve label verbatim]
F -- No --> H[ens_beautify label\ne.g. ♾ → ♾️]
G --> I[join with '.']
H --> I
I --> J[BeautifiedName]
J --> K[UI Display only]
A --> L[Navigation / Lookups\nInterpretedName kept unchanged]
Reviews (4): Last reviewed commit: "fix: bot notes (loop 3) — drop stale can..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Adds a new enssdk helper for converting InterpretedName values into UI-facing beautified names, and updates the React example app to render those beautified labels while keeping canonical names in navigation targets.
Changes:
- Added
BeautifiedNameandbeautifyInterpretedName()toenssdk, plus unit tests and a changeset. - Exported the new helper from the package root.
- Updated the example app’s domain/account/search views to display beautified names, and surfaced
ENSNODE_URLon the home page.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/enssdk/src/lib/types/ens.ts |
Adds the new branded BeautifiedName type and its docs. |
packages/enssdk/src/lib/index.ts |
Re-exports the new beautify helper from the public library entrypoint. |
packages/enssdk/src/lib/beautify.ts |
Implements beautifyInterpretedName() for InterpretedName inputs. |
packages/enssdk/src/lib/beautify.test.ts |
Adds unit tests for root, normalized labels, and encoded labelhash handling. |
examples/enskit-react-example/src/SearchView.tsx |
Beautifies rendered search results in the example search UI. |
examples/enskit-react-example/src/DomainView.tsx |
Beautifies displayed domain names and makes owner addresses clickable. |
examples/enskit-react-example/src/App.tsx |
Shows the configured ENSNODE_URL on the example home page. |
examples/enskit-react-example/src/AccountView.tsx |
Beautifies owned-domain labels in the account view. |
.changeset/enssdk-beautify-interpreted-name.md |
Records the enssdk minor release note for the new helper/type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@greptile review |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fea4346 to
fa8b516
Compare
|
@greptileai review |
Summary
beautifyInterpretedName(name: InterpretedName): BeautifiedNametoenssdkfor converting an InterpretedName into a UI-presentable Name. Each label is preserved verbatim if it's an Encoded LabelHash, otherwise passed throughens_beautifyfrom@adraffy/ens-normalize. Example:"♾♾♾♾.eth"→"♾️♾️♾️♾️.eth".BeautifiedNamenominal type alongsideInterpretedName. The branded return type prevents the result from being passed to APIs that expect anInterpretedName(navigation targets, lookups, GraphQL variables, etc.).DomainView,AccountView,SearchView) so all rendered names are beautified, while linkto=and lookup keys continue to use the source InterpretedName. Also a smallHometweak inApp.tsxto surface the connected ENSNODE_URL.Test plan
pnpm -F enssdk typecheckpnpm -F @ensnode/enskit-react-example typecheckpnpm -F @namehash/namehash-ui typecheckpnpm test --project enssdk(256 passed, includes newbeautify.test.ts)pnpm lint♾♾♾♾.eth) and confirm the heading/link text renders the variation-selector form while the URL still uses the InterpretedName