InPactAI icon indicating copy to clipboard operation
InPactAI copied to clipboard

Enhance Dashboard UX with Skeletons, Empty States, and Backend Dependency Alignmen

Open Kalpana-chavhan opened this issue 10 months ago • 4 comments

closes #269


Description

This PR significantly enhances the Dashboard user experience by moving away from static "Coming Soon" text to a dynamic, professional interface. The focus was on improving the "perceived performance" of the app—ensuring that even while data is loading or missing, the interface remains polished and guided.

Beyond the UI, I have also synchronized the backend requirements to ensure a smooth "one-click" setup for future contributors, resolving common dependency issues found in the local development environment.


Changes Made

  1. Frontend (UX/UI Refinement):
  • Integrated Skeleton Loading: Added custom pulsing placeholders for dashboard metrics and charts. This eliminates jarring layout shifts while waiting for backend responses.
  • New Empty State Architecture: Created a reusable EmptyState component with context-aware Lucide icons to replace blank screens on tabs like "Analytics" and "Sponsorships."
  • Theme Consistency: Updated Tailwind styles in the DashboardPage to ensure full accessibility and visual parity between light and dark modes.
  • Component Modularization: Added Skeleton.tsx and EmptyState.tsx to the UI kit for future use across the application.
  1. Backend (Stability & Setup):
  • Requirement Alignment: Updated requirements.txt to include essential missing libraries: sqlalchemy, aiopg, and uvicorn.
  • Environment Fix: Resolved ModuleNotFoundError issues that previously blocked the FastAPI server from initializing correctly on Windows environments.

Checklist

  1. I have read the contributing guidelines.
  2. I have verified the frontend UI transitions locally.
  3. I have added necessary documentation (new components are modular and commented).
  4. All backend dependencies are now correctly listed in requirements.txt.

Summary by CodeRabbit

  • New Features

    • Added Skeleton loading placeholders and an Empty State component; dashboard shows loading skeletons and empty-state prompts with actions.
    • AI-driven content sections now render skeletons while loading.
  • Backend / Auth

    • Login response now includes additional user and session fields.
    • Email validation for new users tightened.
  • UI/UX Improvements

    • Updated dashboard header, navigation, top action button, tabs and layout for clearer flow and improved loading transitions.

✏️ Tip: You can customize this high-level summary in your review settings.

Kalpana-chavhan avatar Jan 06 '26 14:01 Kalpana-chavhan

📝 Walkthrough

Walkthrough

Adds a new backend LoginResponse schema and stricter email validation, introduces two frontend UI components (EmptyState, Skeleton), and integrates loading/empty-state handling and client-side data fetching into DashboardPage with updated header actions and navigation.

Changes

Cohort / File(s) Summary
Backend Schema Updates
Backend/app/schemas/schema.py
Added LoginResponse Pydantic model (message, user_id, email: EmailStr, optional name, role, session, onboarding_completed) and changed UserCreate.email from str to EmailStr. Added imports: EmailStr, Any, List.
Frontend UI Components
Frontend/src/components/ui/EmptyState.tsx, Frontend/src/components/ui/Skeleton.tsx
New EmptyState component (icon, title, description, optional CTA and handler). New Skeleton component with circle/rect variants and pulse animation for loading placeholders.
Dashboard Integration
Frontend/src/pages/DashboardPage.tsx
Added isLoading state and useEffect data fetch flow; integrated Skeleton and EmptyState across Overview, Sponsorships, Analytics, and Collaborations areas; updated header icons/actions, navigation via useNavigate, and dark-mode-aware styling.

Sequence Diagram(s)

sequenceDiagram
  participant Browser as Browser (DashboardPage)
  participant UI as UI Components (Skeleton / EmptyState)
  participant API as Backend API
  Browser->>API: Request dashboard data (on mount)
  API-->>Browser: Returns data or empty result
  alt while fetching
    Browser->>UI: Render Skeleton placeholders
  else data received
    Browser->>UI: Render populated metric cards / lists
  else no data
    Browser->>UI: Render EmptyState with CTA
  end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰
I hopped through schemas, fine and neat,
Gave emails a stricter beat,
Skeletons shimmer, EmptyStates sing,
Dashboard wakes—new life they bring,
Carrots, clicks, and tiny feet.

🚥 Pre-merge checks | ✅ 2 | ❌ 3
❌ Failed checks (1 warning, 2 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title refers to the main change (Dashboard UX enhancement with Skeletons and Empty States) but contains a typo ('Alignmen' instead of 'Alignment') and is slightly incomplete, making it ambiguous about backend dependencies. Correct the typo to 'Alignment' and clarify whether backend dependencies are a primary focus or secondary: revise to 'Enhance Dashboard UX with Skeletons, Empty States, and Backend Alignment'.
Out of Scope Changes check ❓ Inconclusive Backend changes (requirements.txt updates for sqlalchemy, aiopg, uvicorn) appear tangential to the UX-focused issue #269 and lack linked justification, raising questions about scope alignment. Clarify whether backend dependency updates are necessary for PR #270 scope or should be separated into a dedicated PR; link to any related backend initialization issues if applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully implements the core requirements from issue #269: Skeleton Loader System with CSS-based pulsing, reusable EmptyState component with icon and CTA button, and integration into Dashboard tabs.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • [ ] 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Jan 06 '26 14:01 coderabbitai[bot]

Hi Maintainers, Just a gentle follow-up on this PR. All checks are passing, please let me know if any changes are needed from my side. Thanks! @Saahi30 , @Aditya30ag , @chandansgowda

Kalpana-chavhan avatar Jan 08 '26 09:01 Kalpana-chavhan

@Kalpana-chavhan please do the coderabbit ai suggestion fix

Aditya30ag avatar Jan 09 '26 06:01 Aditya30ag

hello, @Aditya30ag ,the checks are passing.

Kalpana-chavhan avatar Jan 09 '26 16:01 Kalpana-chavhan