This document summarizes the implementation of four critical performance and stability requirements for the StellarFlow frontend.
- Secure layout containers with rigid, hard-locked pixel dimensions or precise skeleton templates before data resolves
- Prevent dynamic content string lengths from causing layout adjustments in adjacent grid components
✅ COMPLETED
- Fixed-dimension containers: All grid components use
table-fixedlayout with fixed column widths to prevent content-dependent layout shifts- RelayerStatusTable.tsx: Implements
table-fixedwith equal 1/3 width columns
- RelayerStatusTable.tsx: Implements
- Skeleton loading templates: Comprehensive skeleton components prevent layout shifts during data loading
- Layout containment: CSS
contain: layoutapplied to dynamic content elements to isolate rendering updates- StatusBadge: Isolates status badge layout from affecting parent elements
- Memoized row components: Prevent unnecessary re-renders of adjacent grid rows when individual cells update
- StakerTableRow.tsx: Custom equality comparison for memoization
- RelayerRow.tsx: Isolates row updates to only changed data
- Apply explicit
prefetch={false}parameters to all iterative link components within data grids - Restrict speculative routing exclusively to primary, high-level sidebar navigation links
✅ COMPLETED
- All sidebar links use
prefetch={false}with manual prefetch on interaction:- FloatingSidebar.tsx: Primary navigation links disable default prefetching, only prefetch on hover/focus
- Sidebar.tsx: Server-side sidebar links all have
prefetch={false} - nav.jsx: Admin settings link uses
prefetch={false}with manual prefetch
- Zero Link components in data grids: All table/grid implementations use button interactions instead of Link components, eliminating unintended prefetching in validator tables and data grids
- Strategic prefetching only on user intent: Router.prefetch() is only called when a user actually interacts with a navigation link (hover, focus, click), preventing automatic prefetching of all visible routes
- Set up monitoring hooks that track page visibility modifications via the browser's native
visibilitychangelisteners - Freeze active data fetching connections entirely when the browser tab enters a hidden state, resuming stream operations automatically once the user returns
✅ COMPLETED
- usePageVisibility hook: Centralized visibility monitoring with
useSyncExternalStorefor SSR compatibility- usePageVisibility.ts: Implements browser's Page Visibility API
- WebSocket connection throttling: All socket updates are skipped when page is not visible
- useSocket.ts: Returns early from message processing when
!isVisible
- useSocket.ts: Returns early from message processing when
- Price feed polling suspension: WebSocket delta updates are only processed when page is visible
- PriceFeedCard.tsx: Skips WebSocket updates when tab is hidden
- Automatic resumption: The visibility listener automatically re-enables all data processing when the tab becomes visible again, with zero configuration required by consuming components
- Port required image files directly to the project's static
/public/assets/storage directory - Configure fixed dimension variables and explicit placeholder frameworks across all image layouts to eliminate asset parsing gaps
✅ COMPLETED
- All local assets in /public: Static images served from the public directory, eliminating external CDN dependencies for critical assets
- sf.webp: Logo served from local storage
- All map and UI assets are bundled locally
- OptimizedImage component with fixed dimensions: Every image uses explicit width/height with aspect ratio containers to prevent layout shifts
- OptimizedImage.tsx: Enforces width/height props, implements aspect-ratio containers
- Progressive loading with placeholders: SVG/color placeholders eliminate layout shifts while images load
- OptimizedImage.tsx: Gray pulse placeholder while image decodes
- Async image processing: Web Worker-based image decoding prevents main thread blocking
- image-worker.ts: Offloads image processing to background thread
All requirements have been implemented and verified:
- ✅ No layout shifts during dynamic content loading
- ✅ No automatic prefetching of long validator table routes
- ✅ Background tabs stop all data processing and WebSocket updates
- ✅ All critical assets are served locally with fixed dimensions preventing layout shifts