Skip to content

Conversation

@Y3drk
Copy link
Contributor

@Y3drk Y3drk commented Jan 20, 2026

Lite PR → Fix RegistrarActionCard props

Summary

  • Refactored the props of RegistrarActionCard component in the namehash-ui (see packages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx:60-70) and applied these changes in ENSAdmin

Why

  • This change is a fix of a bug spotted during self-review of PR #109 in ENSAwards.

Testing

  • Tested the affected UI component (<RegistrarActionCard>) in ENSAdmin locally and in the Vercel preview. Test shown expected behavior.

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

Deemed changesets unnecessary, because:

Summary by CodeRabbit

  • Refactor
    • Standardized how referrer links are represented and resolved across registrar actions, centralizing link metadata (external flag + link resolver). No visible UI or tooltip changes; link behavior remains consistent for end users.

✏️ Tip: You can customize this high-level summary in your review settings.

@Y3drk Y3drk self-assigned this Jan 20, 2026
Copilot AI review requested due to automatic review settings January 20, 2026 10:16
@Y3drk Y3drk added the ensnode-internal ensnode-internal related label Jan 20, 2026
@changeset-bot
Copy link

changeset-bot bot commented Jan 20, 2026

⚠️ No Changeset found

Latest commit: e276675

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 20, 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 20, 2026 10:23am
2 Skipped Deployments
Project Deployment Review Updated (UTC)
ensnode.io Skipped Skipped Jan 20, 2026 10:23am
ensrainbow.io Skipped Skipped Jan 20, 2026 10:23am

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Replaces a function-style referrerLinkFunction with a ReferrerLinkData object (isExternal + getLink) across registrar action components. Updates prop names and call sites so referrer resolution uses referrerLinkData.getLink(...) and referrerLinkData.isExternal instead of the previous function prop.

Changes

Cohort / File(s) Summary
RegistrarActionCard & referrer types
packages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx
Replaced ReferrerLinkFunction with ReferrerLinkData { isExternal: boolean; getLink(...) }; updated props (ResolveAndDisplayReferrerIdentity, RegistrarActionCardProps) and internal usages to accept and call referrerLinkData.getLink(...) and read referrerLinkData.isExternal.
ENS Admin display integration
apps/ensadmin/src/components/registrar-actions/display-registrar-actions-panel.tsx
Updated links prop to pass a referrer object: isExternal: true and getLink: getEnsManagerAddressDetailsUrl instead of a referrerLinkFunction.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • feat(namehash-ui): refine package #1551: Introduced earlier changes around referrer link handling (function-based getReferrerLink/referrerLinkFunction) that this PR replaces with the ReferrerLinkData object pattern.

Poem

🐰 I swapped a function for a tiny crate,
With isExternal proud and getLink great,
Links now hop neat from place to place,
A rabbit's joy — a tidy trace,
Hooray for referrers, swift and straight! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change—a refactor of RegistrarActionCard props—and is clear and specific.
Description check ✅ Passed The description follows the template with all required sections (Summary, Why, Testing) filled out. Pre-review checklist is completed.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch y3drk/fix/fix-registrar-action-card-props

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

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 refactors the RegistrarActionCard component's props to improve type safety and API consistency. The change was identified as a bug fix during self-review of PR #109 in ENSAwards.

Changes:

  • Replaced the referrerLinkFunction prop with a referrerLinkData object that encapsulates both the link generation function and an isExternal boolean flag
  • Updated the RegistrarActionCard component and its internal ResolveAndDisplayReferrerIdentity helper to use the new prop structure
  • Applied the refactored prop structure in ENSAdmin's usage of the component

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx Introduced ReferrerLinkData interface and updated component props to use the new structure instead of ReferrerLinkFunction
apps/ensadmin/src/components/registrar-actions/display-registrar-actions-panel.tsx Updated to pass referrer object with isExternal and getLink properties instead of referrerLinkFunction

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

@vercel vercel bot temporarily deployed to Preview – ensrainbow.io January 20, 2026 10:22 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io January 20, 2026 10:22 Inactive
@Y3drk Y3drk marked this pull request as ready for review January 20, 2026 10:43
@Y3drk Y3drk requested a review from a team as a code owner January 20, 2026 10:43
Copilot AI review requested due to automatic review settings January 20, 2026 10:43
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 2 out of 2 changed files in this pull request and generated no new comments.


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

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 20, 2026

Greptile Summary

Refactored the <RegistrarActionCard> component's referrer link handling from a simple function prop to a structured object with metadata. The new ReferrerLinkData interface includes both the link resolver function (getLink) and an isExternal flag, making the component more flexible and allowing consuming applications to control link behavior.

Key Changes:

  • Replaced referrerLinkFunction prop with referrer: ReferrerLinkData object containing isExternal boolean and getLink function
  • Exported new ReferrerLinkData interface for type-safe consumption
  • Updated ENSAdmin implementation to use the new structured prop format
  • Maintained backward compatibility in behavior while improving API clarity

This change enables the component to be properly integrated into ENSAwards (external repository) where different link behaviors are needed.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The refactoring is straightforward, type-safe, and well-contained. All usages within the monorepo have been updated correctly. The change improves the component API by making link metadata explicit rather than hardcoded. No breaking changes for external consumers since the old prop has been completely replaced and the function signature remains compatible.
  • No files require special attention

Important Files Changed

Filename Overview
packages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx Refactored referrer link prop from function to structured object with isExternal flag and getLink function. Type-safe and properly exported.
apps/ensadmin/src/components/registrar-actions/display-registrar-actions-panel.tsx Updated to use new referrer prop structure with isExternal: true and getLink function. Correctly implements the new API.

Sequence Diagram

sequenceDiagram
    participant Consumer as ENSAdmin Consumer
    participant Card as RegistrarActionCard
    participant ReferrerDisplay as ResolveAndDisplayReferrerIdentity
    participant Identity as ResolveAndDisplayIdentity
    participant LinkResolver as getEnsManagerAddressDetailsUrl

    Consumer->>Card: Pass referrer prop {isExternal, getLink}
    Card->>ReferrerDisplay: Pass referrerLinkData
    ReferrerDisplay->>ReferrerDisplay: Decode referral & validate
    alt Valid referrer address
        ReferrerDisplay->>LinkResolver: getLink(address, namespaceId)
        LinkResolver-->>ReferrerDisplay: URL | null
        ReferrerDisplay->>Identity: Pass identityLinkDetails {isExternal, link}
        Identity-->>Card: Render referrer with link
    else Invalid/zero referrer
        ReferrerDisplay-->>Card: Render fallback (-/Unknown)
    end
Loading

@Y3drk Y3drk linked an issue Jan 20, 2026 that may be closed by this pull request
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 Looks good, thanks!

@lightwalker-eth lightwalker-eth merged commit 3bc61ab into main Jan 20, 2026
24 of 25 checks passed
@lightwalker-eth lightwalker-eth deleted the y3drk/fix/fix-registrar-action-card-props branch January 20, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ensnode-internal ensnode-internal related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create new package in ENSNode monorepo: namehash-ui

3 participants