Skip to content

Comments

Load all outlook folders#1033

Merged
elie222 merged 2 commits intomainfrom
fix/load-all-outlook-folders
Nov 28, 2025
Merged

Load all outlook folders#1033
elie222 merged 2 commits intomainfrom
fix/load-all-outlook-folders

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Nov 28, 2025

Load all Outlook folders by setting utils/outlook/folders.getOutlookRootFolders and utils/outlook/folders.getOutlookChildFolders to request up to 999 child folders per level

Remove description support from PageHeader and update pages to pass only title; increase Outlook folder fetch limits to 999 per level in apps/web/utils/outlook/folders.ts.

📍Where to Start

Start with the Outlook folder fetching changes in apps/web/utils/outlook/folders.ts, then review the PageHeader prop update in apps/web/components/PageHeader.tsx.


Macroscope summarized 4485c6f.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Outlook folder loading for more complete and reliable nested folder retrieval.
  • Chores / UI

    • Simplified page headers across the app by removing subtitle/description text for a cleaner appearance.
    • Bumped application version to v2.21.13.

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

@vercel
Copy link

vercel bot commented Nov 28, 2025

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

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Nov 28, 2025 9:35pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

Walkthrough

Removed the description prop from PageHeader (component signature and many usages), added explicit $top=999 to Outlook folder queries, and bumped version to v2.21.13.

Changes

Cohort / File(s) Summary
Outlook folder queries
apps/web/utils/outlook/folders.ts
Added explicit $top=999 for outer and nested childFolders expansions in getOutlookRootFolders and getOutlookChildFolders.
PageHeader component
apps/web/components/PageHeader.tsx
Removed description from PageHeaderProps and the component signature; removed rendering of the description/subheading.
Pages — removed PageHeader.description usages
apps/web/app/(app)/[emailAccountId]/automation/page.tsx, .../bulk-unsubscribe/BulkUnsubscribeSection.tsx, .../calendars/page.tsx, .../cold-email-blocker/page.tsx, .../integrations/page.tsx, .../settings/page.tsx, .../usage/page.tsx, apps/web/app/(app)/accounts/page.tsx, apps/web/app/(app)/admin/page.tsx, apps/web/app/(app)/license/page.tsx, apps/web/app/(app)/organization/[organizationId]/page.tsx
Removed description prop from PageHeader usages across many pages so only title (and video where present) are passed.
Version bump
version.txt
Updated version from v2.21.12 to v2.21.13.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to: apps/web/components/PageHeader.tsx signature/type change and all call sites listed above for compilation/type errors.
  • Verify Outlook query changes in apps/web/utils/outlook/folders.ts for intended paging semantics and API compatibility.

Possibly related PRs

  • Add subtitle to assistant page #712 — Modifies PageHeader (title+description+video); directly related/conflicting with removal of description.
  • Fixes #1029 — Changes the same Outlook folder utilities (folders.ts); related to $top/expansion behavior.
  • Imrpove mobile #929 — Reworks PageHeader description layout; overlaps with the signature/description removal here.

Poem

🐰 I hopped through props and query streams,
Removed a line, tightened our dreams,
Nine-nine-nine folders, neat and bright,
Headers trimmed, the UI light —
A rabbit cheers in code tonight.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Load all outlook folders' focuses on Outlook folder loading, but the changeset includes significant UI changes removing description props from multiple PageHeader components across the codebase, which are not reflected in the title. Revise the title to reflect the complete scope: consider 'Load all Outlook folders and remove PageHeader descriptions' or similar to accurately represent all major changes in the PR.
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 (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/load-all-outlook-folders

📜 Recent 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 6c99694 and 4485c6f.

📒 Files selected for processing (12)
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx (0 hunks)
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx (0 hunks)
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/integrations/page.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/usage/page.tsx (0 hunks)
  • apps/web/app/(app)/accounts/page.tsx (1 hunks)
  • apps/web/app/(app)/admin/page.tsx (1 hunks)
  • apps/web/app/(app)/license/page.tsx (1 hunks)
  • apps/web/app/(app)/organization/[organizationId]/page.tsx (1 hunks)
  • apps/web/components/PageHeader.tsx (1 hunks)
💤 Files with no reviewable changes (3)
  • apps/web/app/(app)/[emailAccountId]/usage/page.tsx
  • apps/web/app/(app)/[emailAccountId]/bulk-unsubscribe/BulkUnsubscribeSection.tsx
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx
🧰 Additional context used
📓 Path-based instructions (16)
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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.tsx
apps/web/app/(app)/*/page.tsx

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

apps/web/app/(app)/*/page.tsx: Create new pages at apps/web/app/(app)/PAGE_NAME/page.tsx
Pages are Server components so you can load data into them directly

Create new pages at apps/web/app/(app)/PAGE_NAME/page.tsx with components either colocated in the same folder or in page.tsx

Files:

  • apps/web/app/(app)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/accounts/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.tsx
!(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/(app)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.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)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/calendars/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
  • apps/web/app/(app)/accounts/page.tsx
  • apps/web/app/(app)/[emailAccountId]/settings/page.tsx
  • apps/web/components/PageHeader.tsx
  • apps/web/app/(app)/[emailAccountId]/integrations/page.tsx
apps/web/components/**/*.tsx

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

apps/web/components/**/*.tsx: Use React Hook Form with Zod validation for form components
Use result?.serverError with toastError and toastSuccess for error handling in form submissions

Use LoadingContent component to consistently handle loading and error states, passing loading, error, and children props

Use PascalCase for component file names (e.g., components/Button.tsx)

Files:

  • apps/web/components/PageHeader.tsx
**/{pages,routes,components}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/gmail-api.mdc)

Never call Gmail API directly from routes or components - always use wrapper functions from the utils folder

Files:

  • apps/web/components/PageHeader.tsx
🧠 Learnings (6)
📚 Learning: 2025-11-25T14:38:23.265Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/page-structure.mdc:0-0
Timestamp: 2025-11-25T14:38:23.265Z
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/app/(app)/admin/page.tsx
📚 Learning: 2025-11-25T14:38:23.265Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/page-structure.mdc:0-0
Timestamp: 2025-11-25T14:38:23.265Z
Learning: Applies to 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

Applied to files:

  • apps/web/app/(app)/admin/page.tsx
  • apps/web/app/(app)/license/page.tsx
  • apps/web/app/(app)/organization/[organizationId]/page.tsx
📚 Learning: 2025-11-25T14:38:18.874Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/page-structure.mdc:0-0
Timestamp: 2025-11-25T14:38:18.874Z
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/app/(app)/admin/page.tsx
📚 Learning: 2025-11-25T14:38:18.874Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/page-structure.mdc:0-0
Timestamp: 2025-11-25T14:38:18.874Z
Learning: Applies to apps/web/app/(app)/**/*.tsx : Components for pages are either put in `page.tsx`, or in the `apps/web/app/(app)/PAGE_NAME` folder

Applied to files:

  • apps/web/app/(app)/license/page.tsx
📚 Learning: 2025-07-08T13:14:07.449Z
Learnt from: elie222
Repo: elie222/inbox-zero PR: 537
File: apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx:30-34
Timestamp: 2025-07-08T13:14:07.449Z
Learning: The clean onboarding page in apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx is intentionally Gmail-specific and should show an error for non-Google email accounts rather than attempting to support multiple providers.

Applied to files:

  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/accounts/page.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/app/(app)/*/page.tsx : Create new pages at `apps/web/app/(app)/PAGE_NAME/page.tsx` with components either colocated in the same folder or in `page.tsx`

Applied to files:

  • apps/web/app/(app)/organization/[organizationId]/page.tsx
🧬 Code graph analysis (9)
apps/web/app/(app)/admin/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
  • PageHeader (19-30)
apps/web/app/(app)/license/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
  • PageHeader (19-30)
apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
  • PageHeader (19-30)
apps/web/app/(app)/[emailAccountId]/calendars/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
  • PageHeader (19-30)
apps/web/app/(app)/organization/[organizationId]/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
  • PageHeader (19-30)
apps/web/app/(app)/accounts/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
  • PageHeader (19-30)
apps/web/app/(app)/[emailAccountId]/settings/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
  • PageHeader (19-30)
apps/web/components/PageHeader.tsx (1)
apps/web/components/Typography.tsx (1)
  • PageHeading (122-122)
apps/web/app/(app)/[emailAccountId]/integrations/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
  • PageHeader (19-30)
⏰ 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). (4)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: test
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Review for correctness
🔇 Additional comments (9)
apps/web/app/(app)/license/page.tsx (1)

24-39: PageHeader usage matches updated API (title-only).

Using <PageHeader title="Activate your license" /> is consistent with the new PageHeader signature and keeps the page behavior intact.

apps/web/app/(app)/organization/[organizationId]/page.tsx (1)

12-18: Updated PageHeader call is compatible with the new props.

<PageHeader title="Organization Members" /> correctly reflects the simplified PageHeader interface.

apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx (1)

9-18: Cold Email Blocker header now matches PageHeader’s title-only API.

The PageHeader usage is correctly updated to pass only title, matching the component definition.

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

11-15: Calendars page header aligned with simplified PageHeader.

<PageHeader title="Calendars" /> correctly uses the updated PageHeader props without description.

apps/web/app/(app)/accounts/page.tsx (1)

33-38: Accounts header updated to use title-only PageHeader.

The PageHeader invocation with title="Accounts" matches the new API and keeps the layout semantics clear.

apps/web/app/(app)/admin/page.tsx (1)

32-38: Admin page header correctly migrated to the new PageHeader props.

Using <PageHeader title="Admin" /> is consistent with the simplified PageHeader component.

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

9-15: Integrations PageHeader usage now matches component definition.

The header now correctly passes only title, matching the updated PageHeader API.

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

19-27: PageHeader component correctly simplified to title (+ optional video).

The updated signature and JSX use only title plus an optional video, and the conditional render for WatchVideo is safe and idiomatic.

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

24-24: PR scope inconsistency: This change appears unrelated to the stated PR objectives.

The PR description states this is about "Load all outlook folders" and increasing Outlook folder listing limits to 999 items in apps/web/utils/outlook/folders.ts. However, this file only contains a change to remove the description prop from PageHeader, which is unrelated to Outlook folder handling.

While the code change itself is technically correct and aligns with the updated PageHeader signature (which no longer accepts a description prop), it suggests either:

  1. The PR description is incorrect or incomplete
  2. Unrelated changes have been bundled together
  3. This file was included in the PR by mistake

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

@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 2 files

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

📜 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 e5f5254 and 6c99694.

📒 Files selected for processing (2)
  • apps/web/utils/outlook/folders.ts (2 hunks)
  • version.txt (1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
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/utils/outlook/folders.ts
**/*.{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/utils/outlook/folders.ts
**/{server,api,actions,utils}/**/*.ts

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

**/{server,api,actions,utils}/**/*.ts: Use createScopedLogger from "@/utils/logger" for logging in backend code
Add the createScopedLogger instantiation at the top of the file with an appropriate scope name
Use .with() method to attach context variables only within specific functions, not on global loggers
For large functions with reused variables, use createScopedLogger().with() to attach context once and reuse the logger without passing variables repeatedly

Files:

  • apps/web/utils/outlook/folders.ts
**/*.{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/utils/outlook/folders.ts
**/*.ts

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

**/*.ts: ALL database queries MUST be scoped to the authenticated user/account by including user/account filtering in WHERE clauses to prevent unauthorized data access
Always validate that resources belong to the authenticated user before performing operations, using ownership checks in WHERE clauses or relationships
Always validate all input parameters for type, format, and length before using them in database queries
Use SafeError for error responses to prevent information disclosure. Generic error messages should not reveal internal IDs, logic, or resource ownership details
Only return necessary fields in API responses using Prisma's select option. Never expose sensitive data such as password hashes, private keys, or system flags
Prevent Insecure Direct Object References (IDOR) by validating resource ownership before operations. All findUnique/findFirst calls MUST include ownership filters
Prevent mass assignment vulnerabilities by explicitly whitelisting allowed fields in update operations instead of accepting all user-provided data
Prevent privilege escalation by never allowing users to modify system fields, ownership fields, or admin-only attributes through user input
All findMany queries MUST be scoped to the user's data by including appropriate WHERE filters to prevent returning data from other users
Use Prisma relationships for access control by leveraging nested where clauses (e.g., emailAccount: { id: emailAccountId }) to validate ownership

Files:

  • apps/web/utils/outlook/folders.ts
**/*.{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/utils/outlook/folders.ts
**/*.{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/utils/outlook/folders.ts
**/*.{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/utils/outlook/folders.ts
!(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/utils/outlook/folders.ts
  • version.txt
**/*.{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/utils/outlook/folders.ts
⏰ 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). (2)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: test
🔇 Additional comments (2)
version.txt (1)

1-1: Version bump looks good.

Standard version increment to v2.21.13.

apps/web/utils/outlook/folders.ts (1)

58-60: Consistent pagination limits applied.

The changes correctly mirror the approach in getOutlookRootFolders by adding .top(999) at the top level and $top=999 in the nested expand query. This ensures consistent behavior across both functions.

The same pagination consideration from line 40 applies here: if child folders exceed 999 items at any level, remaining folders won't be fetched.

.top(999)
.expand(
`childFolders($select=${fields};$expand=childFolders($select=${fields}))`,
`childFolders($select=${fields};$top=999;$expand=childFolders($select=${fields};$top=999))`,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the full context of the file to understand the implementation
cat -n apps/web/utils/outlook/folders.ts | head -80

Repository: elie222/inbox-zero

Length of output: 3109


🌐 Web query:

Microsoft Graph API mailFolders $top parameter maximum limit documentation

💡 Result:

Short answer — Microsoft’s official query-parameters doc: the $top minimum is 1 and "the maximum depends on the corresponding API" (no single global value). (learn.microsoft.com)

What that means for mailFolders:

  • There is no explicit mailFolders-specific $top max documented on the v1.0 reference; behavior depends on the endpoint/version. (learn.microsoft.com)
  • Community/Microsoft Q&A and examples report practical limits: mailFolders queries often use $top up to 250 (beta examples) and message/folder-listing scenarios commonly cap page sizes at 999 (or 1000 rejected; i.e. max 999) for many list endpoints. Use paging (@odata.nextLink) rather than requesting very large pages. (stackoverflow.com)

If you want, I can check a specific endpoint/version (v1.0 vs beta) and return exact observed limits and a test URL for that endpoint.

Citations:


🏁 Script executed:

# Check if pagination (@odata.nextLink) is handled anywhere in the outlook utilities
rg -n "nextLink|@odata" apps/web/utils/outlook/

Repository: elie222/inbox-zero

Length of output: 1982


🏁 Script executed:

# Check if there's pagination handling in the response types or retry logic
rg -n "nextLink|@odata" apps/web/utils/outlook/retry.ts apps/web/utils/outlook/client.ts

Repository: elie222/inbox-zero

Length of output: 44


🏁 Script executed:

# Look for how this file is used to understand if pagination is expected at a higher level
rg -n "getOutlookRootFolders|getOutlookChildFolders" apps/web/ -A 3 -B 1

Repository: elie222/inbox-zero

Length of output: 3533


🏁 Script executed:

# Check if the test file has any pagination test scenarios
cat -n apps/web/utils/outlook/folders.test.ts | grep -i "999\|nextlink\|pagination\|limit" -A 3 -B 3

Repository: elie222/inbox-zero

Length of output: 44


🏁 Script executed:

# Let's see more of the folders.test.ts file to understand test coverage
wc -l apps/web/utils/outlook/folders.test.ts

Repository: elie222/inbox-zero

Length of output: 104


🏁 Script executed:

# Look at the test file to see if it covers >999 folder scenario
tail -200 apps/web/utils/outlook/folders.test.ts

Repository: elie222/inbox-zero

Length of output: 5079


Missing pagination handling for folders exceeding 999 items.

The $top=999 parameter is appropriate for Microsoft Graph API mailFolders queries. However, unlike other Outlook utilities in the codebase (e.g., message.ts, thread.ts, batch.ts), getOutlookRootFolders and getOutlookChildFolders do not handle @odata.nextLink pagination. If any folder has more than 999 children, remaining children are silently dropped, contradicting the PR's goal of "loading all Outlook folders."

Required fix: Implement pagination by:

  1. Declaring the response type with "@odata.nextLink"?: string
  2. Looping through pages using @odata.nextLink until exhausted (follow the pattern in apps/web/utils/outlook/message.ts lines 208-218)
  3. Accumulating all folder results before returning

This is particularly important for the nested expand queries at lines 40 and 60, where deeply nested folders could exceed the limit at multiple levels.

🤖 Prompt for AI Agents
In apps/web/utils/outlook/folders.ts around line 40, the requests use `$top=999`
without handling `@odata.nextLink`, so folders >999 children are dropped;
declare the response type to include `"@odata.nextLink"?: string`, perform a
loop that follows `@odata.nextLink` (mirror the pattern in
apps/web/utils/outlook/message.ts lines 208-218) to fetch subsequent pages,
accumulate all folder results into a single array before returning, and apply
the same pagination handling for the nested `childFolders($expand=...)`
responses so deeply nested pages are also fully retrieved.

@elie222 elie222 merged commit b86f5ff into main Nov 28, 2025
12 of 13 checks passed
@elie222 elie222 deleted the fix/load-all-outlook-folders branch November 28, 2025 21:34
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