Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dashboard): create right panel with user/creator modes and activ… #122

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

AnoukRImola
Copy link
Collaborator

@AnoukRImola AnoukRImola commented Feb 3, 2025

Pull Request Overview

📝Summary

Implements the right-side panel component for the KindFi User Dashboard, featuring mode switching between User/Creator views, latest updates feed, and recent activity tracking with responsive design and accessibility support.

🪧 Related Issues

Closes #53

🏁 Type of Change

[x] 👌 Enhancement (non-breaking change which adds functionality)

🔄 Changes Made

  • Created right panel component structure with mode switching capability
  • Implemented latest updates and recent activity sections
  • Added mock data and service layer for data handling
  • Integrated responsive design and accessibility features
  • Implemented lazy loading for performance optimization

🚀 Implementation Details

1. Core Components:

  • RightPanel: Main container with mode switching
  • NavigationMenu: Context-aware navigation based on selected mode
  • LatestUpdates: Scrollable updates feed
  • RecentActivity: Interactive activity timeline

2. Technical Features:

  • Lazy loading using Next.js dynamic imports
  • Shadcn/ui components integration
  • Responsive design with mobile-first approach
  • ARIA labels and roles for accessibility
  • Mock data service layer for future API integration

🛠 Technical Notes

  • Uses Suspense and dynamic imports for performance optimization
  • Implements skeleton loading states for better UX
  • Follows TypeScript best practices with proper type definitions
  • Uses Tailwind CSS for styling with proper responsive classes
  • Implements proper accessibility patterns with ARIA labels and roles

✅ Tests Results

Test Coverage
[x] 📟 Manual Testing

  • Tested responsive behavior across breakpoints
  • Verified mode switching functionality
  • Confirmed lazy loading behavior
  • Validated accessibility using screen readers
  • Tested keyboard navigation

📸 Evidence

image
image
image

Summary by CodeRabbit

  • New Features
    • Introduced a responsive dashboard layout featuring a flexible main area alongside a fixed sidebar.
    • Enhanced the dashboard with an interactive right panel, including a tabbed navigation switch between user and creator modes.
    • Integrated sections for Latest Updates and Recent Activity, providing smooth scrolling and dynamic loading placeholders for an improved user experience.

Copy link

vercel bot commented Feb 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kindfi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 3:14pm

Copy link
Contributor

coderabbitai bot commented Feb 3, 2025

Walkthrough

This update introduces several new UI components to the dashboard interface. A new DashboardLayout organizes main content and a fixed right sidebar. The sidebar, rendered by the RightPanel component, toggles between "user" and "creator" modes and dynamically loads sub-components such as NavigationMenu, LatestUpdates, and RecentActivity. Additionally, scrollable areas are implemented via new ScrollArea and ScrollBar components using Radix UI. New mock data, asynchronous service functions, and type definitions support these interactive dashboard features.

Changes

File(s) Change Summary
apps/web/app/(routes)/dashboard/layout.tsx Added DashboardLayout component to structure the main content and right sidebar.
apps/web/components/base/scroll-area.tsx Added ScrollArea and ScrollBar components utilizing Radix UI for scrollable regions.
apps/web/components/sections/user/right-panel/* Added right panel components: RightPanel, LatestUpdates, NavigationMenu, RecentActivity, and lazy-loading skeletons for navigation and content sections.
apps/web/lib/constants/mock-data/right-panel-mocks.ts Introduced mockUpdates and mockActivities arrays with sample update and activity data.
apps/web/lib/services/right-panel-service.ts Added asynchronous functions getLatestUpdates and getRecentActivities to fetch dashboard data with a delay.
apps/web/lib/types/right-side-panel.ts Introduced new types and interfaces: DashboardMode, NavigationItem, Update, and Activity for enhanced type safety.
apps/web/package.json Added dependency "@radix-ui/react-scroll-area": "^1.2.2" for scroll area functionality.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant DL as DashboardLayout
    participant RP as RightPanel
    participant NM as NavigationMenu
    participant LU as LatestUpdates
    participant RA as RecentActivity
    participant RS as Service

    U->>DL: Open dashboard
    DL->>RP: Render right panel
    RP->>NM: Toggle mode (User/Creator)
    RP->>LU: Lazy load latest updates
    RP->>RA: Lazy load recent activity
    LU->>RS: getLatestUpdates()
    RA->>RS: getRecentActivities()
    RS-->>LU: Return mock updates
    RS-->>RA: Return mock activities
    U->>NM: Interact with navigation links
Loading

Assessment against linked issues

Objective Addressed Explanation
Toggle between "User" and "Creator" modes and display relevant navigation (#53)
Display Latest Updates with a "View All" option, timestamps, and descriptions (#53)
Show Recent Activities with icons and clickable navigation (#53)

Suggested labels

documentation, enhancement, webapp

Suggested reviewers

  • AndlerRL
  • Bran18

Poem

I'm a rabbit in the code, hopping with glee,
New panels and updates now dance on my screen.
With toggles and scrolls, the dashboard sings,
A merry mosaic of interactive things.
Bound through the bytes with a joyful leap,
Celebrating our code—hoppin’ dreams to keep! 🐇

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai bot added documentation Improvements or additions to documentation enhancement New feature improvement or request webapp web app related labels Feb 3, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4a1342 and dc2d49f.

📒 Files selected for processing (11)
  • apps/web/app/(routes)/dashboard/layout.tsx (1 hunks)
  • apps/web/components/base/scroll-area.tsx (1 hunks)
  • apps/web/components/sections/user/right-panel/index.tsx (1 hunks)
  • apps/web/components/sections/user/right-panel/latest-updates.tsx (1 hunks)
  • apps/web/components/sections/user/right-panel/lazy-components.tsx (1 hunks)
  • apps/web/components/sections/user/right-panel/navigation-menu.tsx (1 hunks)
  • apps/web/components/sections/user/right-panel/recent-activity.tsx (1 hunks)
  • apps/web/lib/constants/mock-data/right-panel-mocks.ts (1 hunks)
  • apps/web/lib/services/right-panel-service.ts (1 hunks)
  • apps/web/lib/types/right-side-panel.ts (1 hunks)
  • apps/web/package.json (1 hunks)
🔇 Additional comments (5)
apps/web/components/sections/user/right-panel/lazy-components.tsx (1)

5-13: LGTM! Well-structured skeleton components with consistent implementation.

The skeleton components are well-implemented with:

  • Consistent spacing using Tailwind's space-y utilities
  • Appropriate height values for different content types
  • Good use of map for repeated elements

Also applies to: 15-27, 29-41

apps/web/components/base/scroll-area.tsx (1)

7-23: LGTM! Well-implemented ScrollArea with proper ref forwarding.

The ScrollArea component is well-implemented with:

  • Proper type definitions
  • Good use of className merging
  • Built-in accessibility from Radix UI
apps/web/components/sections/user/right-panel/navigation-menu.tsx (1)

56-84: Great implementation of accessibility features!

The component demonstrates excellent accessibility practices:

  • Proper ARIA labels for navigation and items
  • Semantic HTML with nav element
  • Hidden decorative icons
  • Focus management with visible outlines
apps/web/components/sections/user/right-panel/recent-activity.tsx (1)

30-69: Great implementation of accessible scrollable content!

The ScrollArea implementation demonstrates excellent practices:

  • Proper ARIA labels and roles
  • Semantic HTML structure
  • Accessible button elements with descriptive labels
  • Proper time element usage with datetime attribute
apps/web/package.json (1)

23-23: Verify the package version and check for vulnerabilities.

The added Radix UI ScrollArea package uses a caret version range which could lead to unexpected updates.

Let's verify the package version and check for any known vulnerabilities:

✅ Verification successful

Radix UI ScrollArea Dependency Verified

  • The package version is confirmed as 1.2.2—the latest available release.
  • The vulnerability audit (once bypassing the husky prepare hook using --ignore-scripts) does not report known issues.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the latest version and vulnerabilities for @radix-ui/react-scroll-area

# Check npm for latest version
echo "Latest version:"
npm view @radix-ui/react-scroll-area version

# Check for known vulnerabilities
echo -e "\nVulnerability check:"
npm audit @radix-ui/react-scroll-area

Length of output: 539


Script:

#!/bin/bash
# Description: Generate a package-lock file in apps/web and run a vulnerability audit
set -e

# Navigate to the web app directory containing the package.json
cd apps/web

echo "Creating package-lock.json (if not already present)..."
npm i --package-lock-only

echo -e "\nChecking the latest version for @radix-ui/react-scroll-area:"
npm view @radix-ui/react-scroll-area version

echo -e "\nRunning vulnerability audit for @radix-ui/react-scroll-area:"
npm audit @radix-ui/react-scroll-area || true

Length of output: 451

Copy link
Contributor

@Bran18 Bran18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tks a lot Anouk for taking care of the issue

@Bran18 Bran18 merged commit 7842194 into develop Feb 3, 2025
4 of 5 checks passed
JoE11-y pushed a commit to JoE11-y/kindfi that referenced this pull request Feb 5, 2025
@coderabbitai coderabbitai bot mentioned this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature improvement or request webapp web app related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Right-Side Panel Component - User Dashboard Page
2 participants