Skip to content

feat(web): per-component loading and mobile polish pass - #36

Merged
nimrod-teich merged 12 commits into
mainfrom
feat/component-loading
Apr 20, 2026
Merged

nimrod-teich merged 12 commits into
mainfrom
feat/component-loading

Conversation

@nimrod-teich

Copy link
Copy Markdown
Contributor

Summary

Second pass on the mobile experience, built around per-component loading and consistent mobile card lists.

Loading

  • New Skeleton primitive + ChartSkeleton (SVG area silhouette with shimmer sweep).
  • StatCard and SortableTable gained a loading prop — spinner and skeleton rows respectively.
  • Removed every page-level if (isLoading) return <Loading />. Each page renders its shell + all components immediately; loading state is passed per component. Chart shell (title, range buttons, filter) renders instantly — no more next/dynamic loading gaps.
  • Provider detail: always render Commission, dropped Claimable Rewards, so the stat count is stable across loading/loaded.

Mobile structure

  • Provider detail services table and chain detail providers table are now tappable card lists on mobile (chain icon / avatar + name + health chip + total stake + rotating chevron). Tap expands a detail panel with the hidden fields and stacked interface cards; desktop tables are unchanged.
  • Mobile expand panel upsized for readability: text-base values, px-3 py-1.5 pills, larger dots and gaps.
  • Providers and chains list pages bumped: 44px avatars/icons, text-lg name, text-xs truncated address, text-sm meta, text-base total. Desktop tables go to text-base with py-4 cells.
  • LavaAmount now always uses K/M/B/T shorthand on mobile (skips the measurement path); desktop keeps the adaptive behavior.
  • formatNumberKMB now includes T.

Header / side drawer

  • Mobile header: 72px tall, 28px hamburger, 26px search magnifier. Logo bumped to h-7.
  • Drawer: full-width below the header with a solid bg-background (no bleed-through). Rounded-xl nav items at text-lg, accent left bar on the active route, network toggle at py-4 with shadow-inner, safe-area padding at the bottom.

Misc

Test plan

  • Dashboard / provider / chain / providers-list / chains-list pages: confirm nothing shifts between loading and loaded states (stat cards spinners → values, table skeleton rows → real rows, chart skeletons → real charts, all preserving their slot size).
  • Provider detail + chain detail: tap a mobile row, verify the detail panel renders with the upsized stats and interface cards.
  • Open the mobile drawer: full-width, solid bg, active route has the accent left bar, nav links are comfortable to tap.
  • On a narrow mobile viewport, any LAVA amount should render as X.XM LAVA etc.
  • Footer "Magma Devs" link opens magmadevs.com.

New primitives:
- Skeleton: Tailwind animate-pulse block with rounded corners
- ChartSkeleton: SVG area-chart silhouette with shimmer sweep, axis
  ticks, grid lines, and a dashed secondary line
- ChartCardSkeleton: full card placeholder (header + chart) for use
  in future dynamic loaders
StatCard now shows a small spinner in the value slot when
loading={true} (keeps label/icon visible). SortableTable renders
skeleton rows when loading and supports a new mobileOnly column
meta. Removed the sticky thead and the per-row border-b — moved
dividers to td.border-t for cleaner hover.
LavaAmount measures its container against the full text via a
hidden off-screen duplicate; switches to the KMB-shortened form
when full would overflow. Re-measures on parent resize and font
load. formatNumberKMB now also supports trillions.
Charts show the new ChartSkeleton (animated area silhouette) while
loading, replacing the generic spinner + text. All chart card
headers and content use the same p-4/md:p-6 padding so the layout
doesn't shift when the chart mounts.
Removed the page-level `if (isLoading) return <Loading />` in
every page. Each page now renders its shell + all components
immediately; loading flags are passed down per component so stat
cards show spinners, tables show skeleton rows, pie charts show a
donut skeleton, and charts show their own area-shape skeleton.

Charts are imported directly (no more next/dynamic wrapper) so the
chart card shell — title, description, range buttons, ChainSelect —
renders immediately alongside everything else; only the plot area
waits on data.

Provider detail: always render Commission (and drop Claimable
Rewards entirely) so the card count doesn't change between loading
and loaded states. Header renders a skeleton for the moniker until
the provider arrives, and the 'Not Found' fallback only fires after
loading completes.
On mobile, replace the cramped services table with a bigger, tappable
card list: chain icon + specId + health chip, total stake on the
right, rotating chevron. Tap to expand a detail panel with the full
stats grid (Self Stake, Delegation, Commission, Location,
Addons/Extensions) and stacked interface cards. Expand content is
upsized (text-base, px-3 py-1.5 pills, w-2.5 dots) to be comfortably
readable on a phone. Desktop table is unchanged.
Mirrors the provider detail treatment: mobile gets a tappable card
list (provider avatar, moniker, truncated lava@ address below,
health chip, total stake on the right, expand chevron). Mobile rows
are pre-sorted by total stake desc. Tap to expand a detail panel
matching the provider-side styling. Desktop table unchanged.
Providers and chains list pages bumped on both mobile and desktop:
44px avatars/icons, text-lg moniker/name, text-xs truncated address,
text-sm meta line, text-base total. Desktop tables go from text-sm
to text-base with py-4 cell padding.
Mobile header is now 72px tall. Hamburger icon 24→28px, search
magnifier 22→26px. Drawer spans the full width below the header with
a solid bg-background (no bleed-through). Nav items are text-lg in
rounded-xl rows with an accent left bar on the active route; network
toggle is py-4 with shadow-inner. Safe-area inset padding added at
the bottom so the last item isn't obscured by iOS home indicator.
On screens <768px the amount is rendered as the compact form
unconditionally (skipping the measurement); desktop keeps the
adaptive full-vs-compact behavior.
apps/web and apps/api import from @info/shared subpath exports
(./utils, ./types) whose package.json export maps point at
dist/*.js. Without a build, vitest cannot resolve them at test
time — fixes ERR_MODULE_NOT_FOUND in apps/web format tests.
@nimrod-teich
nimrod-teich merged commit faf18a0 into main Apr 20, 2026
2 checks passed
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.

1 participant