Skip to content

Sidebar redesign#1012

Merged
Developing-Gamer merged 2 commits intodashboard-redesignfrom
sidebar-redesign
Nov 18, 2025
Merged

Sidebar redesign#1012
Developing-Gamer merged 2 commits intodashboard-redesignfrom
sidebar-redesign

Conversation

@Developing-Gamer
Copy link
Contributor

@Developing-Gamer Developing-Gamer self-assigned this Nov 12, 2025
@vercel
Copy link

vercel bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
stack-backend Ready Ready Preview Comment Nov 12, 2025 10:22pm
stack-dashboard Ready Ready Preview Comment Nov 12, 2025 10:22pm
stack-demo Ready Ready Preview Comment Nov 12, 2025 10:22pm
stack-docs Ready Ready Preview Comment Nov 12, 2025 10:22pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sidebar-redesign

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.

@Developing-Gamer Developing-Gamer marked this pull request as ready for review November 12, 2025 22:39
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 12, 2025

Greptile Overview

Greptile Summary

This PR introduces a comprehensive sidebar redesign focused on modern design, UX improvements, speed, and efficiency. It adds a new DESIGN_GUIDE.md that documents design patterns, color systems, dark mode requirements, and component usage guidelines to ensure consistency across the dashboard. The sidebar-layout.tsx has been completely redesigned with improved navigation structure, collapsible app sections with sub-items, enhanced active state highlighting, proper dark mode support with conditional classes, and performance optimizations through memoization.

Key changes:

  • Added comprehensive design guide with dark mode and accessibility requirements
  • Redesigned sidebar with modern blue accent colors for active states
  • Implemented collapsible app sections with smooth animations
  • Added sub-item navigation with visual indicators (small dots)
  • Properly implemented dark mode with dark: variant classes throughout
  • Added performance optimizations with useCallback and useMemo
  • Improved hover states and transitions for better UX

Issues found:

  • Design guide contains code examples that don't follow its own dark mode guidance (lines 228-237 and 544-562 use text-blue-700 and text-blue-900 without dark: variants)

Confidence Score: 4/5

  • This PR is safe to merge with minor documentation fixes needed
  • The sidebar implementation is solid with proper dark mode support, performance optimizations, and good UX patterns. However, the design guide contains inconsistent examples that contradict its own dark mode guidance, which could lead to future implementations not following best practices. The actual sidebar code correctly implements dark mode, so the runtime functionality is good.
  • Pay attention to DESIGN_GUIDE.md - fix the inconsistent dark mode examples before other developers use them as reference

Important Files Changed

File Analysis

Filename Score Overview
apps/dashboard/DESIGN_GUIDE.md 3/5 New comprehensive design guide added with dark mode requirements, but contains inconsistent examples that don't follow the dark mode guidance
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/sidebar-layout.tsx 5/5 Sidebar completely redesigned with modern UI, proper dark mode support, improved navigation structure and performance optimizations

Sequence Diagram

sequenceDiagram
    participant User
    participant SidebarLayout
    participant NavItem
    participant NavSubItem
    participant HeaderBreadcrumb
    participant resolveBreadcrumbs

    User->>SidebarLayout: Navigates to page
    SidebarLayout->>SidebarLayout: Render SidebarContent with projectId
    SidebarLayout->>SidebarLayout: Calculate enabledApps from config
    SidebarLayout->>SidebarLayout: getDefaultExpandedSections
    SidebarLayout->>NavItem: Render Overview item
    
    loop For each enabled app
        SidebarLayout->>NavItem: Render app section
        NavItem->>NavItem: Check if section is active
        NavItem->>NavItem: Check if section is expanded
        alt Section is expanded
            NavItem->>NavSubItem: Render navigation sub-items
            NavSubItem->>NavSubItem: Check if sub-item matches current URL
        end
    end
    
    SidebarLayout->>NavItem: Render bottom items
    
    SidebarLayout->>HeaderBreadcrumb: Render breadcrumb
    HeaderBreadcrumb->>resolveBreadcrumbs: Get breadcrumb items
    resolveBreadcrumbs->>resolveBreadcrumbs: Match current URL to app
    resolveBreadcrumbs->>resolveBreadcrumbs: Resolve breadcrumb hierarchy
    resolveBreadcrumbs-->>HeaderBreadcrumb: Return breadcrumb items
    HeaderBreadcrumb-->>SidebarLayout: Display breadcrumbs
    
    User->>NavItem: Click navigation item
    alt Item is collapsible section
        NavItem->>NavItem: Toggle section expanded state
    else Item is link
        NavItem->>User: Navigate to href
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +228 to +237
<Typography className="text-xs font-medium uppercase tracking-wide text-blue-700">
Section Label
</Typography>
```

#### Page Headings
```tsx
<Typography className="text-2xl font-semibold text-blue-900">
Main Heading
</Typography>
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: inconsistent with dark mode guidance - uses text-blue-700 and text-blue-900 without dark: variants

these examples contradict the guidance provided in lines 117-118 which states these should use dark mode variants

Suggested change
<Typography className="text-xs font-medium uppercase tracking-wide text-blue-700">
Section Label
</Typography>
```
#### Page Headings
```tsx
<Typography className="text-2xl font-semibold text-blue-900">
Main Heading
</Typography>
#### Section Labels (Uppercase)
```tsx
&lt;Typography className="text-xs font-medium uppercase tracking-wide text-blue-700 dark:text-blue-400"&gt;
Section Label
&lt;/Typography&gt;

Page Headings

<Typography className="text-2xl font-semibold text-blue-900 dark:text-blue-300">
  Main Heading
</Typography>

<details><summary>Prompt To Fix With AI</summary>

`````markdown
This is a comment left during a code review.
Path: apps/dashboard/DESIGN_GUIDE.md
Line: 228:237

Comment:
**syntax:** inconsistent with dark mode guidance - uses `text-blue-700` and `text-blue-900` without `dark:` variants

these examples contradict the guidance provided in lines 117-118 which states these should use dark mode variants

```suggestion
#### Section Labels (Uppercase)
```tsx
&lt;Typography className="text-xs font-medium uppercase tracking-wide text-blue-700 dark:text-blue-400"&gt;
  Section Label
&lt;/Typography&gt;

Page Headings

<Typography className="text-2xl font-semibold text-blue-900 dark:text-blue-300">
  Main Heading
</Typography>

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +544 to +562
<div className="rounded-xl border border-blue-500/40 bg-blue-500/10 p-5">
<div className="flex flex-wrap items-start justify-between gap-4">
<div className="space-y-2">
<Typography className="text-xs font-medium uppercase tracking-wide text-blue-700">
Status Label
</Typography>
<Typography className="text-2xl font-semibold text-blue-900">
{statusText}
</Typography>
</div>
<Badge variant="default" className="bg-blue-600 text-white">
Badge Label
</Badge>
</div>
<Progress value={progress} className="mt-4 h-2 bg-white/40" />
<div className="mt-4 flex flex-wrap items-center justify-between gap-3">
{/* Next action or completion message */}
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: inconsistent with dark mode guidance - uses text-blue-700 and text-blue-900 without dark: variants

same issue as the Typography section - these examples don't follow the dark mode patterns documented earlier in the guide

Suggested change
<div className="rounded-xl border border-blue-500/40 bg-blue-500/10 p-5">
<div className="flex flex-wrap items-start justify-between gap-4">
<div className="space-y-2">
<Typography className="text-xs font-medium uppercase tracking-wide text-blue-700">
Status Label
</Typography>
<Typography className="text-2xl font-semibold text-blue-900">
{statusText}
</Typography>
</div>
<Badge variant="default" className="bg-blue-600 text-white">
Badge Label
</Badge>
</div>
<Progress value={progress} className="mt-4 h-2 bg-white/40" />
<div className="mt-4 flex flex-wrap items-center justify-between gap-3">
{/* Next action or completion message */}
</div>
</div>
<div className="rounded-xl border border-blue-500/40 bg-blue-500/10 p-5">
<div className="flex flex-wrap items-start justify-between gap-4">
<div className="space-y-2">
<Typography className="text-xs font-medium uppercase tracking-wide text-blue-700 dark:text-blue-400">
Status Label
</Typography>
<Typography className="text-2xl font-semibold text-blue-900 dark:text-blue-300">
{statusText}
</Typography>
</div>
<Badge variant="default" className="bg-blue-600 text-white">
Badge Label
</Badge>
</div>
<Progress value={progress} className="mt-4 h-2 bg-white/40" />
<div className="mt-4 flex flex-wrap items-center justify-between gap-3">
{/* Next action or completion message */}
</div>
</div>

<details><summary>Prompt To Fix With AI</summary>

`````markdown
This is a comment left during a code review.
Path: apps/dashboard/DESIGN_GUIDE.md
Line: 544:562

Comment:
**syntax:** inconsistent with dark mode guidance - uses `text-blue-700` and `text-blue-900` without `dark:` variants

same issue as the Typography section - these examples don't follow the dark mode patterns documented earlier in the guide

```suggestion
<div className="rounded-xl border border-blue-500/40 bg-blue-500/10 p-5">
  <div className="flex flex-wrap items-start justify-between gap-4">
    <div className="space-y-2">
      <Typography className="text-xs font-medium uppercase tracking-wide text-blue-700 dark:text-blue-400">
        Status Label
      </Typography>
      <Typography className="text-2xl font-semibold text-blue-900 dark:text-blue-300">
        {statusText}
      </Typography>
    </div>
    <Badge variant="default" className="bg-blue-600 text-white">
      Badge Label
    </Badge>
  </div>
  <Progress value={progress} className="mt-4 h-2 bg-white/40" />
  <div className="mt-4 flex flex-wrap items-center justify-between gap-3">
    {/* Next action or completion message */}
  </div>
</div>

How can I resolve this? If you propose a fix, please make it concise.

@claude
Copy link
Contributor

claude bot commented Nov 12, 2025

Claude finished @Developing-Gamer's task —— View job


🔍 Comprehensive PR Review

This PR implements a comprehensive sidebar redesign with modern UI patterns, dark mode support, and performance optimizations. Overall, the code quality is high with solid patterns, but there are some issues to address.

Strengths

1. Excellent Performance Optimizations

  • Smart use of useCallback for getDefaultExpandedSections and toggleSection functions (lines 405, 418)
  • Proper useMemo for enabledApps, selectedProject, and URL calculations (lines 397, 532, 223)
  • Efficient memoization of navItemData object to prevent unnecessary NavItem re-renders (line 457)
  • Collapsible animations use CSS height transitions instead of JS animations for better performance

2. Robust Dark Mode Implementation

  • Comprehensive dark mode support using conditional classes (dark:text-blue-400, dark:bg-blue-500/20)
  • Proper color contrast maintained across light/dark modes
  • Theme-aware colors like text-foreground, bg-background, border-border
  • Blue accent system (blue-500/10, blue-500/40) works well in both modes

3. Modern UI/UX Patterns

  • Smooth collapsible sections with height animations and rotation transforms
  • Visual hierarchy with sub-item dots and proper spacing
  • Consistent hover states and active state highlighting
  • Responsive design with mobile sheet overlay

4. Well-Structured Component Architecture

  • Clean separation of concerns (NavItem, NavSubItem, SidebarContent, HeaderBreadcrumb)
  • Flexible navigation system supporting both direct items and nested sections
  • Proper TypeScript types for all components and data structures

⚠️ Issues Found

1. Critical: DESIGN_GUIDE.md Dark Mode Inconsistencies

The design guide contains examples that contradict its own dark mode guidance:

Lines 228-237 and 544-562: Code examples use hardcoded colors without dark mode variants:

// ❌ Inconsistent with guide's own rules
<Typography className="text-blue-700">Label</Typography>
<Typography className="text-2xl font-semibold text-blue-900">Heading</Typography>

// ✅ Should be (following the guide's own guidance)
<Typography className="text-blue-700 dark:text-blue-400">Label</Typography>
<Typography className="text-2xl font-semibold text-blue-900 dark:text-blue-300">Heading</Typography>

This is problematic because developers will copy these examples, leading to inconsistent dark mode implementation across the dashboard.

2. Minor: Missing Error Boundaries

Complex sidebar navigation with async breadcrumb resolution could benefit from error boundaries around the breadcrumb resolution logic (lines 518-529).

3. Minor: Accessibility Considerations

  • Mobile sheet lacks proper aria-describedby (line 621 - intentionally undefined, but consider adding description)
  • Could benefit from aria-label on navigation sections for screen readers

🔧 Security Assessment

✅ No security concerns found:

  • No direct user input handling or XSS vulnerabilities
  • URL construction uses proper URL APIs with DUMMY_ORIGIN constant
  • No sensitive data exposure in client-side code
  • Proper authentication checks with useUser hook

📊 Performance Analysis

✅ Excellent performance optimizations:

  • Memoization prevents unnecessary re-renders
  • Efficient state management with Set for expanded sections
  • CSS-based animations instead of JS-based for better performance
  • Proper dependency arrays in hooks

Potential improvements:

  • Consider virtual scrolling for projects with many enabled apps (minor)
  • Breadcrumb resolution could be debounced for rapid navigation (minor)

🧪 Test Coverage Recommendations

No test files were included in this PR. Consider adding:

  • Unit tests for navigation matching logic (testAppPath, testItemPath)
  • Tests for breadcrumb resolution edge cases
  • Accessibility tests for keyboard navigation
  • Dark mode switching tests

🎯 Code Quality Rating: 4.5/5

The sidebar implementation demonstrates excellent engineering practices with proper performance optimizations, comprehensive dark mode support, and clean architecture. The only significant issue is the inconsistent examples in the design guide.

📋 Recommended Actions

  1. Fix DESIGN_GUIDE.md examples to include proper dark mode variants (critical)
  2. Consider adding error boundaries for breadcrumb resolution (minor)
  3. Add unit tests for navigation logic (recommended)
  4. Consider accessibility improvements for screen readers (minor)

The sidebar code itself is production-ready and well-implemented. The design guide needs the dark mode examples fixed to prevent future inconsistencies.

Note: Unable to run lint/typecheck due to missing pnpm in CI environment, but code follows TypeScript best practices and appears well-structured.


Copy link
Contributor

@N2D4 N2D4 left a comment

Choose a reason for hiding this comment

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

feedback as discussed but i'm happy to merge this in already to minimize merge conflicts & stuff!

Copy link
Contributor

@N2D4 N2D4 left a comment

Choose a reason for hiding this comment

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

as discussed there are changes we should do for the final version but in the interest of getting shit done happy to already merge this now!

@Developing-Gamer Developing-Gamer merged commit 75d64cc into dashboard-redesign Nov 18, 2025
28 of 31 checks passed
@Developing-Gamer Developing-Gamer deleted the sidebar-redesign branch November 18, 2025 15:51
@coderabbitai coderabbitai bot mentioned this pull request Nov 23, 2025
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.

2 participants