Repository navigation
[WIP] ui: migration - #3198
Draft
abjt14 wants to merge 13 commits into
Draft
[WIP] ui: migration#3198abjt14 wants to merge 13 commits into
abjt14 wants to merge 13 commits into
Conversation
V4 migration (presentational, ahead of the backend) - Migrate to V4 banner: the title defaults to "Migrate to V4" and the caller passes the description and any stats, so it covers the migrate upsell, the borrow upsell and a compact asset-page variant. Not mounted yet; shown in /dev/components under a new Migration group. Card shadow and ring are new tokens (dark values still to come). - Migration icon from the Figma export. The viewBox is 2px larger on every side so the badge is no longer clipped, the badge is cut out of the tile with a mask instead of a white ring (which showed in dark mode), SVG ids are per instance, and a purple glow pulses behind it. - /migrate page: Back link, search, and sortable Earn and Borrow tables that show current -> after values, turning into cards below mdlg. It runs on mock data (V4MigrationPage/utils/mocks.ts) shaped like the current/after projections in aave/backend's position_migration module, which isn't exposed over GraphQL yet. The Migrate buttons only call back for now. App-wide (from the migrate page designs) - Table header rows are 3rem tall with centred labels. - The Figma arrow icon replaces the heroicons arrow in tables: the V2 -> V3 migration list, bridge history and its loading rows, and transaction history rows. - Health factor colours: >= 3 hf-mint, 1.5-3 hf-parrot, 1.1-1.5 warning, < 1.1 hf-red, defined once as healthFactorColor() in hfUtils. Used by HealthFactorNumber (including the infinity case) and the risk modal's circle, which each had their own, slightly different copy. New tokens because none of ours matched Figma, and changing success/error would also recolour alerts and status labels. Cut-offs and dark values are provisional until design confirms; the risk modal's gradient bar is unchanged. - HealthFactorNumber can show the Figma heart icon (withHeart). - NoData keeps the long dash and now defaults to fg-3, h5 and truncation. - Page header band: 2rem top padding at every width. PageHeader takes an optional backHref. - SearchInput: 0.875rem / 1.125rem side padding, fg-4 icon, base fg-4 placeholder. The clear button is hidden while the field is empty.
- The Supply APY and Borrow APY cells show the asset's V4 rate under the V3 rate, in both the desktop rows and the mobile cards. The V4 rate is purple-1 h5, 0.375rem below the V3 value as in the design. In the borrow cell it comes after the Disabled and E-Mode notes. - The dotted underline is a row of round fg-4 dots drawn behind the whole value, not text-decoration. Browsers draw dotted text-decoration as squares, and FormattedNumber's number and "%" each got their own underline, which left a cut-off dot where they met. The dots are 1.5px every 3px (larger than the Figma's ~1px, by request), and the row always starts and ends on a whole dot. - A "Show V4 Rates" toggle sits before In Wallet. It's on by default and, like In Wallet, isn't remembered between visits. It's hidden on markets with no V4 rates. It reuses the In Wallet pill, which is now a shared FilterToggle in AssetsFilterBar. On narrow phones the toggles wrap onto their own line. - V4 rates come from useV4Rates in markets/utils/v4Rates.ts. For now it returns mock rates for the six Ethereum assets in the design, keyed by address-book addresses. The V4 API gets swapped in there.
V4 migration (presentational, ahead of the backend)
- Hub card (V4MigrationHubCard): hub icon with chain badge, "{name} Hub"
title and an optional Best APY pill, Earn APY with the incentives icon,
the 7D average and its sparkline, then Total deposits and New Backing
Collateral rows with tooltip copy from Aave Pro. Unavailable cards are
dimmed to 50% and not clickable; loading shows skeletons. Below 640px
the chart gets its own row. Shown in /dev/components (Migration > Hub
cards) on mock data; the page around the cards is left to whoever wires
the data.
- Figma placement: at 640px and up the chart sits 8px below centre, and
its "7D avg." label hangs 4px left of the dashed line. The hub icon
follows the Figma SVG: white tile, flat dots, and a 12px chain disc with
a 1.5px ring.
- /migrate's Borrow table uses AssetGroup, without animation since a row's
assets never change, in place of AssetStack, which is removed.
Ported from Aave Pro (logic copied, styles rewritten for MUI)
- Charts: SparklineChart, ApySparkline, ChartEndDot, MotionLinePath,
AxisLegendLeftFade and resampleSeries, shown in a new Charts showcase
section. The sparkline skips the area work when the area is off and
stops the end-dot pulse while loading.
- HubMarketIcon, ChainIcon (Aave Pro's dark Ethereum mark, our network
logos for other chains), ChainBadge, AssetGroup (Figma 4px overlap and
2px cut), StatRow and OpportunityCard. AssetGroup and the new icons also
appear in the Data primitives and Icons showcase sections.
- useElementWidth stands in for Aave Pro's use-resize-observer dependency.
motion is now a direct dependency; it was already installed
transitively.
App-wide
- IncentivesIcon is now the Figma 20px artwork in its own file, coloured
with purple-1/purple-2 so it follows dark mode. It replaces the old
inline icon in IncentivesButton and the stkGHO deposit row, sized 1rem
and 1.125rem so the ring keeps its visible size.
- InfoCircleIcon is added, byte-identical to the asset-page redesign
branch's copy so the two merge cleanly. StatRow uses it for its tooltip
icon.
- Colours: migration-* tokens for the Best APY pill, the hub icon tile and
glyph, the chain badge ring and the market glyph underlay, and
table-item-hover-1 gets its missing light value (#fafafa). No existing
colour changes. The Best APY pill's dark values are a guess.
- The migrate banner's background is table-bg, which matches Figma's
elevated-0, instead of surface-elevated. Only dark mode changes.
The Display-P3 layer turns every theme palette colour into a P3 override. MUI generates Skeleton.bg as rgba(var(--mui-palette-text-primaryChannel) / 0.11), which colorToP3 can't parse, so the layer emitted color(display-p3 NaN NaN NaN). On P3 screens (Macs, iPhones) that invalid value replaced the sRGB colour, and every MUI Skeleton has rendered transparent since the v3 uplift (PR 3075). isColorValue now skips values built from var(), as the layer's doc comment already intended for MUI's rgba(<channel> / a) tints. Skeleton.bg was the only override affected; the other 220 light and 223 dark overrides are unchanged.
V4 migration (presentational, ahead of the backend) - FlowHeader: a port of Aave Pro's action-flow header. A "Migrate" title sits over a step line that fades and slides 4px when the step changes. The step line is base fg-3, with span/strong chips for chains and assets. It keys the animation on the step text and, for Lingui <Trans>, on the message id and values, since compiled Trans elements carry no text in production. Passing a skeleton as the subheading is the loading state. - New Flow page in /dev/components (Migration > Flow): Step and Chain toggles to try the animation, plus the large search with the "Search earn hubs" placeholder. Only the hub-selection copy is from Figma; the other steps are placeholders. - The /migrate tables' Migrate buttons use the tertiary variant. In dark mode the outlined fill almost matched the table background; light mode looks the same at rest. Shared components - SearchInput takes size="large" for the hub list search: 2.75rem tall, an inset border-1 line, 0.75rem left and 0.5rem right padding, a 20px search icon, and the clear button 0.75rem from the right edge. The default 36px size is unchanged. Also shown under Form controls.
V4 migration (presentational, ahead of the backend)
- V4MigrationHubCard takes side="borrow" for the borrow flow's market
cards: the market icon, "{market} Market", a dot and "{hub} Hub" in
fg-3, then the curators ("by", a 16px logo and the name). The pill
reads "Cheapest APY", the APY is "Position APY" reading "Up to ...",
the chart is data-orange, and a single Health factor row carries the
heart with Aave Pro's tooltip copy. The earn props only type-check with
side="earn" (the default) and the borrow props with side="borrow".
- apyTooltip and a curator's tooltip dot-underline the APY or the
curator name and open on click. Without tooltip content there is no
underline.
- V4MigrationPositionSummary: the borrow position being moved, shown
between the flow header and the market search. "V3 Protocol", a dot
and "{market} Market" sit over a card with Balance, Position APY with
its 7D average, and Health Factor, split by border-0 lines. Values are
h3, labels base fg-3, and the card is padded 1rem by 1.5rem. Below
640px the columns stack, since there is no mobile design yet. loading
shows skeletons.
- Sentora's logo is copied from Aave Pro into public/icons/curators/ for
the mocks. Real curator logos will arrive as URLs.
Shared components
- CuratorBy and TitleWithSubtitle (title, dot, subtitle), from Aave Pro's
card. OpportunityCard takes subtitle and curators, and exports its
surface style (CARD_SURFACE_SX) for the summary card.
- DotIcon is Aave Pro's 3px IconDot, used by TitleWithSubtitle.
- HealthFactorNumber takes heartGap. The default stays 0.25rem for the
/migrate table; the borrow card and the summary use 0.375rem.
- dottedUnderlineSx in figmaColors is the one dotted underline. The
markets page's V4 rate uses it too, with no visual change.
- getHubDisplayName and getMarketDisplayName replace the repeated
"Hub"/"Market" suffix regexes.
Showcase
- Hub cards: a playground (side, state, pill, curator, APY tooltip,
incentives) with a code snippet generated from the same props, both
designs side by side, and a props table.
- Flow: a position summary demo with its props table, an Earn/Borrow
toggle for the search placeholder ("Search earn hubs" / "Search
markets"), and the review step's copy "Review your position migration
from Aave V3 to Aave V4 on {chain}".
- PropControl and PropsTable are shared by both pages. The APY and
curator tooltip text is placeholder copy.
V4 migration (presentational, ahead of the backend)
- Earn amount card: a TokenAmountInput in a DynamicCard, then
DescriptionItem rows. Figma type and spacing: 1rem by 1.25rem padding,
base fg-3 labels, a 2.25rem amount, an h5 fg-3 USD readout, and title
and balance rows of 1.375rem so the text lands where the design has it.
The token chip is our tertiary button with the Figma chevron
(ChevronDownIcon at 18px with a 1.35px stroke).
- The USD readout brightens and underlines on hover; clicking it swaps the
field to typing dollars ("$" prefix, 2 decimals) and back. The value
stays in token units, and the readout then shows the token amount with
decimals picked from its price.
- The token chip opens SelectAssetModal: our BasicModal at 480 by 640, an
H4 title (1rem/500/1.125rem), then BalanceAssets with a large search,
labelled groups, H5/Base rows (icon, name over symbol, balance over USD,
0.375rem apart), an empty state and loading rows.
- Borrow side: an InputRange takes the input's place. A "Migrate Amount"
box (h5, 2rem, inset border-1 ring, sized to its value with tabular
figures) sits over a 6px fg-1 on bg-4 slider with a 20px thumb that
travels 6px inside the ends, and stop labels at 0/25/50/75/100%. Rows
below show the collateral, borrow and net value moving.
- A switch inside a card row takes the Figma look (fg-4 off track, flat
thumb, soft track shadow) without changing switches elsewhere.
Ported from Aave Pro (logic copied, styles rewritten for MUI)
- DynamicCard (.Inner, .Divider), DescriptionItem, AutoResizer,
TokenAmountInput, InputRange (built from LeverageMultiplier) and
BalanceAssets (without cmdk). bignumber.js stands in for Aave Pro's
BigDecimal. DynamicCard.Inner wraps each row in a forwardRef div for
motion's popLayout on React 18 and tells rows whether they are last.
- Fixed while porting: in USD mode Aave Pro's raw-buffer check dropped a
typed "12." for any token not worth $1, and its trailing-zero strip
turned "100" into "1" for tokens with 0 decimals.
- DescriptionItem rows are divided by a 1px border, matching the Figma row
pitch, instead of a shadow.
Shared
- InfoLabel (a label with an optional info icon) replaces the copies in
StatRow, DescriptionItem and InputRange; long labels now ellipsize.
- CARD_RADIUS and CARD_SURFACE_SX move from OpportunityCard to
figmaColors, so non-card users don't pull in the chart code.
- getCompactDecimals joins the FormattedNumber helpers.
- table-item-hover-2 gets Aave Pro's light value (f4f4f4); it only had a
dark value and nothing used it. No existing colour changes.
Showcase
- Migration > Amount: the amount and collateral cards as designed, a
playground with a live snippet, the borrow-side slider card, and props
tables. Mock data and tooltip copy are placeholders. CodeSnippet is
shared with the Hub cards page.
The active item and a hovered neighbour merged into one block. Their fills now sit on an inset ::before (insetHighlightBase and insetHighlightActive, as the dropdown menus use) that stops 1px short of each row's bottom. Two highlighted rows keep a 1px gap, while the rows still touch, so the hover target stays continuous. Dev showcase only.
V4 migration (presentational, ahead of the backend)
- V4MigrationPreview: the review step's V3 | V4 comparison card. A
header with the Aave wordmark and a V3/V4 tag (27 by 16 pill, inset
1.5px ring, 10px/600; V3 in fg-3, V4 in purple-1 with a lighter
ring), then rows of a base fg-3 label with its info icon, a V3 cell
and a V4 cell in h5 fg-1. Rows take any cells, so the earn and borrow
cards are the same component; an empty cell shows an fg-4 dash. An
optional uppercase title sits 0.875rem above the card.
- Where the two Figma screens differ, the layout follows the borrow
screen: a 48px header, 50px rows, a 196px V4 column and 1rem between
the V3 values and the vertical line. The side insets are 1.25rem, as
on the earn screen and the other cards. The vertical line stops 1px
above each row divider so the crossings aren't darker. Narrow cards
scroll sideways.
- loading on a row swaps both cells for skeletons, for while the V4
projection loads.
- PositionName: the hub (or "{market} Market" and the hub) with its
icon. With onClick it becomes the Market row's small tertiary button
with the up/down chevron, which opens the hub list in a modal, as
Aave Pro's flows do.
- Not built yet: the borrow screen's settings icon and its expandable
Borrowing power row, until their designs land.
Ported from Aave Pro
- SelectTargetModal (Aave Pro's target picker): labelled groups of hubs
or markets, each row with the 44px icon, the name over an optional
subtitle, and the APY (or the balance over the APY). Disabled options
fade to 50%.
- HubMarketIcon takes tone="grey", Aave Pro's own look (bg-5 tile, grey
gradient glyph), used by the hub button and the picker. The hub cards
keep the default tone. Its background prop had no callers left and is
gone.
- Every row's tooltip copy comes from Aave Pro.
Shared
- AssetListItem (the list, group, row and loading row) moves out of
BalanceAssets, so the asset and hub pickers share one row style.
- SelectModal is the shell both pickers use: BasicModal at 480 by 640
with the H4 title.
- CuratorBy exports CuratorNames (the logo and name, without "by").
- DescriptionItem exports its value skeleton for the preview.
- New tokens: migration-v4-tag-ring, migration-glyph-grey-edge and
migration-glyph-grey-darkest. No existing colour changes.
Showcase
- Migration > Preview: the earn and borrow cards as designed, a
playground (side, title, loading, narrow width) with a live snippet,
and props tables. Picking a hub in the modal updates the button and
the V4 values. Mock data only.
V4 migration (presentational, ahead of the backend) - V4MigrationPreview rows take details. An expandable row gets a chevron in a gutter left of the labels and slides its detail rows in on a tinted panel: no label, 52px rows, values in the same h5 type as the other rows. The borrow card's Collateral row lists each asset this way. - Choose Borrow Market, for an earn position used as collateral: a search field, "Your Existing V4 Positions" and "Market Opportunities" with an info tooltip on each heading, and rows of the 44px market tile, the market name over "hub · health factor · CF 85% · assets", and the balance over "x% APY". - PositionName shows a market as "Main · Core" (bare names), as the review screens and Aave Pro do. The hub-only label stays "Core Hub". - TokenAmountInput: the swap arrows before the USD readout (the hover underline stays under the number) and a % button before Max that opens a 25 / 50 / 75% menu. Ported from Aave Pro - TransactionCard: the final transaction card with the animated status bar (glowing tip, halo, smoke and canvas particles), the spinner that turns into a check or an X, the hero, the rows and the metadata band. The header's status colours follow the Figma (data-purple pending, data-green success). It respects reduced motion, and the particles pause off screen. - Same look, less work than Aave Pro: the spinner's loops stop once the transaction settles, and the particle canvas starts at the card's clipped edge. Shared - SelectTargetModal: an optional search (searchPlaceholder, matching option keywords), group tooltips, subtitles given as a list joined by the 3px dot, "x% APY" and a compact balance. - HubMarketIcon takes tone="picker", the Figma's 44px list tile (bg-3 tile, lighter glyph at 50%). Both pickers use it. - AssetListItem: the right column top-aligns, and the no-results state is shared as AssetListEmpty (BalanceAssets uses it too). - DescriptionItem: --description-item-padding (as in Aave Pro), and outside DynamicCard.Inner the last row drops its divider by itself. - AssetGroup takes overlap and cutoutGap. NumberChange formats a current -> after pair of numbers for the /migrate tables. - New tokens: migration-selected-0, migration-glyph-picker-edge and migration-glyph-picker-darkest. No existing colour changes. Copy - All migration copy is translated and lives in src/modules/v4Migration/utils/copy.tsx: the flow header, the amount step, the preview rows and titles, both pickers, the transaction card and the banners. The showcase uses it. Cleanup (no visual change) - The theme's table Paper variant is CARD_SURFACE_SX, so the card surface is defined once. - colorToP3 returns its input when a channel isn't a finite number. - TransactionCard uses TxStatus from TxStatusHeader. - IncentivesIcon sizes by fontSize, and the token chip uses endIconSizeSx. - motion.bezier.smooth (the array form motion needs) and the hover tokens replace hard-coded timings. Showcase - Migration > Transaction: the four Figma screens, a playground (side, status, replay) and props tables. - Migration > Preview: the earn card used as collateral. Turning the switch on opens the market picker, picking a market switches the card to its rows, and closing without a pick turns the switch off. - PlaygroundLayout and migrationMocks hold the playground layout and the mocks the migration sections share. The new icons are in Icons. Mock data only.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Brings in #3190 (asset page cards and transaction modals) and #3197 (asset page visual tweaks). Conflicts - PageHeader/pageBandSx.ts: kept main's SystemStyleObject type, which TopInfoPanel now spreads, and this branch's 2rem top padding. - Locale catalogs: took main's, then re-extracted the English catalog from the merged source and recompiled every locale.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
V4 migration (presentational, ahead of the backend)
- V4MigrationPreview: below 640px (LIST_CARDS_BELOW, the app's
table-to-cards breakpoint, read with useMediaQuery as the /migrate
tables do) the comparison table becomes two stacked cards, V3 then
V4, 1rem apart. Each card carries every label and its own value
column, with 48px rows as in the mobile Figma; desktop keeps 50px.
Expandable rows open inside their own card. A layout prop ('table' |
'cards') forces one, e.g. for the showcase.
- Where the mobile Figma differs from the rest of its screen, the cards
keep the 1.25rem right inset the other cards use (the Figma has 1rem)
and the V3 card's values line up with the V4 card's (the Figma has
them 1rem further in).
Shared
- FlowHeader: the subheading flows as text, so long copy wraps on a
phone. It used to be a no-wrap flex row, and the review step's copy
ran off a 393px screen. Chips such as the chain stay together inline.
Below 640px the title's line height is 1.2, as in the mobile Figma.
- TokenAmountInput: the swap arrows before the fiat readout are 20px
with a 0.375rem gap, as both Figma frames show (16px and 0.25rem
before).
Copy
- MIGRATE_AMOUNT.balanceLabel reads "Available to Migrate", shortened
to "Available" below 640px so the amount row fits on a phone.
Showcase
- Migration > Preview: an "As designed - mobile" example at the Figma's
card width. The playground's Width option is now Desktop / Mobile; it
replaces Narrow, which showed the scrolling table.
V4 migration (presentational, ahead of the backend)
- V4MigrationBanner compact, the asset page's migrate upsell, follows
the updated design: a 400px card with the same header and glow
surface, 1.25rem padding, the stats as rows (a label with an optional
info tooltip, an 18px value, lines between rows) and a full-width
"Migrate to V4" button. It replaces the single-row layout with the
small Migrate button.
- Stats take an optional tooltip and prevValue, so one component covers
the six designed variants: Earn, Borrow and Earn & Borrow, each with
the V4 rate only or V3 -> V4. Rows align label and value on their
baseline, as in the V3 -> V4 card. The wide dashboard banner looks
the same.
- ValueChange: 0.625rem either side of the arrow at the 18px (h3) size,
as measured; the 14px size keeps 0.5rem.
Copy
- MIGRATION_BANNER.compact.earn / borrow / earnAndBorrow for the three
subtitles, and earnApy / borrowApy for the rows, with Aave Pro's
tooltip copy. "Earn up to {apy} APY" went with the old layout.
Showcase
- Migration > Banners: all six variants, laid out as in the Figma.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
This branch was successfully deployed
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.
No description provided.