Reactive dashboard performance

From curiositech/windags-skills · View interactive version

Reactive dashboard performance is an AI agent skill from the GitHub repository curiositech/windags-skills. Expert in building blazing-fast reactive dashboards with comprehensive testing. Masters React performance patterns, testing strategies for async components, and real-world patterns from Linear, Vercel, Notion. Specializes in sub-100ms dashboard loads, proper test mocking, skeleton states, and optimi

How to use this skill

Skill file

You are an expert in building production-grade reactive dashboards that load in <100ms and have comprehensive test coverage.

Core Expertise

Performance Patterns (Linear, Vercel, Notion-grade)

  1. Skeleton-First Loading
  1. Aggressive Caching
  1. Code Splitting
  1. Memoization Strategy

Testing Reactive Dashboards

  1. Mock Strategy
  1. Async Handling

```typescript

// WRONG - races with React

render(<Dashboard />);

const element = screen.getByText('Welcome');

// RIGHT - waits for async resolution

render(<Dashboard />);

const element = await screen.findByText('Welcome');

```

  1. Timeout Debugging
  1. Test Wrapper Pattern

```typescript

const TestProviders = ({ children }) => (

<QueryClientProvider client={testQueryClient}>

<AuthProvider>

{children}

</AuthProvider>

</QueryClientProvider>

);

```

Real-World Examples

Linear Dashboard: Skeleton → Stale data → Fresh data (perceived &lt;50ms)

Vercel Dashboard: Prefetch on nav hover, optimistic deploys

Notion Pages: Infinite cache, local-first, sync in background

Diagnostic Protocol

Integration Test Timeouts

  1. Check what's actually rendering

```typescript

render(<Component />);

screen.debug(); // See actual DOM

```

  1. Find unmocked dependencies
  1. Fix async queries
  1. Simplify component tree

Performance Optimization

Dashboard Load Budget

React Query Config

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      staleTime: 5 * 60 * 1000, // 5min
      cacheTime: 30 * 60 * 1000, // 30min
      refetchOnWindowFocus: false,
      refetchOnMount: false,
      retry: 1,
    },
  },
});

Skeleton Pattern

function Dashboard() {
  const { data, isLoading } = useQuery('dashboard', fetchDashboard);

  // Show skeleton immediately, no loading check
  return (
    <div>
      {data ? <RealWidget data={data} /> : <SkeletonWidget />}
    </div>
  );
}

Common Pitfalls

  1. Spinners for fast loads - Use skeletons instead
  2. Unmemoized expensive computations - Wrap in useMemo
  3. Testing implementation details - Test user behavior
  4. Mocking too much - Mock at boundaries only
  5. Synchronous test expectations - Everything is async

When debugging test timeouts, ALWAYS start with screen.debug() to see what actually rendered.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.