Skip to content

Conversation

@doneel
Copy link
Contributor

@doneel doneel commented Dec 9, 2025

Description

Changes

Blockers

How this has been tested?


Note

Adds mobile-optimized report headers with a new date selection combo + labeled pickers, refactors download buttons and conditional actions, and applies related UI/style tweaks.

  • Reports (UI/UX):
    • New ReportsSelector for switching reports (mobile drawer + desktop toggle); integrates into Reports and adds styles.
    • Propagates view to child reports.
  • Date Selection:
    • Adds DateRangePickers and LabeledGlobalDatePicker components.
  • Balance Sheet:
    • Refactors header with memoized mobile layout using DateSelectionComboBox + LabeledGlobalDatePicker; adjusts expand/download button placements; widget and full views use new headers.
  • Profit & Loss:
    • Mobile header uses DateSelectionComboBox + DateRangePickers; comparison options layout updated; ProfitAndLossDownloadButton now accepts iconOnly prop.
  • Statement of Cash Flow:
    • Rebuilds header (mobile: combo + range pickers; desktop: combined selection); removes useElementViewSize usage; accepts view prop from Reports.
  • Unified Report:
    • Switches to shared DownloadButton with loading/error states and iconOnly.
  • Bank Transactions:
    • Shows download/upload actions only when not in bulk actions; minor mobile header padding tweaks.
    • Mobile bulk actions header spacing adjusted.
  • Bulk Actions Module:
    • Adds wrapper class and styles to constrain width and prevent shrink.
  • Styles:
    • Mobile list items now full-width with adjusted margins; header container padding updates.
  • Version:
    • Bumps package to 0.1.117-alpha.

Written by Cursor Bugbot for commit 31d0d12. This will update automatically on new commits. Configure here.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 9, 2025

Greptile Overview

Greptile Summary

Improved mobile responsiveness for reports and bank transactions with a new drawer-based report selector and enhanced date picker layouts. Added spacing refinements to prevent overflow issues in bulk actions.

Key Changes:

  • New ReportsSelector component that shows a mobile drawer or desktop toggle for switching between reports
  • New date picker components (DateRangePickers, LabeledGlobalDatePicker) for improved mobile layouts
  • Mobile-specific header layouts in BalanceSheet, ProfitAndLossReport, and StatementOfCashFlow with conditional rendering based on view breakpoint
  • Reduced padding in bank transaction mobile headers and list items for better space utilization
  • Fixed bulk actions overflow by adding max-width constraint and hiding download buttons when bulk actions are active

Style Issues Found:

  • Commented code should be removed in bank_transactions.scss
  • ReportsSelector.scss should be imported in the component file, not in parent
  • RTL padding properties (pis/pie) should be used instead of pi for better internationalization support
  • CSS variables should be preferred over hardcoded rem values

Confidence Score: 4/5

  • This PR is safe to merge with minor style improvements needed
  • The PR successfully implements mobile-responsive improvements with clean component abstractions and proper prop passing. The logic is sound and the changes are well-structured. Score reduced by 1 point due to style guideline violations (commented code, missing SCSS import in component, hardcoded rem values, and non-RTL-aware padding) that should be addressed for consistency with project standards.
  • Pay attention to src/views/Reports/ReportsSelector.tsx (missing SCSS import), src/styles/bank_transactions.scss (commented code), and src/views/Reports/ReportsSelector.scss (hardcoded rem values)

Important Files Changed

File Analysis

Filename Score Overview
src/components/BankTransactionsMobileList/BankTransactionsMobileBulkActionsHeader.tsx 4/5 reduced padding from lg/md to xs/sm for more compact mobile header, minor RTL styling issue
src/components/DateSelection/DateRangePickers.tsx 5/5 new component for side-by-side start/end date pickers with global state integration
src/components/DateSelection/LabeledGlobalDatePicker.tsx 5/5 new component for labeled effective date picker with business activation constraints
src/styles/bank_transactions.scss 4/5 removed horizontal padding from header at container breakpoint, contains commented code
src/views/Reports/ReportsSelector.scss 4/5 new styles for mobile drawer-based report selector, uses rem instead of CSS variables
src/views/Reports/ReportsSelector.tsx 4/5 new component that shows drawer on mobile or toggle on desktop for report selection, missing SCSS import

Sequence Diagram

sequenceDiagram
    participant User
    participant Reports
    participant ReportsSelector
    participant Drawer
    participant BalanceSheet
    participant DateSelectionComboBox
    participant DateRangePickers
    
    User->>Reports: Views reports page (mobile)
    Reports->>ReportsSelector: Renders selector with current report
    
    alt Mobile View
        User->>ReportsSelector: Clicks report button
        ReportsSelector->>Drawer: Opens mobile drawer
        Drawer->>User: Shows report options
        User->>Drawer: Selects different report
        Drawer->>ReportsSelector: Calls onChange with new value
        ReportsSelector->>Reports: Updates selected report
        Reports->>BalanceSheet: Renders selected report component
    else Desktop View
        ReportsSelector->>User: Shows toggle buttons
        User->>ReportsSelector: Clicks toggle option
        ReportsSelector->>Reports: Updates selected report
    end
    
    alt Full Date Mode (Mobile)
        BalanceSheet->>DateSelectionComboBox: Renders in first header row
        BalanceSheet->>DateRangePickers: Renders in second header row
        User->>DateRangePickers: Adjusts start/end dates
        DateRangePickers->>BalanceSheet: Updates global date range
    else Simple Date Mode
        BalanceSheet->>User: Shows CombinedDateSelection
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

17 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 835 to 836
// padding-right: var(--spacing-md);
// padding-left: var(--spacing-md);
Copy link
Contributor

Choose a reason for hiding this comment

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

style: remove commented code

Suggested change
// padding-right: var(--spacing-md);
// padding-left: var(--spacing-md);
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/styles/bank_transactions.scss
Line: 835:836

Comment:
**style:** remove commented code

```suggestion
```

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

gap='md'
pi='lg'
pbs='md'
pi='xs'
Copy link
Contributor

Choose a reason for hiding this comment

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

style: use pis (padding-inline-start) instead of pi for RTL-aware styling per custom rules

Context Used: Rule from dashboard - Instead of using padding-left or padding-right, use the RTL-aware styling such as pis or pie whi... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/BankTransactionsMobileList/BankTransactionsMobileBulkActionsHeader.tsx
Line: 34:34

Comment:
**style:** use `pis` (padding-inline-start) instead of `pi` for RTL-aware styling per custom rules

**Context Used:** Rule from `dashboard` - Instead of using padding-left or padding-right, use the RTL-aware styling such as `pis` or `pie` whi... ([source](https://app.greptile.com/review/custom-context?memory=e9ff609f-5bf4-492d-9ff9-3f3a7debf6b2))

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

Comment on lines +73 to +74
padding-block-start: 0.5rem;
padding-block-end: 0.75rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: use CSS variables instead of rem values (e.g., var(--spacing-sm))

Suggested change
padding-block-start: 0.5rem;
padding-block-end: 0.75rem;
padding-block-start: var(--spacing-sm);
padding-block-end: var(--spacing-md);

Context Used: Rule from dashboard - When writing CSS styles, prefer rem instead of px usage. Acceptable exceptions: pixel values bel... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/views/Reports/ReportsSelector.scss
Line: 73:74

Comment:
**style:** use CSS variables instead of `rem` values (e.g., `var(--spacing-sm)`)

```suggestion
  padding-block-start: var(--spacing-sm);
  padding-block-end: var(--spacing-md);
```

**Context Used:** Rule from `dashboard` - When writing CSS styles, prefer `rem` instead of `px` usage. Acceptable exceptions: pixel values bel... ([source](https://app.greptile.com/review/custom-context?memory=2d1130c2-7a17-4663-ac54-76dc142598ad))

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

Comment on lines +1 to +9
import { type ChangeEvent, useState } from 'react'
import classNames from 'classnames'

import { type View } from '@internal-types/general'
import ChevronDown from '@icons/ChevronDown'
import { HStack, VStack } from '@ui/Stack/Stack'
import { Span } from '@ui/Typography/Text'
import { Toggle } from '@components/Toggle/Toggle'
import { Drawer } from '@components/ui/Modal/Modal'
Copy link
Contributor

Choose a reason for hiding this comment

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

style: import ReportsSelector.scss directly in this component file instead of in Reports.tsx

Suggested change
import { type ChangeEvent, useState } from 'react'
import classNames from 'classnames'
import { type View } from '@internal-types/general'
import ChevronDown from '@icons/ChevronDown'
import { HStack, VStack } from '@ui/Stack/Stack'
import { Span } from '@ui/Typography/Text'
import { Toggle } from '@components/Toggle/Toggle'
import { Drawer } from '@components/ui/Modal/Modal'
import { type ChangeEvent, useState } from 'react'
import classNames from 'classnames'
import { type View } from '@internal-types/general'
import ChevronDown from '@icons/ChevronDown'
import { HStack, VStack } from '@ui/Stack/Stack'
import { Span } from '@ui/Typography/Text'
import { Toggle } from '@components/Toggle/Toggle'
import { Drawer } from '@components/ui/Modal/Modal'
import './ReportsSelector.scss'

Context Used: Rule from dashboard - Style files of components should be colocated with the component files (in the same directory) and s... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/views/Reports/ReportsSelector.tsx
Line: 1:9

Comment:
**style:** import `ReportsSelector.scss` directly in this component file instead of in `Reports.tsx`

```suggestion
import { type ChangeEvent, useState } from 'react'
import classNames from 'classnames'

import { type View } from '@internal-types/general'
import ChevronDown from '@icons/ChevronDown'
import { HStack, VStack } from '@ui/Stack/Stack'
import { Span } from '@ui/Typography/Text'
import { Toggle } from '@components/Toggle/Toggle'
import { Drawer } from '@components/ui/Modal/Modal'

import './ReportsSelector.scss'
```

**Context Used:** Rule from `dashboard` - Style files of components should be colocated with the component files (in the same directory) and s... ([source](https://app.greptile.com/review/custom-context?memory=2cfa0f12-2678-46c4-a125-f28b1b2e161e))

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

<ProfitAndLossDownloadButton
stringOverrides={stringOverrides?.downloadButton}
moneyFormat={csvMoneyFormat}
iconOnly
Copy link

Choose a reason for hiding this comment

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

Bug: Download button always icon-only on desktop view

The ProfitAndLossDownloadButton in the desktop code path now has iconOnly always set to true. Previously, iconOnly was computed from useSizeClass and was only true for non-desktop views. The same issue exists in BalanceSheet.tsx where BalanceSheetDownloadButton at line 145 always has iconOnly set. This causes the download button to always show as icon-only even on desktop, removing the text label that was previously visible.

Additional Locations (1)

Fix in Cursor Fix in Web

padding-left: 0;

// padding-right: var(--spacing-md);
// padding-left: var(--spacing-md);
Copy link

Choose a reason for hiding this comment

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

Bug: Commented-out CSS suggests accidentally committed debug code

The padding values were changed from var(--spacing-md) to 0 with the original values left as comments. This pattern suggests debugging or testing changes that may have been accidentally committed. The horizontal padding for .Layer__bank-transactions__header is now removed on medium-width containers, which may cause unintended layout issues.

Fix in Cursor Fix in Web

const { view, containerRef } = useElementViewSize<HTMLDivElement>()

const header = useMemo(() => {
const isMobile = view !== 'desktop'
Copy link

Choose a reason for hiding this comment

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

Bug: StatementOfCashFlow defaults to mobile layout when standalone

The StatementOfCashFlow component previously used useElementViewSize internally to determine responsive layout. Now it accepts view as an optional prop with no default value. When used standalone (the component is exported in src/index.tsx), external consumers won't pass view, so it will be undefined. The condition view !== 'desktop' evaluates to true when view is undefined, causing the mobile layout to always render regardless of actual screen size. This breaks standalone usage of the component.

Fix in Cursor Fix in Web

<BalanceSheetDownloadButton
effectiveDate={effectiveDate}
iconOnly
/>
Copy link

Choose a reason for hiding this comment

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

Bug: Download button always icon-only on desktop view

The BalanceSheetDownloadButton in the non-mobile branch (the "else" return path of the header useMemo) has iconOnly hardcoded to true. Previously, the original code used iconOnly={view === 'mobile'}, which would show the full button text on desktop. Now the download button will only show an icon even on desktop views, which is a regression in user experience. The same issue exists in ProfitAndLossReport.tsx where ProfitAndLossDownloadButton is passed iconOnly unconditionally in both mobile and desktop branches.

Additional Locations (1)

Fix in Cursor Fix in Web


const selectedOption = options.find(opt => opt.value === selected)

if (view === 'mobile') {
Copy link

Choose a reason for hiding this comment

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

Bug: Tablet view uses desktop toggle instead of mobile drawer

The ReportsSelector component checks view === 'mobile' to decide whether to show the mobile drawer UI. However, other report components in this PR use view !== 'desktop' to define "mobile" behavior, which includes both 'mobile' and 'tablet' views. This inconsistency means that on tablet, the report content uses mobile layout but the selector uses the desktop Toggle component, creating a mixed UI experience.

Fix in Cursor Fix in Web

const rawActivationDate = useBusinessActivationDate()
const activationDate = useMemo(() => rawActivationDate ? startOfDay(rawActivationDate) : null, [rawActivationDate])

const maxDate = useMemo(() => endOfDay(new Date()), [])
Copy link

Choose a reason for hiding this comment

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

Bug: MaxDate for date picker becomes stale after midnight

The maxDate is computed using useMemo(() => endOfDay(new Date()), []) with an empty dependency array. This means the value is calculated once on mount and never updated. If the user keeps the application open past midnight, maxDate will still reference yesterday's date, preventing selection of the current day as the effective date.

Fix in Cursor Fix in Web

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.

4 participants