Skip to content

feat(solana/dflow): nested swap render (Swap Details / Route / Accounts)#394

Draft
prasanna-anchorage wants to merge 1 commit into
fix/number-fields-amount-v2from
feat/dflow-nested-render
Draft

feat(solana/dflow): nested swap render (Swap Details / Route / Accounts)#394
prasanna-anchorage wants to merge 1 commit into
fix/number-fields-amount-v2from
feat/dflow-nested-render

Conversation

@prasanna-anchorage

Copy link
Copy Markdown
Contributor

What

Renders the DFlow Aggregator swap instruction as a nested preview_layout: a condensed at-a-glance summary that expands into three collapsible cards.

  • Condensed: Program, Instruction, Route, Quoted Out Amount, Slippage, Platform Fee
  • Expanded:
    • Swap Details -- economics + Program ID + Discriminator
    • Route -- per-action breakdown; single-field actions (e.g. RecordId) collapse to a plain field
    • Accounts -- IDL-resolved accounts shown by address (const-seed PDAs derived offline), plus an Unresolved (lookup table) index list for ALT-loaded accounts the parser can't resolve offline

Follows the inner-program nesting convention used by the swig/squads visualizers.

Stacking

Render decision

Going with the nested design first (confirmed after reviewing in the VSP playground). The open question is whether the production Anchorage VSPModalReducer drills into a nested preview_layout; a flat fallback (section-header rows, all detail in one Expanded) is drafted and revertible if iOS confirms it can't. Kept as a draft until that's settled.

Follow-ups

🤖 Generated with Claude Code

…unts cards

Restructures the DFlow Aggregator `swap` visualizer into a nested
preview_layout: a condensed at-a-glance summary (program, route, quoted
out amount, slippage, platform fee) that expands into three collapsible
cards -- Swap Details (economics + program id + discriminator), Route
(per-action breakdown; single-field actions collapse to a plain field),
and Accounts (IDL-resolved accounts by address, with const-seed PDAs
derived offline, plus an "Unresolved (lookup table)" index list for
ALT-loaded accounts the parser can't resolve offline).

Stacked on #393 (number->amount_v2); the swap economics render via the
preset's own number_text helper. Token-symbol display for ALT-resolved
mints is tracked separately by #388.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant