feat(APP-572): Add address impersonation to debug panel#1044
Conversation
|
🚀 Preview Deployment: View Here |
12b1303 to
6cc2611
Compare
|
E2E Smoke Results
|
milosh86
left a comment
There was a problem hiding this comment.
Beautiful 🤩
I've been using https://impersonator.xyz/, but this is so much more convenient 🙌
Can we just improve it further to persist the session on page reload? ... it would be perfect then, but let's keep it simple, if it adds too much complexity we can live without it :D
milosh86
left a comment
There was a problem hiding this comment.
Code looks good ... please resolve conflicts with main so that new preview is generated, just to check how it looks.
…dress-impersonation-to-debug-panel-via-wagmi-mock
…dress-impersonation-to-debug-panel-via-wagmi-mock
milosh86
left a comment
There was a problem hiding this comment.
hey hey, looks great, just one issue left: if I paste the address, it works good, but if I start to type (my ens name), input field gets reset after a couple of characters.
should be fixed 👁️ |
Closes APP-572
Adds address impersonation to the debug panel using wagmi's
mockconnector. Developers can enter any valid Ethereum address (or ENS name) in the debug panel to impersonate that wallet — all wagmi hooks (useAccount,useConnection) and downstream consumers (including gov-ui-kit's "You" tag and member pinning) reflect the impersonated address.Changes
addresscontrol type for the debug panel (debugProvider.api.ts,debugPanelControl.tsx) — rendersgov-ui-kit's
AddressInputwith ENS resolution and validation built inuseAddressImpersonationhook — registers the "Impersonate address" control under the "Wallet" group;on valid address: disconnects current wallet → connects wagmi
mockconnector; on clear: disconnectsuseMemberparams fix — threadstokenAddressandnetworkthroughdaoMemberDetailsPageserver/clientcomponents so the member API returns voting power for token-based DAOs
useAccountSpy→useConnectionSpyin 3 test files to match the actualuseConnectionhook being spied onDependencies
Environment guarding
Inherits from the existing
debugPanelfeature flag — only enabled inlocal,development, andpreviewenvironments. Not available in production.
Type of Change
Developer Checklist:
Review Checklist: