feat(idl): add castaway link with idl source context#909
Conversation
Greptile SummaryThis PR adds a Generate SDK entry to the IDL section's Download dropdown, which opens a "Leaving Solana Explorer" confirmation dialog before redirecting the user to Castaway with the current program address, active IDL source ( Confidence Score: 4/5Safe to merge after addressing the custom-cluster network value edge case; remaining concern is a minor code-reuse suggestion. Prior review concern (typing app/features/idl/ui/IdlSection.tsx — custom network guard and dialog deduplication opportunity Important Files Changed
Sequence DiagramsequenceDiagram
actor User
participant IdlCard
participant IdlSection
participant BootstrapDropdown
participant ConfirmDialog
participant Castaway
IdlCard->>IdlSection: idl, idlSource (IdlVariant), network, programId
User->>IdlSection: clicks "Download" button
IdlSection->>BootstrapDropdown: show dropdown menu
User->>BootstrapDropdown: clicks "Generate SDK"
BootstrapDropdown->>IdlSection: handleOpenCastawayDialog()
IdlSection->>ConfirmDialog: open (isCastawayDialogOpen=true)
ConfirmDialog-->>User: shows castawayUrl preview
alt User clicks Continue
User->>ConfirmDialog: click Continue
ConfirmDialog->>IdlSection: handleCastawayContinue()
IdlSection->>Castaway: window.open(castawayUrl, _blank, noopener,noreferrer)
IdlSection->>ConfirmDialog: close (isCastawayDialogOpen=false)
else User clicks Cancel / Escape
User->>ConfirmDialog: dismiss
ConfirmDialog->>IdlSection: onOpenChange(false)
end
Reviews (2): Last reviewed commit: "feat(idl): add castaway sdk action in id..." | Re-trigger Greptile |
|
@dev-jodee is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Maybe we make the Button say "Generate SDK" and popup that tells users "You are now leaving Explorer and going to castaway". |
yes makes total sense |
You can reuse the same dropdown used within the Download button from here, and there is an example for the popup at the Interactive IDL feature (when working with the mainnet) |
023be61 to
741f225
Compare
add a castaway generate-sdk action that carries program and idlSource context, and gate external navigation behind a confirmation dialog.\n\nreuse the existing download dropdown interaction pattern for idl actions and update idl card tests for both program-metadata and anchor flows. Refs: HOO-382
741f225 to
3713104
Compare
Summary
programquery paramidlSource(program-metadataoranchor) to preserve selection contextChanges
IdlCardinto the Castaway URL builderIdlCardtests to assert Castaway URL params and external-link behaviorTesting
Screenshot
Closes HOO-382