feat(web): Discover hero — floating DePIN sector coins - #2
Merged
Conversation
Replace the static Discover import with React.lazy() + Suspense so that framer-motion/motion (~132 KB) lands in a separate async chunk instead of the main bundle. Main bundle: 760 → 628 KB (−17%); Discover chunk: 132 KB.
Add App.test.jsx covering the routing paths that unit tests don't exercise:
- connected app lands on Discover (lazy-loads) with Discover nav item active
- GPU coin → class B row → onOpenDeposit(1) → setTab("deposit"), verified
by Deposit nav button gaining aria-current="page"
Mocks useWallet (returns connected account) and useContracts (returns
configured contracts with getPools/getDeals/getRoles/getHbarBalance +
DepositCard helpers). Adds a ResizeObserver stub for jsdom compatibility.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
New connected-app landing Discover: five floating DePIN sector coins (GPU / Wireless / Mapping / Energy / Storage). Hover a coin → the sector's max APR; click → a menu of the sector's risk-class pools (A/B/C) → selecting a row opens that pool in the existing Deposit flow.
What's included
web/src/lib/sectors.js— pure pool→sector grouping + per-class/max APR (single source of truth;Explorerefactored to consume it, no behavior change)web/src/components/Discover.jsx+components/discover/{SectorCoin,SectorCoins,layout,discover.css}App.jsx+TopNav.jsx— no existing handler or contract call changedmotiondependency, lazy-loaded so it splits into its own async chunk (main bundle 760 KB → 628 KB)prefers-reduced-motionguarddocs/superpowers/Tests / build
pnpm -C web test→ 20/20 passpnpm -C web build→ cleanNotes
Foundation for an upcoming 3D Discover redesign (separate branch/PR) which will swap the visual layer while reusing this data layer + routing. Deferred polish tracked in the plan doc.
🤖 Generated with Claude Code