Skip to content

feat(index-dtf): DTF switcher dropdown in navigation - #1083

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1786116287-dtf-switcher
Open

feat(index-dtf): DTF switcher dropdown in navigation#1083
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1786116287-dtf-switcher

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Switching DTFs previously meant Discover → target DTF overview → target section. Now the DTF identity is a switcher: clicking the logo (desktop nav header), the DTF row at the top of the mobile pages menu, or the new DTF chip above the issuance/zap panel opens a searchable list of DTFs and navigates to the same section for the selected DTF — governance → governance, issuance → issuance, cross-chain included.

New feature-local component src/views/index-dtf/components/dtf-switcher/index.tsx (Popover + cmdk Command over useIndexDTFList()):

// section is derived from the URL, not from nav state
segments[segments.indexOf('index-dtf') + 2] // 'governance' | 'issuance' | ... else OVERVIEW

// inactive targets have no auctions surface
const route = section === ROUTES.AUCTIONS && !isActiveDTF(dtf) ? ROUTES.OVERVIEW : section
navigate(getFolioRoute(dtf.address, dtf.chainId, route))

List drops status === 'unsupported', sorts active-before-deprecated then by market cap, marks the current DTF. Search uses a custom cmdk filter: address keywords only match 0x-prefixed queries — with default fuzzy matching a query like BGCI scored 6 rows because item addresses are hex. Selection emits the semantic tap event useTrackIndexDTFClick(section, 'navigation') → 'switch_dtf' with target ca/ticker/chain, and on mobile closes the parent pages menu via onNavigate.

Surfaces:

  • Nav header keeps its existing layout — logo + symbol wrapped in the switcher trigger with a ChevronsUpDown affordance (the symbol moved from the hover-revealed block into the trigger).
  • issuance/dtf-switcher-header.tsx renders a chip above the zap widget (dtf-switcher-trigger-issuance). The widget's own "You receive: $TICKER" row lives in @reserve-protocol/react-zapper and can't host the dropdown from this repo, so the affordance sits directly above the panel.

Verification: pnpm typecheck, pnpm lint, pnpm e2e:smoke (60 passed), new e2e/tests/index-dtf/navigation/dtf-switcher.spec.ts green on smoke/full/mobile (section preservation incl. issuance, address + ticker search, no-match empty list, auctions→overview fallback, mobile menu close), plus manual browser verification against the live API (cross-chain governance switch, settings, auctions fallback and its active-DTF control case). e2e/TEST_MAP.md updated (its spec counts were also stale by one).

Engineer review required — shared Index DTF navigation, routing, issuance surface, and analytics.

desktop nav
switcher open
mobile

Link to Devin session: https://app.devin.ai/sessions/b94a7208cbe341fa948be9aafd1f82e4

Clicking the DTF logo in the desktop nav (or the DTF row in the mobile pages menu) opens a searchable DTF list that navigates to the same section for the selected DTF.

Co-Authored-By: Patrick <patrick.mckelvy@reserve.org>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploying register-app with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7351082
Status: ✅  Deploy successful!
Preview URL: https://bd0bc73a.register-app.pages.dev
Branch Preview URL: https://devin-1786116287-dtf-switche.register-app.pages.dev

View logs

Ticker queries now match symbol/name only; addresses match address-shaped queries, so short tickers no longer fuzzy-match hex.

Co-Authored-By: Patrick <patrick.mckelvy@reserve.org>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Manual E2E verification — commit 7351082

Tested in a real browser against the live Reserve API/RPCs (no mocks, no wallet), desktop 1600×1122 + mobile emulation, light and dark theme.

Issuance chip + search precision (the new work) — passing

Chip sits above the compliance alert / zap widget; selecting a DTF keeps /issuance and the widget re-mounts with the new chain's state (Base LCAP/ETH → BSC CMC20/BNB), no stale prior-DTF tokens or quote:

Issuance after switching to CMC20

Deprecated target ($VTF) correctly stays on /issuance in sell-only mode, and repeated VTF → LCAP → BGCI hops all preserve the section and settle cleanly.

Search precision fix confirmed: BGCI now returns exactly one row (was 6), CMC20 one row, partial name Large matches only symbol/name, full address and partial 0x2f8a each return one row, and a nonsense query shows the empty state:

Search narrows to one row
Empty state

Popover opacity ("too transparent" report) — not reproducible in the settled state

Captured ≥600 ms after opening, in all four theme × viewport combinations, including mobile where the popover overlays the translucent bg-card/90 pages menu. Computed styles: background-color rgb(255,255,255) (light) / rgb(17,23,34) (dark), opacity: 1, backdrop-filter: none, transform: none. No page or menu content bleeds through.

Desktop dark settled
Mobile dark settled over pages menu

The earlier "transparent" screenshots are consistent with capture mid fade-in-0 zoom-in-95 animation, not the settled state.

Sections, keyboard, mobile — passing

Cross-chain governance switch (fresh CMC20 proposals), /settings and /overview preservation, /auctions → deprecated VTF → /overview fallback while /auctions → active CMC20 stays on auctions. Keyboard: Tab → Enter opens with search focused, ArrowDown + Enter navigates while preserving the section, Esc closes and restores focus. Mobile: pages menu → switcher row → $CMC20 lands on /bsc/.../overview with the parent menu closed and CMC20's own basket rendered.

Mobile CMC20 overview

One issue + coverage gaps
  • Sell mode is sticky: switching away from the deprecated sell-only VTF to an active DTF leaves the zap widget in Sell mode. Route/tokens are correct; only the mode doesn't reset. The mode lives in @reserve-protocol/react-zapper's module-level atoms, so fixing it is a change in that package — worth deciding whether the widget should reset to Buy on DTF change.
  • Untested: narrow desktop widths (1024/1100) — the automated browser's viewport is pinned at 1600px, so this needs a Playwright viewport assertion or a manual check; status === 'unsupported' filtering (live catalog has 0 unsupported DTFs); Mixpanel switch_dtf (VITE_MIXPANEL_KEY empty locally).
  • Note: the desktop nav header has no copy-address button on this revision (copy rows live in the overview address dropdown / mobile rows), and clipboard read-back is blocked in automation, so the copied state is unverified.

Full recording: https://app.devin.ai/attachments/eb4a3129-5060-4cc9-bd66-0b2ac7893c3c/rec-ca616904-51e1-4a6c-b325-f9b868af3fa7-edited.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants