feat: Changing pre-filled value for interact tab#950
feat: Changing pre-filled value for interact tab#950C0mberry wants to merge 3 commits intosolana-foundation:masterfrom
Conversation
|
@C0mberry is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR refactors wallet address pre-filling in the IDL interact tab so that switching wallets updates signer fields that were previously auto-filled, while leaving fields the user edited manually untouched. The The implementation logic is correct, but the new Confidence Score: 5/5Safe to merge — the implementation is correct and the only finding is missing test coverage for the new wallet-switching path. All findings are P2 (missing test for new branch). The logic itself is sound: wallet-prefill-provider.spec.ts — add a test that exercises the Important Files Changed
Sequence DiagramsequenceDiagram
participant W as Wallet Adapter
participant C as InteractInstruction
participant R as lastPrefillAddressRef
participant P as createWalletPrefillDependency
participant F as React Hook Form
Note over C: Component mounts, ref = undefined
W->>C: publicKey changes (Wallet A)
C->>P: createWalletPrefillDependency(instruction, fieldNames, ref)
P->>F: getValues(signerPath) → ""
Note over P: isEmpty = true → fill
P->>F: setValue(signerPath, "AddrA")
P->>R: ref.current = "AddrA"
W->>C: publicKey changes (Wallet B)
C->>P: createWalletPrefillDependency(instruction, fieldNames, ref)
P->>F: getValues(signerPath) → "AddrA"
Note over P: hasPreviousWallet = ("AddrA" === ref.current) → true → fill
P->>F: setValue(signerPath, "AddrB")
P->>R: ref.current = "AddrB"
Note over C: User manually edits signer field to "CustomAddr"
W->>C: publicKey changes (Wallet C)
C->>P: createWalletPrefillDependency(instruction, fieldNames, ref)
P->>F: getValues(signerPath) → "CustomAddr"
Note over P: isEmpty=false, hasPreviousWallet=false → skip
P->>R: ref.current = "AddrC"
Reviews (1): Last reviewed commit: "chore: build info" | Re-trigger Greptile |
Description
Type of change
Screenshots
Screen.Recording.2026-04-16.at.14.24.17.mov
Testing
Related Issues
HOO-263
Checklist
build:infoscript to update build information