Repository navigation
fix(nextjs): keep wallets across refreshes; allow README in address folders - #58
Merged
Merged
Conversation
On faucet-configured builds (live Sepolia) a refresh dropped every wallet. The instant-burner work turned wagmi's reconnectOnMount off globally, because the burner connector reports itself authorized on load and wagmi's reconnect attaches every authorized connector, so a visitor who never clicked Easy Edits would get a burner. That also dropped MetaMask and every other real wallet on each refresh. Easy Edits itself lived in React state, so it reset too. Reconnect is back on for everyone. In faucet builds the burner opts out of page-load restore (restoreOnLoad: false) and Easy Edits owns it instead: - Easy Edits is remembered in localStorage until the visitor turns it off, disconnects the burner from the wallet menu, or connect fails. - A page-load tracker watches the wagmi store, so it can't miss the moment reconnect settles. Easy Edits waits for that before restoring the burner, so it can't race a real wallet being restored. The toggle stays hidden until then (no off->on flash, no stray click). - A refresh restores the burner only if it was the active wallet before. If MetaMask was active but can't be restored (e.g. locked), Easy Edits ends rather than switching to the burner's address. - Faucet gas is still requested only on an explicit click. Local dev (no faucet URL) keeps the stock scaffold-eth burner restore. Falling back to the burner when a real wallet is disconnected while Easy Edits is on is unchanged; it is now remembered across reloads. Verified: unit tests incl. wagmi's real reconnect() against the burner + a stand-in injected wallet; Playwright against a faucet-configured Sepolia dev build with a fake injected MetaMask: real wallet survives refresh (reproduced the drop before the fix), burner + Easy Edits survive refresh with no new faucet request, off stays off, wallet-menu disconnect sticks, a remembered MetaMask stays active over Easy Edits, a locked MetaMask isn't replaced by the burner, and a fresh visitor with a stored burner key is never auto-connected. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Permanence-tier: Ephemeral
The Overview pane never appeared at /explorer/<address>, even for the connected wallet's own folder. The edit gate required a "real anchor" parent, and an address root's anchor UID is the synthetic bytes32(uint160(addr)), which EAS rejects as a refUID (NotFound). specs/04 §4a already defines the route: attest the child anchor with refUID = 0, recipient = addr and EFSIndexer.onAttest re-derives the parent from the recipient. CreateItemModal already did this for files and folders, and uploadOnchainFile already accepts the carve-out; the Overview editor just never passed it. Move that decision into shared helpers in utils/efs/containers.ts (childAnchorParent, canAttachChildAnchor), use them in CreateItemModal (behavior unchanged) and in the Overview gate, and pass the parent through OverviewPane -> OverviewEditorModal -> uploadOnchainFile. Raw schema/attestation roots without an alias anchor stay non-writable. As with files, a connected visitor who is the top lens can add their own (lens-scoped) README on any address folder. Verified: unit tests for both helpers; Playwright on a local Sepolia fork with the dev burner: the burner's own address folder offers "Add an Overview", the README saves on-chain via the recipient form, renders with "Edit this Overview", and both survive a reload. Also checked against Sepolia that wallet-gated explorer controls appear right after connecting and don't change on refresh. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Reviewed-by: Claude Opus 5.5 <noreply@anthropic.com> Tested-by: Claude Opus 5.5 <noreply@anthropic.com> Permanence-tier: Ephemeral
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
/explorer/<address>), so you can add and edit the README in your own account folder.Why
Reported problem: you couldn't edit the README in your own account folder. The pane didn't appear after connecting a wallet, and refreshing didn't help because the wallet didn't stay connected.
Refresh dropped wallets. The instant-burner work (57e221a) set wagmi
reconnectOnMount={false}wheneverNEXT_PUBLIC_FAUCET_URLis set (the live Sepolia build). The reason was the burner connector reports itself authorized on load, and wagmi's reconnect attaches every authorized connector, so visitors who never clicked Easy Edits would get a burner. That also dropped every real wallet on each refresh. Easy Edits itself was React state, so it reset too.restoreOnLoad: false), and Easy Edits owns restoring it.README pane missing at address roots. The Overview edit gate required a "real anchor" parent. An address root's anchor UID is the synthetic
bytes32(uint160(addr)), which EAS rejects as arefUID(NotFound). specs/04 §4a already defines the route: attest the child anchor withrefUID = 0, recipient = addr, andEFSIndexer.onAttestre-derives the parent.CreateItemModalalready did this for files and folders, anduploadOnchainFilealready accepts it; the Overview editor just never passed it.utils/efs/containers.ts(childAnchorParent,canAttachChildAnchor).CreateItemModal(behavior unchanged) and the Overview gate use them.Behavior notes for review
.env.example); it now survives reloads.Permanence tier
Ephemeral.
packages/nextjsdebug UI only; no contracts, schemas, ordeployedContracts.tschanges.Specs / ADRs touched or checked
refUID = 0, recipient = addrcarve-out.packages/nextjs/.env.example: updated the Easy Edits description.Test plan
yarn workspace @se-2/nextjs test: 184 pass, with new tests for:reconnect()against the burner and a stand-in injected walletyarn next:check-types,yarn next:lint --max-warnings=0,yarn docs:check: pass.yarn preview) with the dev burner:Agents involved
useSyncExternalStore.🤖 Generated with Claude Code