feat(ensadmin): handle inspect records name in query params#1816
feat(ensadmin): handle inspect records name in query params#1816
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
🦋 Changeset detectedLatest commit: 806ae46 The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 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 |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRecord Resolution Inspector is now addressable via a Changes
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
…y driving name state from query params, with cross-navigation links between name profiles and record inspection.
Greptile SummaryThis PR makes the Key changes:
Confidence Score: 5/5Safe 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 No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
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
Reviews (2): Last reviewed commit: "remove unused ENSNamespaceIds import" | Re-trigger Greptile |
There was a problem hiding this comment.
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/recordsto 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
nameon/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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
@greptile-apps re-review |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Lite PR
Tip: Review docs on the ENSNode PR process
Summary
/inspect/recordsroute URL-driven via?name=query param, enabling shareable inspection links./nameroute and "View Profile" on the inspect/records response panel.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
/nameroute already used query params for this and/inspect/recordsfollows the same pattern.Testing
/inspect/records?name=vitalik.ethloads inspection results directly/name?name=vitalik.ethlinks to the correct inspect URL./name?name=....?connection=) is preserved across all navigations.Notes for Reviewer (Optional)
getRecordResolutionRelativePathwas placed in@/components/name-linksalongsidegetNameDetailsRelativePathsince both are route builders for ENS name pagesuseRecordshook natively supportsname: nullto disable queries, so we removed the manualenabled: canQueryguardUseClearUrlParamsin the root layout was updated to allow thenameparam on/inspect/recordsPre-Review Checklist (Blocking)