Skip to content

Use common page structure for the main pages#695

Merged
elie222 merged 5 commits intomainfrom
feat/common-page-structure
Aug 19, 2025
Merged

Use common page structure for the main pages#695
elie222 merged 5 commits intomainfrom
feat/common-page-structure

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Aug 19, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a reusable PageWrapper for consistent page layouts.
  • Refactor

    • Redesigned Bulk Unsubscribe flow: consolidated header (date-range selector, actions, load controls), responsive behavior, and clearer bulk actions when items are selected.
    • Reflowed Automation and Analytics pages to use unified page-heading layout.
  • Style

    • Adjusted spacing and padding across pages for tighter, more consistent spacing.
  • Chores

    • App version bumped to v2.5.26.

@vercel
Copy link

vercel bot commented Aug 19, 2025

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

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Aug 19, 2025 9:09am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 19, 2025

Warning

Rate limit exceeded

@elie222 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 66e7fc4 and b97731d.

📒 Files selected for processing (8)
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx (2 hunks)
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx (4 hunks)
  • apps/web/app/(app)/[emailAccountId]/stats/EmailActionsAnalytics.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/stats/EmailAnalytics.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx (4 hunks)
  • apps/web/components/PageWrapper.tsx (1 hunks)
  • apps/web/components/Typography.tsx (1 hunks)
  • version.txt (1 hunks)

Walkthrough

Adds a reusable PageWrapper component and migrates multiple pages to use it; refactors the Bulk Unsubscribe feature by removing the old page component, renaming and consolidating state into a single BulkUnsubscribe component, and adjusts several layout/spacings across stats and analytics UI files.

Changes

Cohort / File(s) Summary
Bulk Unsubscribe refactor & consolidation
apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribe.tsx (deleted), apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsxBulkUnsubscribe, apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx, apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
Removed old page-level BulkUnsubscribe component; renamed/refactored BulkUnsubscribeSection into an internal-state BulkUnsubscribe() (derives isMobile, dateRange, stat loading/refresh). Updated page import to new module and added a small top-margin spacing tweak in BulkActions.
Page layout migration to PageWrapper
apps/web/app/(app)/[emailAccountId]/automation/page.tsx, apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx, apps/web/app/(app)/[emailAccountId]/stats/EmailAnalytics.tsx, apps/web/app/(app)/[emailAccountId]/stats/EmailActionsAnalytics.tsx, apps/web/components/Typography.tsx
Introduced PageWrapper usage replacing legacy container/TopBar wrappers; adjusted header composition (PageHeading, action rows), reordered Suspense/Tabs in automation, tweaked grid/gap/padding classes and a responsive heading breakpoint. Minor DOM structure simplifications in analytics components.
New shared layout component
apps/web/components/PageWrapper.tsx
Added presentational PageWrapper export (mx-auto max-w-screen-xl w-full px-2 md:px-4 2xl:px-0 mb-12 md:mb-4) with optional className via cn.
Version bump
version.txt
Updated version from v2.5.25 to v2.5.26.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Page as BulkUnsubscribe (new)
  participant Loader as useStatLoader
  participant API as Stats API
  participant UI as Subcomponents

  User->>Page: Open Bulk Unsubscribe page
  activate Page
  Page->>Page: init presets, compute isMobile, set dateRange
  Page->>Loader: onLoad({loadBefore:false, showToast:false})
  activate Loader
  Loader->>API: fetch stats
  API-->>Loader: return data / loading state
  Loader-->>Page: loading=true -> refreshInterval=5000
  Page->>UI: render PageHeading, ActionBar, LoadStatsButton, filters
  API-->>Loader: data loaded
  Loader-->>Page: loading=false -> refreshInterval≈1e6
  Page->>UI: render rows, ArchiveProgress, modals
  deactivate Loader
  deactivate Page
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

I nibble wrappers, tidy the rows,
Headings sit neat where the big screen glows.
Tabs wait in calm beyond Suspense's gate,
Dates and stats now settle their fate.
A hop, a tweak — ship it, celebrate! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/common-page-structure

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
🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@claude
Copy link

claude bot commented Aug 19, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx (1)

1-1: Add "use client" directive; this component uses hooks and onClick

This file defines a client component (hooks, confirm, onClick). In Next.js app router, files with client-side interactivity must start with the "use client" directive under apps/web/app/**/*.tsx per guidelines. Without it, this will throw/hydration fail.

Apply this diff at the top of the file:

+ "use client";
+
 import { usePostHog } from "posthog-js/react";
apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx (2)

326-334: Fix unsafe optional chaining that can throw at runtime

data?.newsletters.length will throw when data is undefined because .length is accessed on the result of data?.newsletters without chaining. Use optional chaining on newsletters as well.

Apply this diff:

-        {isStatsLoading && !isLoading && !data?.newsletters.length ? (
+        {isStatsLoading && !isLoading && !data?.newsletters?.length ? (

168-171: Guard against division by zero when deriving percentages

If item.value is 0, these computations produce NaN and can cause rendering/sorting glitches.

Apply this diff:

-    const readPercentage = (item.readEmails / item.value) * 100;
-    const archivedEmails = item.value - item.inboxEmails;
-    const archivedPercentage = (archivedEmails / item.value) * 100;
+    const total = item.value || 0;
+    const readPercentage = total > 0 ? (item.readEmails / total) * 100 : 0;
+    const archivedEmails = Math.max(0, item.value - item.inboxEmails);
+    const archivedPercentage = total > 0 ? (archivedEmails / total) * 100 : 0;
🧹 Nitpick comments (7)
apps/web/components/PageWrapper.tsx (1)

3-9: Forward HTML div props for flexibility

Allow passing id, data-*, role, style, etc., without widening types everywhere. Keeps it ergonomic and future-proof.

-import { cn } from "@/utils";
+import { cn } from "@/utils";
+import type { HTMLAttributes, PropsWithChildren } from "react";
 
-export function PageWrapper({
-  children,
-  className,
-}: {
-  children: React.ReactNode;
-  className?: string;
-}) {
+export function PageWrapper({
+  children,
+  className,
+  ...props
+}: PropsWithChildren<HTMLAttributes<HTMLDivElement>>) {
   return (
-    <div className={cn("mx-auto max-w-screen-xl w-full", className)}>
+    <div
+      className={cn("mx-auto max-w-screen-xl w-full", className)}
+      {...props}
+    >
       {children}
     </div>
   );
 }
apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx (1)

70-85: Consider mobile-first header stacking

Right now the header row is locked to a single line with justify-between. For small screens, stacking the title above actions improves readability.

-      <div className="flex items-center justify-between">
+      <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
         {isLoading ? <LoadProgress /> : <div />}
         <div className="flex flex-wrap gap-1">
           <ActionBar
             selectOptions={selectOptions}
             dateDropdown={dateDropdown}
             setDateDropdown={onSetDateDropdown}
             dateRange={dateRange}
             setDateRange={setDateRange}
             period={period}
             setPeriod={setPeriod}
             isMobile={false}
           />
           <LoadStatsButton />
         </div>
       </div>
apps/web/app/(app)/[emailAccountId]/automation/page.tsx (2)

91-93: Minor: redundant w-full wrapper

PageWrapper already applies w-full; the inner

is likely redundant.

-          <div className="w-full">
+          <div>

94-98: Responsive header tweak (optional)

As with Stats, consider stacking on small screens for better readability.

-            <div className="flex items-center justify-between">
+            <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
               <PageHeading>Assistant</PageHeading>
               <ExtraActions />
             </div>
apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx (3)

79-84: Initialize dateRange lazily; drop the extra useMemo

Minor cleanup: compute now inside the useState initializer to avoid an extra useMemo and ensure the initial value is created once.

Apply this diff:

-  const now = useMemo(() => new Date(), []);
-  const [dateRange, setDateRange] = useState<DateRange | undefined>({
-    from: subDays(now, Number.parseInt(defaultSelected.value)),
-    to: now,
-  });
+  const [dateRange, setDateRange] = useState<DateRange | undefined>(() => {
+    const now = new Date();
+    return {
+      from: subDays(now, Number.parseInt(defaultSelected.value)),
+      to: now,
+    };
+  });

85-90: Avoid duplicating useStatLoader calls

You call useStatLoader() again later to get isStatsLoading (Line 144). Prefer a single call and reuse the values to reduce redundant context subscriptions.

You can keep this block as-is and then replace the later call:

// Later (around line 144), replace:
const { isLoading: isStatsLoading } = useStatLoader();

// With:
const isStatsLoading = isStatsLoaderLoading;

195-201: Provide a deterministic default sort for 'emails' and carry the total

When sortColumn === "emails", the iteratee returns undefined, leading to no-op client-side sorting. If the API ever returns items unsorted, this becomes inconsistent. Include value in the row metadata and sort by it as a fallback.

Apply this diff:

-    return { row, readPercentage, archivedEmails, archivedPercentage };
+    return {
+      row,
+      readPercentage,
+      archivedEmails,
+      archivedPercentage,
+      value: item.value,
+    };

And:

-  const tableRows = sortBy(unsortedTableRows, (row) => {
-    if (sortColumn === "unread") return row.readPercentage;
-    if (sortColumn === "unarchived") return row.archivedPercentage;
-  });
+  const tableRows = sortBy(unsortedTableRows, (row) => {
+    if (sortColumn === "unread") return row.readPercentage;       // asc
+    if (sortColumn === "unarchived") return row.archivedPercentage; // asc
+    return -row.value; // default: emails desc
+  });
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c94ad01 and 66e7fc4.

📒 Files selected for processing (7)
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx (2 hunks)
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribe.tsx (0 hunks)
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx (4 hunks)
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx (4 hunks)
  • apps/web/components/PageWrapper.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribe.tsx
🧰 Additional context used
📓 Path-based instructions (15)
apps/web/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (apps/web/CLAUDE.md)

apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Path aliases: Use @/ for imports from project root
Use proper error handling with try/catch blocks
Format code with Prettier
Leverage TypeScript inference for better DX

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
apps/web/app/**

📄 CodeRabbit Inference Engine (apps/web/CLAUDE.md)

NextJS app router structure with (app) directory

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
apps/web/**/*.tsx

📄 CodeRabbit Inference Engine (apps/web/CLAUDE.md)

apps/web/**/*.tsx: Follow tailwindcss patterns with prettier-plugin-tailwindcss
Prefer functional components with hooks
Use shadcn/ui components when available
Ensure responsive design with mobile-first approach
Follow consistent naming conventions (PascalCase for components)
Use LoadingContent component for async data
Use result?.serverError with toastError and toastSuccess
Use LoadingContent component to handle loading and error states consistently
Pass loading, error, and children props to LoadingContent

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
!{.cursor/rules/*.mdc}

📄 CodeRabbit Inference Engine (.cursor/rules/cursor-rules.mdc)

Never place rule files in the project root, in subdirectories outside .cursor/rules, or in any other location

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
**/*.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/form-handling.mdc)

**/*.tsx: Use React Hook Form with Zod for validation
Validate form inputs before submission
Show validation errors inline next to form fields

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/logging.mdc)

**/*.{ts,tsx}: Use createScopedLogger for logging in backend TypeScript files
Typically add the logger initialization at the top of the file when using createScopedLogger
Only use .with() on a logger instance within a specific function, not for a global logger

Import Prisma in the project using import prisma from "@/utils/prisma";

**/*.{ts,tsx}: Don't use TypeScript enums.
Don't use TypeScript const enum.
Don't use the TypeScript directive @ts-ignore.
Don't use primitive type aliases or misleading types.
Don't use empty type parameters in type aliases and interfaces.
Don't use any or unknown as type constraints.
Don't use implicit any type on variable declarations.
Don't let variables evolve into any type through reassignments.
Don't use non-null assertions with the ! postfix operator.
Don't misuse the non-null assertion operator (!) in TypeScript files.
Don't use user-defined types.
Use as const instead of literal types and type annotations.
Use export type for types.
Use import type for types.
Don't declare empty interfaces.
Don't merge interfaces and classes unsafely.
Don't use overload signatures that aren't next to each other.
Use the namespace keyword instead of the module keyword to declare TypeScript namespaces.
Don't use TypeScript namespaces.
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 parameter properties in class constructors.
Use either T[] or Array consistently.
Initialize each enum member value explicitly.
Make sure all enum members are literal values.

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
apps/web/app/(app)/*/**

📄 CodeRabbit Inference Engine (.cursor/rules/page-structure.mdc)

Components for the page are either put in page.tsx, or in the apps/web/app/(app)/PAGE_NAME folder

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
apps/web/app/(app)/*/**/*.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/page-structure.mdc)

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]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
apps/web/app/(app)/*/**/**/*.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/page-structure.mdc)

If we're in a deeply nested component we will use swr to fetch via API

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
apps/web/app/**/*.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)

Components with onClick must be client components with use client directive

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/ultracite.mdc)

**/*.{js,jsx,ts,tsx}: Don't use elements in Next.js projects.
Don't use elements in Next.js projects.
Don't use namespace imports.
Don't access namespace imports dynamically.
Don't use global eval().
Don't use console.
Don't use debugger.
Don't use var.
Don't use with statements in non-strict contexts.
Don't use the arguments object.
Don't use consecutive spaces in regular expression literals.
Don't use the comma operator.
Don't use unnecessary boolean casts.
Don't use unnecessary callbacks with flatMap.
Use for...of statements instead of Array.forEach.
Don't create classes that only have static members (like a static namespace).
Don't use this and super in static contexts.
Don't use unnecessary catch clauses.
Don't use unnecessary constructors.
Don't use unnecessary continue statements.
Don't export empty modules that don't change anything.
Don't use unnecessary escape sequences in regular expression literals.
Don't use unnecessary labels.
Don't use unnecessary nested block statements.
Don't rename imports, exports, and destructured assignments to the same name.
Don't use unnecessary string or template literal concatenation.
Don't use String.raw in template literals when there are no escape sequences.
Don't use useless case statements in switch statements.
Don't use ternary operators when simpler alternatives exist.
Don't use useless this aliasing.
Don't initialize variables to undefined.
Don't use the void operators (they're not familiar).
Use arrow functions instead of function expressions.
Use Date.now() to get milliseconds since the Unix Epoch.
Use .flatMap() instead of map().flat() when possible.
Use literal property access instead of computed property access.
Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.
Use concise optional chaining instead of chained logical expressions.
Use regular expression literals instead of the RegExp constructor when possible.
Don't use number literal object member names th...

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
!pages/_document.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/ultracite.mdc)

!pages/_document.{js,jsx,ts,tsx}: Don't import next/document outside of pages/_document.jsx in Next.js projects.
Don't import next/document outside of pages/_document.jsx in Next.js projects.

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
**/*.{jsx,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/ultracite.mdc)

**/*.{jsx,tsx}: Don't destructure props inside JSX components in Solid projects.
Don't use both children and dangerouslySetInnerHTML props on the same element.
Don't use Array index in keys.
Don't assign to React component props.
Don't define React components inside other components.
Don't use event handlers on non-interactive elements.
Don't assign JSX properties multiple times.
Don't add extra closing tags for components without children.
Use <>...</> instead of ....
Don't insert comments as text nodes.
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 use unnecessary fragments.
Don't pass children as props.
Use semantic elements instead of role attributes in JSX.

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
**/*.{html,jsx,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/ultracite.mdc)

**/*.{html,jsx,tsx}: Don't use or elements.
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.
Only use the scope prop on 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.
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 ARIA state and property values.
Use valid values for the autocomplete attribute on input eleme...

Files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx
  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
apps/web/components/**/*.tsx

📄 CodeRabbit Inference Engine (apps/web/CLAUDE.md)

Use React Hook Form with Zod validation for form handling

Use the LoadingContent component to handle loading and error states consistently in data-fetching components.

Use PascalCase for components (e.g. components/Button.tsx)

Files:

  • apps/web/components/PageWrapper.tsx
🧠 Learnings (7)
📚 Learning: 2025-07-20T09:00:16.505Z
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-20T09:00:16.505Z
Learning: Applies to apps/web/app/(app)/*/page.tsx : Create new pages at: `apps/web/app/(app)/PAGE_NAME/page.tsx`

Applied to files:

  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
📚 Learning: 2025-07-20T09:00:16.505Z
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-20T09:00:16.505Z
Learning: Applies to apps/web/app/(app)/*/ : Components for the page are either in `page.tsx` or in the `apps/web/app/(app)/PAGE_NAME` folder

Applied to files:

  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
📚 Learning: 2025-07-18T15:07:00.269Z
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/page-structure.mdc:0-0
Timestamp: 2025-07-18T15:07:00.269Z
Learning: Applies to apps/web/app/(app)/*/** : Components for the page are either put in page.tsx, or in the apps/web/app/(app)/PAGE_NAME folder

Applied to files:

  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
📚 Learning: 2025-07-18T15:07:00.269Z
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/page-structure.mdc:0-0
Timestamp: 2025-07-18T15:07:00.269Z
Learning: Applies to apps/web/app/(app)/*/page.tsx : Create new pages at: apps/web/app/(app)/PAGE_NAME/page.tsx

Applied to files:

  • apps/web/components/PageWrapper.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
📚 Learning: 2025-07-18T15:05:16.146Z
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/fullstack-workflow.mdc:0-0
Timestamp: 2025-07-18T15:05:16.146Z
Learning: Applies to apps/web/hooks/**/*.ts : Use SWR for client-side data fetching and caching.

Applied to files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
📚 Learning: 2025-07-18T15:04:30.467Z
Learnt from: CR
PR: elie222/inbox-zero#0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-07-18T15:04:30.467Z
Learning: Applies to apps/web/hooks/**/*.ts : Use SWR for efficient data fetching and caching

Applied to files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
📚 Learning: 2025-07-18T15:05:41.705Z
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/hooks.mdc:0-0
Timestamp: 2025-07-18T15:05:41.705Z
Learning: Applies to apps/web/hooks/use*.{js,jsx,ts,tsx} : For fetching data from API endpoints in custom hooks, prefer using `useSWR`.

Applied to files:

  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
🧬 Code Graph Analysis (4)
apps/web/components/PageWrapper.tsx (1)
apps/web/utils/index.ts (1)
  • cn (4-6)
apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx (6)
apps/web/components/PageWrapper.tsx (1)
  • PageWrapper (3-15)
apps/web/components/Typography.tsx (1)
  • PageHeading (110-110)
apps/web/app/(app)/[emailAccountId]/stats/StatsSummary.tsx (1)
  • StatsSummary (21-79)
apps/web/app/(app)/[emailAccountId]/stats/EmailAnalytics.tsx (1)
  • EmailAnalytics (15-112)
apps/web/app/(app)/[emailAccountId]/stats/DetailedStats.tsx (1)
  • DetailedStats (18-165)
apps/web/app/(app)/[emailAccountId]/stats/EmailActionsAnalytics.tsx (1)
  • EmailActionsAnalytics (10-43)
apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx (9)
apps/web/app/api/user/stats/newsletters/route.ts (1)
  • NewsletterStatsResponse (36-38)
apps/web/providers/StatLoaderProvider.tsx (1)
  • useStatLoader (35-35)
apps/web/components/PageWrapper.tsx (1)
  • PageWrapper (3-15)
apps/web/components/Typography.tsx (1)
  • PageHeading (110-110)
apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/ShortcutTooltip.tsx (1)
  • ShortcutTooltip (7-26)
apps/web/app/(app)/[emailAccountId]/stats/ActionBar.tsx (1)
  • ActionBar (7-83)
apps/web/components/ClientOnly.tsx (1)
  • ClientOnly (5-13)
apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/ArchiveProgress.tsx (1)
  • ArchiveProgress (7-33)
apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx (1)
  • BulkActions (20-137)
apps/web/app/(app)/[emailAccountId]/automation/page.tsx (6)
apps/web/components/PageWrapper.tsx (1)
  • PageWrapper (3-15)
apps/web/components/PremiumAlert.tsx (1)
  • PremiumAlertWithData (91-110)
apps/web/components/TabSelect.tsx (1)
  • TabSelect (44-100)
apps/web/app/(app)/[emailAccountId]/assistant/RulesTab.tsx (1)
  • RulesTab (5-24)
apps/web/app/(app)/[emailAccountId]/assistant/Process.tsx (1)
  • Process (8-36)
apps/web/app/(app)/[emailAccountId]/assistant/History.tsx (1)
  • History (27-59)
⏰ 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). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (7)
apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkActions.tsx (1)

71-71: Spacing tweak LGTM

Adding mt-2 makes sense to create breathing room between tooltip and action buttons.

apps/web/components/PageWrapper.tsx (1)

10-15: LGTM: Simple, reusable wrapper

Clean presentational component, appropriate class merging with cn, and sensible max width.

apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/page.tsx (1)

2-2: Import path update LGTM

Importing BulkUnsubscribe from the renamed section component aligns with the refactor. No issues spotted.

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

68-70: Adopting PageWrapper + PageHeading looks good

Nice move to standardized layout; consistent with the new page structure.


101-112: Nit: consistent vertical rhythm

The switch to mt-4 blocks reads well; the Card and analytics sections have consistent spacing. No action needed.

apps/web/app/(app)/[emailAccountId]/automation/page.tsx (1)

90-107: Header restructure LGTM

Wrapping with PageWrapper and using PageHeading/ExtraActions simplifies layout and matches the common structure.

apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx (1)

210-215: Good adoption of the new common page structure and action header

Nice use of PageWrapper, PageHeading, ActionBar, and LoadStatsButton. This aligns with the new layout patterns and improves consistency across pages.

Also applies to: 304-314

@claude
Copy link

claude bot commented Aug 19, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@claude
Copy link

claude bot commented Aug 19, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@claude
Copy link

claude bot commented Aug 19, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@elie222 elie222 merged commit 1a4179c into main Aug 19, 2025
6 of 8 checks passed
@claude
Copy link

claude bot commented Aug 19, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

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.

1 participant

Comments