feat(components): add AddressFieldWithResolvedPreview for ENS preview UX#193
Merged
Conversation
Extract the forward-resolution field + reverse ENS preview card into reusable ui-components exports, wire ui-renderer Address Book to the shared pattern, and update the examples app demos accordingly. Co-authored-by: Cursor <[email protected]>
✅ Deploy Preview for openzeppelin-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a shared “rich ENS preview” pattern across the component library, renderer, and examples by composing AddressField forward resolution with a reverse-resolved preview card.
Changes:
- Introduces
AddressFieldWithResolvedPreview+ResolvedAddressFieldPreviewin@openzeppelin/ui-components. - Adds
ResolvedAddressFieldPreviewWithNameResolutionin@openzeppelin/ui-rendererand adopts it in the Address Book add-alias flow (plus test updates). - Updates the basic React examples to demonstrate the recommended shared preview UX and wiring.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/renderer/src/components/ResolvedAddressFieldPreviewWithNameResolution.tsx | Adds renderer bridge component wiring preview card to async reverse resolution. |
| packages/renderer/src/components/index.ts | Exports the new renderer bridge component. |
| packages/renderer/src/components/AddressBookWidget/AddAliasDialog.tsx | Switches add-alias address input to AddressFieldWithResolvedPreview with rich preview. |
| packages/renderer/src/components/AddressBookWidget/tests/AddAliasDialog.sf5.test.tsx | Updates assertions to validate the new preview card UI instead of announcer copy. |
| packages/components/src/components/fields/ResolvedAddressFieldPreview.tsx | Adds presentational preview card wrapping AddressDisplay for reverse-resolved UX. |
| packages/components/src/components/fields/index.ts | Re-exports the new field + preview components. |
| packages/components/src/components/fields/AddressFieldWithResolvedPreview.tsx | Adds canonical composition that suppresses the forward announcer and shows a preview slot/card. |
| packages/components/src/components/fields/AddressFieldWithResolvedPreview.test.tsx | Adds tests for preview gating and custom preview slot behavior. |
| examples/basic-react-app/src/components/MainnetL1FallbackOptInToggle.tsx | Updates demo copy to reference the preview-card UX path. |
| examples/basic-react-app/src/components/ENSShowcaseDemo.tsx | Adopts the shared preview pattern in the ENS showcase. |
| examples/basic-react-app/src/components/ENSResolutionDemo.tsx | Adopts the shared preview pattern in the name resolution demo and updates wiring snippets. |
| examples/basic-react-app/src/components/AddressFieldDemo.tsx | Adds a “Rich ENS preview” section demonstrating the new composition. |
| examples/basic-react-app/src/components/AccountAliasDemo.tsx | Updates copy to reflect the add-alias dialog’s new preview UX. |
| .changeset/renderer-resolved-preview.md | Adds renderer changeset note (currently misstates the package for one export). |
| .changeset/address-field-resolved-preview.md | Adds components changeset note documenting the new APIs and intended UX defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add missing React type imports, exclude resolvedName from displayProps, clarify announcer suppression comment, and fix renderer changeset package. Co-authored-by: Cursor <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AddressFieldWithResolvedPreviewandResolvedAddressFieldPreviewto@openzeppelin/ui-components— the canonical composition for forward ENS resolution inAddressFieldplus a rich reverse-resolved preview card (supersedes hand-rolled field + announcer suppression in consumers).ResolvedAddressFieldPreviewWithNameResolutionin@openzeppelin/ui-rendererand adopt it inAddAliasDialogwhenenableNameResolutionis on.Changesets
@openzeppelin/ui-componentsminor →3.7.0(AddressFieldWithResolvedPreview,ResolvedAddressFieldPreview)@openzeppelin/ui-rendererpatch → Address Book add-alias preview uses shared componentsTest plan
pnpm --filter @openzeppelin/ui-components test(313 tests)pnpm --filter @openzeppelin/ui-renderer test(128 tests)@openzeppelin/[email protected]+ renderer patchenableNameResolutionMade with Cursor