Skip to content

Revert "Add "New vs Returning Users" toggle and chart breakdown to ov…#737

Merged
goldflag merged 1 commit intomasterfrom
revert-1
Nov 30, 2025
Merged

Revert "Add "New vs Returning Users" toggle and chart breakdown to ov…#737
goldflag merged 1 commit intomasterfrom
revert-1

Conversation

@goldflag
Copy link
Copy Markdown
Collaborator

@goldflag goldflag commented Nov 30, 2025

…erview"

This reverts commit 41d71e2.

revert buggy code

Summary by CodeRabbit

  • Refactor
    • Removed new and returning user segmentation from analytics data
    • Simplified chart visualization from multi-series to single-series rendering
    • Removed user breakdown toggle control from the dashboard
    • Streamlined analytics header layout and tooltip display

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

@goldflag goldflag merged commit 3c3555d into master Nov 30, 2025
5 of 7 checks passed
@vercel
Copy link
Copy Markdown

vercel bot commented Nov 30, 2025

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

Project Deployment Preview Comments Updated (UTC)
rybbit Building Building Preview Comment Nov 30, 2025 5:09am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 30, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR removes the user-breakdown feature that tracked new vs. returning users across the analytics system. Changes include: removing new_users and returning_users fields from API response types, simplifying chart components to single-series rendering, eliminating the user-split toggle from UI and store state, and updating server-side analytics queries to discontinue these computations.

Changes

Cohort / File(s) Summary
API Type Definitions
client/src/api/analytics/useGetOverviewBucketed.ts
Removed new_users and returning_users fields from GetOverviewBucketedResponse type; response now contains only time, pageviews, sessions, pages_per_session, bounce_rate, session_duration, and users.
Server Analytics Query
server/src/api/analytics/getOverviewBucketed.ts
Removed computation of first-visit buckets and user-breakdown logic; simplified page_stats subquery to compute only distinct user count instead of new vs. returning splits; updated response type to return only time and pageviews.
Chart Components
client/src/app/[site]/main/components/MainSection/Chart.tsx
Replaced multi-series stacked rendering with single-series flow; removed showUsersSplit and SERIES_LABELS logic; simplified tooltip rendering via new ChartTooltip and formatTooltipValue; introduced conditional DashedLine layer; replaced complex stacked/dual-series support with unified data formatting.
Removed Tooltip Component
client/src/app/[site]/main/components/MainSection/ChartSliceTooltip.tsx
Removed file entirely; eliminated ChartSliceTooltip component, SeriesConfig, SeriesDataPoint, SeriesData, and ChartSliceTooltipProps types that previously handled two-series tooltip rendering for new vs. returning users.
Previous Chart Component
client/src/app/[site]/main/components/MainSection/PreviousChart.tsx
Removed multi-series color logic and user-breakdown handling; replaced dynamic chart data construction with simplified single-series formattedData array; set chart to non-stacked configuration; adjusted size calculation from halved to full data length plus one.
Main UI Component
client/src/app/[site]/main/components/MainSection/MainSection.tsx
Removed user-breakdown toggle support and associated state destructuring (showUsersSplit, setShowUsersSplit); simplified max value calculation to direct stat-based logic; streamlined header layout by removing absolute-positioned stat label and user-toggle controls.
Global State Store
client/src/lib/store.ts
Removed showUsersSplit: boolean property and setShowUsersSplit setter from Store type; removed initialization and reset logic related to the user-split flag.
Card UI Component
client/src/components/ui/card.tsx
Removed overflow-hidden and pointer-events-none classes from CardLoader div; allows child element overflow and user interactions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas requiring extra attention:

  • Chart.tsx: Large refactoring of data preparation flow, tooltip rendering strategy, and SVG layer composition; verify simplified single-series logic correctly handles all stat types (percentages, durations, counts) and dashed overlay behavior.
  • Server query (getOverviewBucketed.ts): Validate that removal of first-visit bucket precomputation and join logic does not impact performance or data accuracy; confirm simplified distinct user count computation is correct.
  • PreviousChart.tsx: Review size calculation change and non-stacked configuration to ensure previous-period comparison data renders correctly.
  • Coordinated removal: Confirm all references to removed ChartSliceTooltip component, showUsersSplit state, and user-breakdown UI are properly eliminated across the codebase.

Possibly related PRs

  • Returning users #736: Introduced new_users/returning_users fields and the user-breakdown feature (chart components, store state, tooltip logic) that this PR reverses.
  • New vs Returning users toggle #722: Directly undoes another PR's feature additions; modifies the same API types, chart components, store flags, and server query related to new vs. returning user tracking.

Poem

🐰 Hop away, complexity spring!
Single series now takes the lead,
User splits fade—one flow's the thing,
Simpler charts, cleaner creed!
The breakdown dissolves with care,
Analytics light as morning air.

✨ 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 revert-1

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69d26ad and dbb07da.

📒 Files selected for processing (8)
  • client/src/api/analytics/useGetOverviewBucketed.ts (0 hunks)
  • client/src/app/[site]/main/components/MainSection/Chart.tsx (7 hunks)
  • client/src/app/[site]/main/components/MainSection/ChartSliceTooltip.tsx (0 hunks)
  • client/src/app/[site]/main/components/MainSection/MainSection.tsx (4 hunks)
  • client/src/app/[site]/main/components/MainSection/PreviousChart.tsx (4 hunks)
  • client/src/components/ui/card.tsx (1 hunks)
  • client/src/lib/store.ts (1 hunks)
  • server/src/api/analytics/getOverviewBucketed.ts (3 hunks)

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.

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