Skip to content

Conversation

@Y3drk
Copy link
Contributor

@Y3drk Y3drk commented Jan 13, 2026

Substantial PR → apply namehash-ui package in ensadmin


Reviewer Focus (Read This First)

What reviewers should focus on
  • The package itself has gone through some setup changes. I couldn't figure it out by myself, and got helped out by @notrab (kudos). So it would be really great if someone could double-check that logic → packages/namehash-ui/package.json:44-45
  • The biggest change regarding the UI came in the form of using packages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx in apps/ensadmin/src/components/registrar-actions/display-registrar-actions-panel.tsx:32-73 → it slightly alters the look of https://admin.ensnode.io/registrar-actions so I'd advise checking it out both in code and in the preview.
  • Other swaps were fairly straightforward, so I'd advise checking it out in the preview and comparing the UI to the current production version of ENSAdmin.

Problem & Motivation

Why this exists

What Changed (Concrete)

What actually changed

List the concrete behavioral or structural changes in this PR.

This should be a factual inventory, not a narrative.
Prefer numbered bullets.

If this list starts getting long, that's a signal the PR may need splitting.

  • Swapped local ensadmin components for their counterparts from the namehash-ui package and deleted unused code. (changes mostly located in apps/ensadmin/src/components)
  • Refined the package's setup in packages/namehash-ui/package.json:44-45 (with the help of @notrab)
  • Adjusted the package's styles to not clash with ENSAdmin's setup (packages/namehash-ui/src/styles.css)

Design & Planning

How this approach was chosen

Self-Review

  • Bugs caught:
    • Caught & fixed the incorrect formula for styling component in packages/namehash-ui/src/components/identity/EnsAvatar.tsx:73
    • Aligned tooltip content on /status to the left (unification with all other places) in apps/ensadmin/src/components/indexing-status/block-refs.tsx:75
    • Spotted that the styling of the <Toaster> (apps/ensadmin/src/components/ui/sonner.tsx) flipped. After the follow-up investigation discovered that it happened right after I upgraded the Tailwind version in ENSAdmin. Since it's very minor difference and not a breaking change, I decided to move solving it into a new PR. UPDATE → this is now solved.
  • Logic simplified: -
  • Naming / terminology improved: - (No terminology was changed between this PR and changes from chore(namehash-ui): Copy shared components from ENSAdmin & ENSAwards #1507)
  • Dead or unnecessary code removed (or why none was): Removed duplicated components from ENSAdmin (from apps/ensadmin/src/components)

Cross-Codebase Alignment

  • Search terms used: tailwindcss classes collisions, react UI component library setup → used for brainstorming when solving CSS-related issues reported on Wednesday (01/14/26) and the Vercel build issues that surfaced later on.
  • Reviewed but unchanged: namekit/packages/namekit-react, docs/ensnode.io, ensawards.org → mostly as above, also a general inspiration on how to apply the package
  • Deferred alignment (with rationale): Unification of tooltip styles across ENSAdmin & ENSAwards (needs @sskvts's help, left related comment as a TODO in packages/namehash-ui/src/components/identity/Identity.tsx:120-121)

Downstream & Consumer Impact

Who this affects and how
  • These changes will affect ENSAdmin's users (very minor changes to the UI, not UX) and developers (new dependency, deduplication of code).
  • Overall, it's another step to make the UI part of our apps (ENSAdmin, ENSAwards, and co) easier to maintain and faster to develop.
  • No terminology was changed between this PR and changes from chore(namehash-ui): Copy shared components from ENSAdmin & ENSAwards #1507
  • Public APIs affected: None
  • Docs updated: None (swapping shouldn't affect anything other than the UI)
  • Naming decisions worth calling out: None

Testing Evidence

  • Testing performed: Run the CI tests and built previews (as per our usual workflow) and tested the UI locally and in the Vercel preview by going through the pages containing swapped components, checking out the layout, and comparing the UI with the current production version of ENSAdmin
  • Known gaps: The components in the package might still not be perfectly adjusted to be used in ENSAwards. I plan on refining such issues in a new PR (in ensawards's repo)
  • What reviewers have to reason about manually (and why): Minor UI changes that resulted from the unification of components (mostly related to registrar-actions as mentioned in the summary.
  • If this is wrong, what breaks first: ENSAdmin's UI (some styling errors or layout breaks, although very unlikely). As the preview was built sucessfully I assume that that will also be the case for prod.

Scope Reductions

  • Follow-ups: Complete alignment of the package's components to be fully compatible with both ENSAdmin & ENSAwards (the refinement for the latter is what's lacking)
  • Why they were deferred: I will do it in a new PR (in parallel with swapping the components in ENSAwards) + it might turn out to only require some minor changes or none at all.

Risk Analysis

How this could go wrong
  • Assumptions this PR relies on: Changes to prebublish and postinstall setup scripts (of the package) will work in production in the same way as they worked in the previews (99.99% sure they will)
  • Likely failure modes: Broken ENSAdmin UI (some styles not applied, layouts broken → all in all highly unlikely after the testing)
  • Blast radius if it breaks: ENSAdmin & namehash-ui
  • Risk areas: ENSAdmin (mostly its UI, as the preview was built successfully, so I assume that that will also be the case for prod)
  • Mitigations or rollback options: Rollback this PR (reinstate local ensadmin components or copy them directly from ENSAwards)
  • Named owner if this causes problems: @Y3drk

Pre-Review Checklist (Blocking)

  • I reviewed every line of this diff and understand it end-to-end
  • I'm prepared to defend this PR line-by-line in review
  • I'm comfortable being the on-call owner for this change
  • Relevant changesets are included (or explicitly not required)

@Y3drk Y3drk self-assigned this Jan 13, 2026
@Y3drk Y3drk added the ensadmin ENSAdmin related label Jan 13, 2026
@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2026

🦋 Changeset detected

Latest commit: aedf27d

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

This PR includes changesets to release 18 packages
Name Type
@namehash/namehash-ui Patch
ensadmin Patch
ensindexer Patch
ensrainbow Patch
ensapi Patch
fallback-ensapi Patch
@ensnode/datasources Patch
@ensnode/ensrainbow-sdk Patch
@ensnode/ponder-metadata Patch
@ensnode/ensnode-schema Patch
@ensnode/ensnode-react Patch
@ensnode/ponder-subgraph Patch
@ensnode/ensnode-sdk Patch
@ensnode/shared-configs Patch
@docs/ensnode Patch
@docs/ensrainbow Patch
@docs/mintlify Patch
@namehash/ens-referrals Patch

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

vercel bot commented Jan 13, 2026

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

Project Deployment Review Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment Jan 16, 2026 8:46pm
ensnode.io Ready Ready Preview, Comment Jan 16, 2026 8:46pm
ensrainbow.io Ready Ready Preview, Comment Jan 16, 2026 8:46pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 16, 2026

Greptile Summary

This PR successfully applies the @namehash/namehash-ui package across ENSAdmin, completing Phase 5 of the UI component unification effort. The changes replace duplicated local components with their centralized counterparts from the shared package.

Key Changes:

  • Migrated 12+ components from ENSAdmin to use the namehash-ui package (Identity, EnsAvatar, ChainIcon, CopyButton, RelativeTime, etc.)
  • Removed ~1,435 lines of duplicated code from ENSAdmin
  • Refined package build setup with postinstall and prepublish scripts for automatic CSS compilation
  • Applied nhui: prefix to all Tailwind classes in the package to prevent style collisions with consuming apps
  • Updated RegistrarActionCard to accept flexible identityLinkDetails for cross-app compatibility

Self-Review Items Validated:

  • ✓ Bug fix in EnsAvatar.tsx:73 correctly passes isSquare prop instead of className to AvatarLoading
  • ✓ Tooltip alignment fix in block-refs.tsx:75 adds left-aligned styling for consistency
  • ✓ Package setup changes in package.json:44-45 properly configure build hooks

Minor UI Impact:
The registrar actions display at /registrar-actions has subtle layout changes due to the unified component structure, but functionality remains intact.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured and follow a clear migration pattern. The package has proper CSS prefixing to avoid conflicts, build scripts are correctly configured, and extensive testing was done via CI and Vercel previews. The code removal (-1435 lines) represents successful deduplication rather than lost functionality. The author performed thorough self-review and caught multiple bugs before submission.
  • No files require special attention

Important Files Changed

Filename Overview
packages/namehash-ui/package.json Setup scripts refined with postinstall and prepublish hooks to build CSS automatically
packages/namehash-ui/src/styles.css Added nhui: prefix to all Tailwind classes to prevent collision with ENSAdmin styles
packages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx Refactored to accept identityLinkDetails for flexible link configuration across apps
apps/ensadmin/src/components/registrar-actions/display-registrar-actions-panel.tsx Now imports and uses RegistrarActionCardMemo and RegistrarActionCardLoading from namehash-ui package
apps/ensadmin/src/app/globals.css Added import for @namehash/namehash-ui/styles.css at the top to load package styles

Sequence Diagram

sequenceDiagram
    participant EA as ENSAdmin App
    participant GC as globals.css
    participant UI as @namehash/namehash-ui
    participant RC as RegistrarActionCard
    participant ID as Identity Components
    
    EA->>GC: Import styles
    GC->>UI: @import "@namehash/namehash-ui/styles.css"
    UI-->>GC: Load prefixed styles (nhui:)
    
    Note over EA,UI: Component Migration Flow
    
    EA->>UI: Import RegistrarActionCardMemo
    EA->>UI: Import RegistrarActionCardLoading
    EA->>UI: Import ResolveAndDisplayIdentity
    EA->>UI: Import ChainIcon, ChainName
    EA->>UI: Import CopyButton, RelativeTime
    EA->>UI: Import EnsAvatar
    
    Note over RC: Component Usage in ENSAdmin
    
    EA->>RC: Render RegistrarActionCard
    RC->>ID: ResolveAndDisplayIdentity (registrant)
    RC->>ID: ResolveAndDisplayIdentity (referrer)
    ID->>UI: useResolvedIdentity hook
    UI-->>ID: Return resolved identity
    ID->>UI: EnsAvatar component
    UI-->>ID: Render avatar
    ID-->>RC: Display identity with avatar
    RC-->>EA: Render complete card
    
    Note over EA,UI: Build Process
    
    UI->>UI: postinstall: pnpm build:css
    UI->>UI: prepublish: pnpm build:css && tsup
    UI-->>EA: Package ready for consumption
Loading

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.

@Y3drk Hey thanks for these updates. Reviewed and shared suggestions 👍 Appreciate your advice!

… in connection dialog and sonner/toaster theming
Copy link
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

This PR integrates the @namehash/namehash-ui package into the ENSAdmin application, replacing local component implementations with shared package components. The changes deduplicate code, improve maintainability, and establish a foundation for UI consistency across NameHash applications.

Changes:

  • Replaced local ENSAdmin components with equivalents from @namehash/namehash-ui package
  • Refined the package's build setup with CSS processing scripts (postinstall, prepublish, build:css)
  • Namespaced CSS variables with --nhui- prefix to prevent style conflicts

Reviewed changes

Copilot reviewed 61 out of 63 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/namehash-ui/package.json Added CSS build scripts and postcss-cli dependency
packages/namehash-ui/src/styles.css Namespaced CSS variables with --nhui- prefix
packages/namehash-ui/src/index.ts Exported additional utilities and hooks
packages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx Updated interface to make identityLinkDetails non-required and remove referrer link
apps/ensadmin/package.json Added @namehash/namehash-ui dependency
apps/ensadmin/src/components/* Replaced local components with package imports
apps/ensadmin/src/lib/namespace-utils.ts Deleted (utilities moved to package)
apps/ensadmin/src/components/registrar-actions/display-registrar-actions-panel.tsx Integrated RegistrarActionCard from package
apps/ensadmin/src/app/globals.css Imported package styles and removed dark mode CSS
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

apps/ensadmin/src/app/globals.css:1

  • Removing all dark mode CSS variables suggests dark mode support has been removed from ENSAdmin. This is a significant UX change that should be explicitly documented in the PR description or CHANGESET, as it affects user experience.
@import "@namehash/namehash-ui/styles.css";

packages/namehash-ui/src/components/datetime/RelativeTime.tsx:73

  • Adding tooltipStyles as a plain string prop is less type-safe than using React component props types. Consider using React.ComponentProps<typeof TooltipContent>['className'] for better type safety and autocompletion.

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

Comment on lines 56 to +58
interface ResolveAndDisplayReferrerIdentityProps
extends Omit<ResolveAndDisplayIdentityProps, "identity"> {
extends Omit<ResolveAndDisplayIdentityProps, "identity" | "identityLinkDetails"> {
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The removal of identityLinkDetails from the props interface is inconsistent with the component's implementation, which hardcodes the link details at line 147-150. This reduces flexibility for consumers who may want to customize where the referrer identity links point to.

Copilot uses AI. Check for mistakes.
Copy link
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

Copilot reviewed 61 out of 63 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/namehash-ui/src/components/identity/ResolveAndDisplayIdentity.tsx:211

  • This runtime error can be prevented at compile time. Since withLink and identityLinkDetails are related, consider using TypeScript's conditional types or function overloading to enforce that when withLink is true, identityLinkDetails must be provided. This would catch errors at build time rather than runtime.

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

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.

@Y3drk Super updates! Thanks for all your craftsmanship 😄

@lightwalker-eth lightwalker-eth merged commit a0126b2 into main Jan 17, 2026
13 checks passed
@lightwalker-eth lightwalker-eth deleted the y3drk/feat/apply-namehash-ui-in-ensadmin branch January 17, 2026 07:02
@github-actions github-actions bot mentioned this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ensadmin ENSAdmin related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants