Skip to content

Mobile fixes for stats page#1043

Merged
elie222 merged 4 commits intoelie222:mainfrom
jshwrnr:feat/charts-redesign
Dec 1, 2025
Merged

Mobile fixes for stats page#1043
elie222 merged 4 commits intoelie222:mainfrom
jshwrnr:feat/charts-redesign

Conversation

@jshwrnr
Copy link
Collaborator

@jshwrnr jshwrnr commented Dec 1, 2025

Improve mobile layout on stats page by updating BarListCard and MainStatChart to prevent horizontal overflow and adjust paddings and grids

Refactors stats page UI for small screens by tightening paddings and gaps, applying overflow constraints, and switching the stat selector to a 2‑column grid. Updates classNames in BarListCard and MainStatChart; also bumps the marketing submodule reference.

📍Where to Start

Start with layout changes in BarListCard.tsx, then review the header/grid updates in MainStatChart.tsx.


Macroscope summarized 5cc9b48.

Summary by CodeRabbit

  • Style
    • Improved responsive layout on stats pages with better spacing and alignment
    • Enhanced horizontal overflow handling for improved mobile viewing
    • Refined chart component styling and padding adjustments

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

@vercel
Copy link

vercel bot commented Dec 1, 2025

@jshwrnr is attempting to deploy a commit to the Inbox Zero OSS Program Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Dec 1, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

Updates layout and styling for two dashboard statistics components (BarListCard and MainStatChart) with responsive padding, container restructuring, and grid-based header refactoring. Additionally updates the marketing submodule reference pointer.

Changes

Cohort / File(s) Summary
Stats component layout updates
apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx, apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
BarListCard: Restructured layout with improved horizontal overflow handling, responsive padding on Card components, and full-width wrapper for chart content. MainStatChart: Replaced vertical flex layout with grid-based header, updated padding values across Container and CardContent, added cn utility import.
Submodule reference
apps/web/app/(marketing)
Updated submodule commit pointer from 5adac62 to e3c81eb.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

  • Verify responsive design behavior across breakpoints (sm, etc.) in both components
  • Confirm the unused cn import in MainStatChart is intentional or should be removed
  • Check that overflow handling and layout changes don't introduce visual regressions or misalignment in the UI

Possibly related PRs

  • #732: Updates the same apps/web/app/(marketing) submodule pointer, indicating related maintenance work on shared dependencies.

Poem

🐰 With grid and flex, our layout grows,
Padding flows where content goes,
Charts now dance with better flow,
Responsive grace from high to low!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Mobile fixes for stats page' directly aligns with the main changes, which focus on responsive layout improvements and styling adjustments in stats page components (BarListCard and MainStatChart).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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: 0

🧹 Nitpick comments (5)
apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx (3)

35-35: Simplify redundant width classes.

The combination of w-full and max-w-full is redundant since w-full already sets width: 100%. Additionally, overflow-x-hidden is applied at multiple levels (Card, CardHeader, CardContent) which may be unnecessary.

Consider simplifying:

-    <Card className="h-full bg-background relative overflow-x-hidden w-full max-w-full">
+    <Card className="h-full bg-background relative overflow-x-hidden w-full">

53-53: Simplify redundant overflow classes.

Using both overflow-hidden and overflow-x-hidden is redundant since overflow-hidden applies to both axes.

Apply this change:

-      <CardContent className="pt-5 pb-0 px-3 sm:px-5 overflow-hidden overflow-x-hidden h-[330px] max-w-full w-full">
+      <CardContent className="pt-5 pb-0 px-3 sm:px-5 overflow-hidden h-[330px] w-full">

73-75: Remove redundant width constraint.

Similar to line 35, combining w-full with max-w-full is redundant.

-            <div className="w-full min-w-0 max-w-full overflow-x-hidden">
+            <div className="w-full min-w-0 overflow-x-hidden">
apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx (2)

10-10: Remove unused import.

The cn utility is imported but not used anywhere in this file.

-import { cn } from "@/utils";

67-92: Consider documenting the complex border logic.

The responsive grid-to-flex transition works well, but the border styling on line 76 uses complex nth-child selectors that create a 2×2 grid on mobile and a 1×4 row on desktop. While functionally correct, this would benefit from a brief comment explaining the intended visual structure.

Consider adding a comment above the button element:

+          {/* 2x2 grid on mobile with borders between cells, 1x4 row on desktop with left borders */}
           <button
             type="button"
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae8bd75 and 5cc9b48.

📒 Files selected for processing (3)
  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx (2 hunks)
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx (2 hunks)
  • apps/web/app/(marketing) (1 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
!(pages/_document).{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

Don't use the next/head module in pages/_document.js on Next.js projects

Files:

  • apps/web/app/(marketing)
  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
apps/web/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Use @/ path aliases for imports from project root
Use proper error handling with try/catch blocks
Format code with Prettier
Follow consistent naming conventions using PascalCase for components
Centralize shared types in dedicated type files

Import specific lodash functions rather than entire lodash library to minimize bundle size (e.g., import groupBy from 'lodash/groupBy')

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
apps/web/app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

Follow NextJS app router structure with (app) directory

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
apps/web/**/*.tsx

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

apps/web/**/*.tsx: Follow tailwindcss patterns with prettier-plugin-tailwindcss for class sorting
Prefer functional components with hooks over class components
Use shadcn/ui components when available
Ensure responsive design with mobile-first approach
Use LoadingContent component for async data with loading and error states

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)

**/*.{ts,tsx}: For API GET requests to server, use the swr package
Use result?.serverError with toastError from @/components/Toast for error handling in async operations

**/*.{ts,tsx}: Use wrapper functions for Gmail message operations (get, list, batch, etc.) from @/utils/gmail/message.ts instead of direct API calls
Use wrapper functions for Gmail thread operations from @/utils/gmail/thread.ts instead of direct API calls
Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls

**/*.{ts,tsx}: For early access feature flags, create hooks using the naming convention use[FeatureName]Enabled that return a boolean from useFeatureFlagEnabled("flag-key")
For A/B test variant flags, create hooks using the naming convention use[FeatureName]Variant that define variant types, use useFeatureFlagVariantKey() with type casting, and provide a default "control" fallback
Use kebab-case for PostHog feature flag keys (e.g., inbox-cleaner, pricing-options-2)
Always define types for A/B test variant flags (e.g., type PricingVariant = "control" | "variant-a" | "variant-b") and provide type safety through type casting

**/*.{ts,tsx}: Don't use primitive type aliases or misleading types
Don't use empty type parameters in type aliases and interfaces
Don't use this and super in static contexts
Don't use any or unknown as type constraints
Don't use the TypeScript directive @ts-ignore
Don't use TypeScript enums
Don't export imported variables
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions
Don't use TypeScript namespaces
Don't use non-null assertions with the ! postfix operator
Don't use parameter properties in class constructors
Don't use user-defined types
Use as const instead of literal types and type annotations
Use either T[] or Array<T> consistently
Initialize each enum member value explicitly
Use export type for types
Use `impo...

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
apps/web/app/(app)/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)

apps/web/app/(app)/**/*.{ts,tsx}: Components for the page are either put in page.tsx, or in the apps/web/app/(app)/PAGE_NAME folder
If we're in a deeply nested component we will use swr to fetch via API
If you need to use onClick in a component, that component is a client component and file must start with use client

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)

Always import Prisma enums from @/generated/prisma/enums instead of @/generated/prisma/client to avoid Next.js bundling errors in client components

Import Prisma using the project's centralized utility: import prisma from '@/utils/prisma'

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

**/*.{tsx,ts}: Use Shadcn UI and Tailwind for components and styling
Use next/image package for images
For API GET requests to server, use the swr package with hooks like useSWR to fetch data
For text inputs, use the Input component with registerProps for form integration and error handling

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
**/*.{tsx,ts,css}

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

Implement responsive design with Tailwind CSS using a mobile-first approach

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

**/*.tsx: Use the LoadingContent component to handle loading states instead of manual loading state management
For text areas, use the Input component with type='text', autosizeTextarea prop set to true, and registerProps for form integration

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{js,jsx,ts,tsx}: Don't use accessKey attribute on any HTML element
Don't set aria-hidden="true" on focusable elements
Don't add ARIA roles, states, and properties to elements that don't support them
Don't use distracting elements like <marquee> or <blink>
Only use the scope prop on <th> elements
Don't assign non-interactive ARIA roles to interactive HTML elements
Make sure label elements have text content and are associated with an input
Don't assign interactive ARIA roles to non-interactive HTML elements
Don't assign tabIndex to non-interactive HTML elements
Don't use positive integers for tabIndex property
Don't include "image", "picture", or "photo" in img alt prop
Don't use explicit role property that's the same as the implicit/default role
Make static elements with click handlers use a valid role attribute
Always include a title element for SVG elements
Give all elements requiring alt text meaningful information for screen readers
Make sure anchors have content that's accessible to screen readers
Assign tabIndex to non-interactive HTML elements with aria-activedescendant
Include all required ARIA attributes for elements with ARIA roles
Make sure ARIA properties are valid for the element's supported roles
Always include a type attribute for button elements
Make elements with interactive roles and handlers focusable
Give heading elements content that's accessible to screen readers (not hidden with aria-hidden)
Always include a lang attribute on the html element
Always include a title attribute for iframe elements
Accompany onClick with at least one of: onKeyUp, onKeyDown, or onKeyPress
Accompany onMouseOver/onMouseOut with onFocus/onBlur
Include caption tracks for audio and video elements
Use semantic elements instead of role attributes in JSX
Make sure all anchors are valid and navigable
Ensure all ARIA properties (aria-*) are valid
Use valid, non-abstract ARIA roles for elements with ARIA roles
Use valid AR...

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{jsx,tsx}: Don't use unnecessary fragments
Don't pass children as props
Don't use the return value of React.render
Make sure all dependencies are correctly specified in React hooks
Make sure all React hooks are called from the top level of component functions
Don't forget key props in iterators and collection literals
Don't define React components inside other components
Don't use event handlers on non-interactive elements
Don't assign to React component props
Don't use both children and dangerouslySetInnerHTML props on the same element
Don't use dangerous JSX props
Don't use Array index in keys
Don't insert comments as text nodes
Don't assign JSX properties multiple times
Don't add extra closing tags for components without children
Use <>...</> instead of <Fragment>...</Fragment>
Watch out for possible "wrong" semicolons inside JSX elements
Make sure void (self-closing) elements don't have children
Don't use target="_blank" without rel="noopener"
Don't use <img> elements in Next.js projects
Don't use <head> elements in Next.js projects

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts,jsx,tsx}: Use lodash utilities for common operations (arrays, objects, strings)
Import specific lodash functions to minimize bundle size (e.g., import groupBy from 'lodash/groupBy')

Files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
🧠 Learnings (2)
📚 Learning: 2025-11-25T14:36:18.416Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-11-25T14:36:18.416Z
Learning: Applies to apps/web/**/*.tsx : Ensure responsive design with mobile-first approach

Applied to files:

  • apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx
📚 Learning: 2025-11-25T14:38:56.992Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-25T14:38:56.992Z
Learning: Applies to apps/web/components/ui/**/*.tsx : Shadcn UI components are located in `components/ui` directory

Applied to files:

  • apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx
🧬 Code graph analysis (2)
apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx (3)
apps/web/components/new-landing/common/Card.tsx (3)
  • Card (67-105)
  • CardHeader (22-54)
  • CardContent (10-12)
apps/web/components/TabSelect.tsx (1)
  • TabSelect (44-103)
apps/web/components/charts/HorizontalBarChart.tsx (1)
  • HorizontalBarChart (16-74)
apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx (1)
apps/web/components/new-landing/common/Card.tsx (2)
  • Card (67-105)
  • CardContent (10-12)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: test
  • GitHub Check: Review for correctness
🔇 Additional comments (5)
apps/web/app/(marketing) (1)

1-1: Remove verification request—this is a submodule reference update, not actionable code review.

This change only updates the commit pointer for the marketing submodule and does not introduce code that violates any review guidelines. The provided coding guideline regarding next/head module usage applies to pages/_document.{jsx,tsx} files, which is not relevant to submodule reference updates. Without actual code contents shown in the diff, no specific review findings can be made. Remove the verification request unless concrete code issues are identified in the submodule commit.

Likely an incorrect or invalid review comment.

apps/web/app/(app)/[emailAccountId]/stats/BarListCard.tsx (2)

36-52: LGTM! Responsive header layout is well-structured.

The header restructuring with flexible containers and responsive padding follows mobile-first best practices. The min-w-0 on the TabSelect container prevents flex overflow issues, and whitespace-nowrap on the title prevents unwanted line breaks.


76-99: LGTM! Dialog positioning and padding alignment.

The absolute positioning with responsive padding ensures the "View more" button aligns properly with the card content on all screen sizes. The z-index layering is appropriate for the overlay effect.

apps/web/app/(app)/[emailAccountId]/stats/MainStatChart.tsx (2)

72-89: LGTM! Button implementation follows best practices.

The buttons are properly typed, include accessible labels with visual color indicators, and implement responsive font sizing. The data-active attribute pattern for state styling is clean and maintainable.


93-100: LGTM! Chart container padding adjusted for layout.

The padding changes (pl-0 and sm:px-2) appear intentional to give the chart more horizontal space while maintaining consistent spacing. This aligns with the overall mobile optimization goals of this PR.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@vercel
Copy link

vercel bot commented Dec 1, 2025

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

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Dec 1, 2025 7:14pm

@elie222 elie222 merged commit 78a0443 into elie222:main Dec 1, 2025
11 of 12 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 10, 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.

3 participants