Skip to content

feat(ensadmin): handle inspect records name in query params#1816

Merged
notrab merged 22 commits intomainfrom
notrab/ensadmin-handle-record-inspect-state
Mar 31, 2026
Merged

feat(ensadmin): handle inspect records name in query params#1816
notrab merged 22 commits intomainfrom
notrab/ensadmin-handle-record-inspect-state

Conversation

@notrab
Copy link
Copy Markdown
Member

@notrab notrab commented Mar 24, 2026

Lite PR

Tip: Review docs on the ENSNode PR process

Summary

  • Made the /inspect/records route URL-driven via ?name= query param, enabling shareable inspection links.
  • Added cross-navigation actions: "Inspect Records" on the /name route and "View Profile" on the inspect/records response panel.
  • Updated breadcrumbs to display the inspected name with a link back to the base route.

Why

The Record Resolution Inspector stored name state locally (useState), so the URL never reflected which name was being inspected. This made it impossible to share a link that opens directly to a specific name's inspection.
The /name route already used query params for this and /inspect/records follows the same pattern.


Testing

  • Navigating to /inspect/records?name=vitalik.eth loads inspection results directly
  • Typing a name and pressing Enter updates the URL and triggers queries.
  • Clicking example pills navigates and updates URL/breadcrumbs.
  • "Inspect Records" action on /name?name=vitalik.eth links to the correct inspect URL.
  • "View Profile" link in the ENSNode Response panel links back to /name?name=....
  • Connection URL param (?connection=) is preserved across all navigations.

Notes for Reviewer (Optional)

  • Records Selection is intentionally not part of the URL
  • getRecordResolutionRelativePath was placed in @/components/name-links alongside getNameDetailsRelativePath since both are route builders for ENS name pages
  • The useRecords hook natively supports name: null to disable queries, so we removed the manual enabled: canQuery guard
  • The existing UseClearUrlParams in the root layout was updated to allow the name param on /inspect/records
  • Closes Enhance navigation to Record Resolution Inspector #1068

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)

@notrab notrab requested a review from a team as a code owner March 24, 2026 10:11
Copilot AI review requested due to automatic review settings March 24, 2026 10:11
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 24, 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 Mar 30, 2026 11:08am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
ensnode.io Skipped Skipped Mar 30, 2026 11:08am
ensrainbow.io Skipped Skipped Mar 30, 2026 11:08am

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 24, 2026

🦋 Changeset detected

Latest commit: 806ae46

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

This PR includes changesets to release 19 packages
Name Type
ensadmin Patch
ensindexer Patch
ensrainbow Patch
ensapi Patch
fallback-ensapi Patch
@ensnode/datasources Patch
@ensnode/ensrainbow-sdk Patch
@ensnode/ensdb-sdk Patch
@ensnode/ensnode-react Patch
@ensnode/ensnode-sdk Patch
@ensnode/ponder-sdk Patch
@ensnode/ponder-subgraph Patch
@ensnode/shared-configs Patch
@docs/ensnode Patch
@docs/ensrainbow Patch
@docs/mintlify Patch
@namehash/ens-referrals Patch
@namehash/namehash-ui Patch
@ensnode/integration-test-env 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

@notrab notrab changed the title handle inspected name in query params feat(ensadmin): handle inspect records name in query params Mar 24, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 24, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Record Resolution Inspector is now addressable via a name query parameter; pages, breadcrumbs, and input state read name from the URL and navigate by pushing routes. Cross-navigation added: "Inspect Records" action on Name pages and "View Profile" action in the inspector. Raw-connection URL params are preserved.

Changes

Cohort / File(s) Summary
Record Resolution Inspector Core
apps/ensadmin/src/app/inspect/records/page.tsx, apps/ensadmin/src/app/@breadcrumbs/inspect/records/page.tsx
Inspector now derives name from URL query, synchronizes input state from the query, navigates by pushing routes (retaining raw-connection param), conditionally renders resolve/output and updates breadcrumbs to show the name when present.
Name Profile Actions
apps/ensadmin/src/app/@actions/name/page.tsx, apps/ensadmin/src/app/@breadcrumbs/name/page.tsx
Added internal "Inspect Records" link that uses new helper and preserves raw-connection param; stopped decoding the name query param before use; external ENS App link is conditional on namespace; actions layout changed to a horizontal container.
Navigation Helpers
apps/ensadmin/src/components/name-links/index.tsx
Added exported getRecordResolutionRelativePath(name) that returns /inspect/records?name=${encodeURIComponent(name)} for constructing inspector links.
UI Component Extensions
apps/ensadmin/src/app/inspect/_components/render-requests-output.tsx
Added optional headerActions?: React.ReactNode prop and updated the response card header layout to render actions on the right (used for "View Profile" link).
Resolve Button Component
apps/ensadmin/src/app/inspect/_components/resolve-button.tsx
Added ResolveButton component (exported) with canResolve, hasChanged, onRefetch, and onNavigate props to replace manual refresh behavior and support navigate-vs-refetch branching.
Primary / Primary-Name Inspect Pages
apps/ensadmin/src/app/inspect/primary-name/page.tsx, apps/ensadmin/src/app/inspect/primary-names/page.tsx
Added router navigation to push query updates (preserving raw-connection param), initialize and sync inputs from trimmed query params, replace refresh with ResolveButton, and update example pills to navigate.
Layout & Release
apps/ensadmin/src/app/layout.tsx, .changeset/mighty-pillows-know.md
Allowed clearing name param for /inspect/records in UseClearUrlParams; added a changeset marking a patch release documenting shareable inspector URLs and cross-navigation links.

Sequence Diagram

sequenceDiagram
    actor User
    participant NamePage as "Name Profile Page"
    participant Router as "Next.js Router"
    participant RecordsPage as "Records Inspector"
    participant RenderOutput as "ENSNode Response Panel"

    User->>NamePage: Open /name?name=example.eth
    NamePage->>NamePage: Render "Inspect Records" action
    User->>NamePage: Click "Inspect Records"
    NamePage->>Router: push /inspect/records?name=example.eth
    Router->>RecordsPage: navigate with name query param
    RecordsPage->>RecordsPage: read name from URL, sync input state
    RecordsPage->>RenderOutput: fetch & render records (with headerActions)
    RenderOutput->>RenderOutput: render "View Profile" action
    User->>RenderOutput: Click "View Profile"
    RenderOutput->>Router: push /name?name=example.eth
    Router->>NamePage: navigate back to profile
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

ensnode-internal

Poem

🐰 I hopped from profile to inspector with glee,

Query names now travel and share with ease,
Breadcrumbs and buttons guide each tiny hop,
A click to inspect, a click back to swap,
Cheers from this rabbit—navigation at peace!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: making the inspect records route handle name parameters from query strings for shareability.
Description check ✅ Passed The PR description follows the template with all required sections: Summary (3 bullets), Why (with issue reference #1068), Testing (6 test cases), and Notes. Pre-Review Checklist included but changesets item unchecked.
Linked Issues check ✅ Passed All three objectives from #1068 are met: (1) /inspect/records is now URL-driven via ?name= param for shareable links, (2) 'Inspect Records' action added to /name route, (3) 'View Profile' link added to ENSNode Response panel. Records selection intentionally excluded per requirements.
Out of Scope Changes check ✅ Passed All changes are scoped to the three objectives: URL-driven inspect/records, cross-navigation actions, breadcrumb updates, and supporting utilities. No unrelated features or refactoring detected outside issue #1068 scope.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch notrab/ensadmin-handle-record-inspect-state

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.

notrab added 2 commits March 24, 2026 10:14
…y driving name state from query params, with cross-navigation links between name profiles and record inspection.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 24, 2026

Greptile Summary

This PR makes the /inspect/records route URL-driven by reading the inspected name from a ?name= query param, enabling shareable links like /inspect/records?name=vitalik.eth. It also adds bidirectional cross-navigation between the name profile page (/name) and the record inspector, and updates breadcrumbs to reflect the inspected name dynamically.

Key changes:

  • records/page.tsx: Replaces debounced local state with nameFromQuery from the URL; queries now only fire when ?name= is present; the input is wrapped in a <form> so pressing Enter triggers navigation; a "View Profile" action is injected into the response card header.
  • @actions/name/page.tsx: Adds an "Inspect Records" button alongside "View in ENS App", using getRecordResolutionRelativePath from the shared @/components/name-links module (consistent with the established pattern for getNameDetailsRelativePath).
  • @breadcrumbs/inspect/records/page.tsx: Upgraded to a dynamic client component that shows a two-level breadcrumb (linked "Record Resolution" + inspected name) when ?name= is present.
  • resolve-button.tsx: New shared component that replaces per-page "Refresh" buttons, distinguishing between "navigate to new URL" (when input has changed) and "refetch current URL" (when input matches the current URL param).
  • render-requests-output.tsx: Adds an optional headerActions slot to the ENSNode Response card, allowing per-page actions to be injected without coupling.
  • primary-name / primary-names pages: Adopt ResolveButton and navigateToAddress helpers with improved type safety (DefaultableChainId, isAddress guard); these pages retain their TODO for full URL-sync but gain consistent navigate-vs-refetch UX.
  • @breadcrumbs/name/page.tsx: Minor cleanup to use the consistent ?.trim() || null name-reading pattern.

Confidence Score: 5/5

Safe to merge — the implementation is correct, follows established patterns, and all prior review concerns have been addressed.

The only remaining finding is a P2 style suggestion (missing type="button" on ResolveButton), which is harmless in the current DOM layout since the button is always rendered outside the <form> element. All P1 concerns from previous review threads have been resolved.

No files require special attention.

Important Files Changed

Filename Overview
apps/ensadmin/src/app/inspect/records/page.tsx Core of the PR: switches from debounced local state to URL-driven query param (?name=), adds Enter-key form submission, conditionally renders results panel only when nameFromQuery is set, and surfaces a "View Profile" cross-navigation link in the response header.
apps/ensadmin/src/app/inspect/_components/resolve-button.tsx New shared component replacing per-page Refresh buttons; correctly distinguishes "navigate to new URL" vs "refetch same URL" but is missing type="button" on the underlying Button element.
apps/ensadmin/src/app/inspect/_components/render-requests-output.tsx Adds an optional headerActions slot to the ENSNode Response card header, allowing per-page cross-navigation links to be injected without coupling.
apps/ensadmin/src/app/@actions/name/page.tsx Adds an "Inspect Records" action button alongside the existing "View in ENS App" button; uses getRecordResolutionRelativePath from @/components/name-links (correctly placed per PR description) and preserves the connection param.
apps/ensadmin/src/app/@breadcrumbs/inspect/records/page.tsx Upgraded from a static breadcrumb to a dynamic client component that shows a linked "Record Resolution" crumb plus the inspected name when ?name= is present in the URL.
apps/ensadmin/src/components/name-links/index.tsx Adds getRecordResolutionRelativePath alongside the existing getNameDetailsRelativePath, following the established shared-utility pattern.
apps/ensadmin/src/app/inspect/primary-name/page.tsx Adopts ResolveButton, type-safe DefaultableChainId, and navigateToAddress helper with proper chainId validation; URL sync for address/chainId via useEffect is correct.
apps/ensadmin/src/app/inspect/primary-names/page.tsx Adopts ResolveButton and navigateToAddress with proper isAddress guard; queries remain debounce-driven (acknowledged TODO), while the button now requires a valid address before enabling navigation.
apps/ensadmin/src/app/@breadcrumbs/name/page.tsx Minor cleanup: replaces decodeURIComponent(nameParam) pattern with the consistent `searchParams.get("name")?.trim()
.changeset/mighty-pillows-know.md Patch-level changeset entry with an accurate description of the feature.

Sequence Diagram

sequenceDiagram
    participant User
    participant Input as Input / Pill
    participant Form as form onSubmit / ResolveButton
    participant Router as Next.js Router
    participant URL as URL (?name=)
    participant Component as ResolveRecordsInspector
    participant Hook as useRecords

    User->>Input: Types name / clicks pill
    Input->>Component: setInputName(value)
    Component-->>Form: hasChanged = inputName !== nameFromQuery

    User->>Form: Press Enter or click Resolve
    Form->>Router: router.push(/inspect/records?name=vitalik.eth)
    Router->>URL: URL updates
    URL->>Component: searchParams → nameFromQuery = "vitalik.eth"
    Component->>Component: useEffect: setInputName(nameFromQuery)
    Component->>Hook: useRecords({ name: nameFromQuery })
    Hook-->>Component: accelerated + unaccelerated results
    Component-->>User: RenderRequestsOutput shown with "View Profile" link
Loading

Reviews (2): Last reviewed commit: "remove unused ENSNamespaceIds import" | Re-trigger Greptile

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

This PR makes the ENSAdmin Record Resolution Inspector (/inspect/records) URL-driven via a ?name= query param, aligning it with the existing /name route pattern so inspection links are shareable and navigable.

Changes:

  • Updated /inspect/records to read the inspected name from ?name= and drive queries/navigation from the URL.
  • Added cross-navigation: “Inspect Records” action from /name, and “View Profile” link from the inspector response panel back to /name.
  • Updated breadcrumbs and URL-param clearing behavior to support name on /inspect/records.

Reviewed changes

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

Show a summary per file
File Description
apps/ensadmin/src/app/layout.tsx Allows name query param to persist on /inspect/records (via UseClearUrlParams).
apps/ensadmin/src/app/inspect/records/page.tsx Refactors inspector to be URL-driven; adds navigation helpers and “View Profile” header action.
apps/ensadmin/src/app/inspect/_components/render-requests-output.tsx Adds optional headerActions region in the response card header.
apps/ensadmin/src/app/@breadcrumbs/inspect/records/page.tsx Breadcrumbs now display the inspected name (when present) and link back to the base inspector route.
apps/ensadmin/src/app/@actions/name/page.tsx Adds “Inspect Records” action linking from /name to /inspect/records?name=... while retaining connection.

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

Copilot AI review requested due to automatic review settings March 25, 2026 20:47
@vercel vercel bot temporarily deployed to Preview – ensnode.io March 25, 2026 20:47 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io March 25, 2026 20:47 Inactive
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

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


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

@vercel vercel bot temporarily deployed to Preview – ensnode.io March 26, 2026 07:29 Inactive
Copilot AI review requested due to automatic review settings March 30, 2026 08:52
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io March 30, 2026 08:53 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io March 30, 2026 08:53 Inactive
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

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


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

@notrab
Copy link
Copy Markdown
Member Author

notrab commented Mar 30, 2026

@greptile-apps re-review

Copilot AI review requested due to automatic review settings March 30, 2026 10:25
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io March 30, 2026 10:25 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io March 30, 2026 10:25 Inactive
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

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


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

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

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


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

const nameParam = searchParams.get("name");

const name = nameParam ? (decodeURIComponent(nameParam) as Name) : null;
const name = (searchParams.get("name")?.trim() || null) as Name | null;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've used the opportunity in the other PR which handles this in NameDisplay to also have a method we can call that always trims this.

Copy link
Copy Markdown
Member Author

@notrab notrab Mar 30, 2026

Choose a reason for hiding this comment

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

getENSIP19SupportedChainIds consolidates the duplicated datasource enumeration within ENSAdmin.

However, the same list of ReverseResolver datasource names is also hardcoded in ensapi (multichain-primary-name-resolution.ts) and ensindexer (DATASOURCE_NAMES_WITH_REVERSE_RESOLVERS).

We could DATASOURCE_NAMES_WITH_REVERSE_RESOLVERS into @ensnode/datasources so there's a single source of truth when a new reverse resolver chain is added. Beyond th escope of this PR though.

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

Copilot reviewed 13 out of 13 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.

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.

Enhance navigation to Record Resolution Inspector

3 participants