Skip to content

Comments

fix: update styles of charts on /insights#22557

Merged
eunjae-lee merged 6 commits intomainfrom
eunjae/cal-6109-update-styles-of-charts-on-insights
Jul 17, 2025
Merged

fix: update styles of charts on /insights#22557
eunjae-lee merged 6 commits intomainfrom
eunjae/cal-6109-update-styles-of-charts-on-insights

Conversation

@eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Jul 16, 2025

What does this PR do?

This PR updates the overall style of charts on the /insights page.

  • Fixes CAL-6109

Visual Demo (For contributors especially)

Before

Screenshot.2025-07-16.at.14.45.46.mp4

After

Screenshot.2025-07-16.at.17.48.53.mp4

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Visit /insights and it works the same as before.

@linear
Copy link

linear bot commented Jul 16, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

"""

Walkthrough

This pull request refactors the layout and styling of multiple components in the insights module, particularly those used on the /insights page. It replaces the previous use of the CardInsights and Tremor UI table components with a new ChartCard wrapper and custom flexbox and grid-based layouts using Tailwind CSS classes. Several tables are now rendered using native HTML elements and utility classes instead of the Tremor library. The KPI cards are split into "events" and "performance" groups with updated grid layouts and loading states. Localization strings are updated to match new labels and groupings.

Assessment against linked issues

Objective Addressed Explanation
Refactor chart and card wrappers from CardInsights to ChartCard and update layout/styling of all chart and KPI components on /insights (CAL-6109)
Replace Tremor table components with custom HTML/flexbox layouts for all relevant data tables on /insights (CAL-6109)
Update grid structure and component grouping for insights page to match new design (CAL-6109)
Update localization strings for new labels and groupings in insights/statistics (CAL-6109)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes were found. All modifications relate directly to the objectives of updating chart styles, layouts, and related localization for the /insights page as described in the linked issue.
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/features/insights/components/BookingKPICards.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-playwright".

(The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-playwright@latest --save-dev

The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.


📜 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 322b3d3 and 9a95877.

📒 Files selected for processing (1)
  • packages/features/insights/components/BookingKPICards.tsx (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
packages/features/insights/components/BookingKPICards.tsx (3)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
Learnt from: alishaz-polymath
PR: calcom/cal.com#22304
File: packages/features/eventtypes/components/MultiplePrivateLinksController.tsx:92-94
Timestamp: 2025-07-16T06:42:27.001Z
Learning: In the MultiplePrivateLinksController component (packages/features/eventtypes/components/MultiplePrivateLinksController.tsx), the `currentLink.maxUsageCount ?? 1` fallback in the openSettingsDialog function is intentional. Missing maxUsageCount values indicate old/legacy private links that existed before the expiration feature was added, and they should default to single-use behavior (1) for backward compatibility.
⏰ 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: Install dependencies / Yarn install & cache
  • GitHub Check: Security Check
🔇 Additional comments (6)
packages/features/insights/components/BookingKPICards.tsx (6)

3-4: LGTM: Import changes support the refactoring.

The new imports (classNames, SkeletonText, ChartCard) are appropriately added to support the component refactoring and are used correctly throughout the file.

Also applies to: 7-7


32-74: LGTM: Logical separation of KPI categories.

The refactoring to split the single categories array into eventCategories and performanceCategories creates a clear semantic separation between booking lifecycle events and performance metrics. The TypeScript typing is correct and the grouping aligns well with the new UI structure.


77-80: LGTM: Loading state updated correctly.

The loading state now properly passes both eventCategories and performanceCategories to the LoadingKPICards component, maintaining consistency with the split categories approach.


84-116: LGTM: Improved render structure with better organization.

The new render structure with separate ChartCard components for events and performance provides better semantic organization and visual separation. The consistent mapping pattern for both category groups is clean and maintainable.


119-165: LGTM: Loading component updated consistently.

The LoadingKPICards component properly reflects the new two-section structure with appropriate skeleton placeholders that match the actual KPICard layout. The component signature correctly accepts both category arrays.


167-170: LGTM: StatContainer provides clean grid layout.

The StatContainer component provides a clean, responsive grid layout that works well for the KPI cards.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • 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.

@graphite-app graphite-app bot requested a review from a team July 16, 2025 12:45
@vercel
Copy link

vercel bot commented Jul 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jul 16, 2025 8:23pm
cal-eu ⬜️ Ignored (Inspect) Visit Preview Jul 16, 2025 8:23pm

@keithwillcode keithwillcode added consumer core area: core, team members only labels Jul 16, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jul 16, 2025

No security or compliance issues detected. Reviewed everything up to 9a95877.

Security Overview
  • 🔎 Scanned files: 18 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► apps/web/modules/insights/insights-view.tsx
    Updated grid layouts and responsiveness
► packages/features/insights/components/*
    Refactored insights components UI and charts
► apps/web/public/static/locales/en/common.json
    Updated insights-related translations
Bug Fix ► packages/lib/date-ranges.ts
    Fixed date range calculation logic

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@dosubot dosubot bot added the insights area: insights, analytics label Jul 16, 2025
@graphite-app
Copy link

graphite-app bot commented Jul 16, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (07/16/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add ready-for-e2e label" took an action on this PR • (07/17/25)

1 label was added to this PR based on Keith Williams's automation.

@eunjae-lee
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

✅ Actions performed

Full review triggered.

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

🧹 Nitpick comments (6)
apps/web/public/static/locales/en/common.json (2)

2724-2726: Grammar / phrasing tweaks

• “Most No Show” is awkward; consider “Most No-Shows” or “Highest No-Show Rate”.
• “Highest Rated” / “Lowest Rated” read fine, but double-check the surrounding UI copy (does it show members or events?) to avoid ambiguity.

No functional issue, just polish.


3146-3146: Same truncation issue as above

-  "most_cancelled_bookings": "Most Cancelled",
+  "most_cancelled_bookings": "Most Cancelled Bookings",

Keeps the wording parallel with the metric name and avoids confusion with “most cancelled events” vs anything else.

packages/features/insights/components/TotalBookingUsersTable.tsx (2)

20-44: Consider using semantic HTML for better accessibility.

While the flexbox layout works visually, replacing table elements with divs may impact screen reader users and keyboard navigation. Consider using native table elements with Tailwind classes or adding appropriate ARIA attributes to maintain accessibility.

-    <div className="overflow-hidden rounded-md">
-      {filteredData.length > 0 ? (
-        filteredData.map((item) => (
-          <div
-            key={item.userId}
-            className="border-subtle flex items-center justify-between border-b px-4 py-3 last:border-b-0">
+    <div className="overflow-hidden rounded-md">
+      {filteredData.length > 0 ? (
+        <table className="w-full">
+          <tbody>
+            {filteredData.map((item) => (
+              <tr
+                key={item.userId}
+                className="border-subtle border-b last:border-b-0">
+                <td className="px-4 py-3">
+                  <div className="flex items-center">
+                    <Avatar
+                      alt={item.user.name || ""}
+                      size="sm"
+                      imageSrc={getUserAvatarUrl({ avatarUrl: item.user.avatarUrl })}
+                      title={item.user.name || ""}
+                      className="mr-3"
+                    />
+                    <div className="text-default text-sm font-medium">{item.user.name}</div>
+                  </div>
+                </td>
+                <td className="px-4 py-3 text-right">
+                  <div className="text-default text-sm font-medium">{item.count}</div>
+                </td>
+              </tr>
+            ))}
+          </tbody>
+        </table>

40-42: Reconsider the fixed height for empty state.

The fixed height h-60 (15rem) might not be appropriate in all contexts where this component is used. Consider making it more flexible or accepting it as a prop.

-        <div className="flex h-60 text-center">
+        <div className="flex min-h-[10rem] py-8 text-center">
packages/features/insights/components/FeedbackTable.tsx (1)

42-42: Add tooltip for truncated feedback text.

The truncated feedback might hide important information. Consider adding a tooltip to show the full text on hover.

Add a Tooltip component import:

+ import { Tooltip } from "@calcom/ui/components/tooltip";

Then wrap the truncated feedback:

-              <div className="text-default max-w-xs truncate text-sm font-medium">{item.feedback}</div>
+              <Tooltip content={item.feedback}>
+                <div className="text-default max-w-xs truncate text-sm font-medium">{item.feedback}</div>
+              </Tooltip>
packages/features/insights/components/TotalUserFeedbackTable.tsx (1)

42-43: Maintain consistency in empty state messages.

The empty state message "No data found" differs from "No members found" in TotalBookingUsersTable. Consider using consistent messaging across similar table components for better UX.

-          <p className="m-auto text-sm font-light">No data found</p>
+          <p className="m-auto text-sm font-light">No members found</p>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be9e5c9 and 016c44f.

📒 Files selected for processing (17)
  • apps/web/modules/insights/insights-view.tsx (1 hunks)
  • apps/web/public/static/locales/en/common.json (3 hunks)
  • packages/features/insights/components/AverageEventDurationChart.tsx (3 hunks)
  • packages/features/insights/components/BookingKPICards.tsx (4 hunks)
  • packages/features/insights/components/BookingStatusLineChart.tsx (3 hunks)
  • packages/features/insights/components/FeedbackTable.tsx (2 hunks)
  • packages/features/insights/components/HighestNoShowHostTable.tsx (2 hunks)
  • packages/features/insights/components/HighestRatedMembersTable.tsx (2 hunks)
  • packages/features/insights/components/KPICard.tsx (2 hunks)
  • packages/features/insights/components/LeastBookedTeamMembersTable.tsx (2 hunks)
  • packages/features/insights/components/LowestRatedMembersTable.tsx (2 hunks)
  • packages/features/insights/components/MostBookedTeamMembersTable.tsx (2 hunks)
  • packages/features/insights/components/MostCancelledBookingsTables.tsx (2 hunks)
  • packages/features/insights/components/PopularEventsTable.tsx (2 hunks)
  • packages/features/insights/components/RecentFeedbackTable.tsx (2 hunks)
  • packages/features/insights/components/TotalBookingUsersTable.tsx (1 hunks)
  • packages/features/insights/components/TotalUserFeedbackTable.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (14)
packages/features/insights/components/AverageEventDurationChart.tsx (1)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
packages/features/insights/components/HighestRatedMembersTable.tsx (1)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
packages/features/insights/components/RecentFeedbackTable.tsx (1)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
packages/features/insights/components/BookingStatusLineChart.tsx (2)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
packages/features/insights/components/LeastBookedTeamMembersTable.tsx (2)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
packages/features/insights/components/LowestRatedMembersTable.tsx (1)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
packages/features/insights/components/MostBookedTeamMembersTable.tsx (2)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
packages/features/insights/components/MostCancelledBookingsTables.tsx (2)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
packages/features/insights/components/HighestNoShowHostTable.tsx (2)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
packages/features/insights/components/TotalBookingUsersTable.tsx (2)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
packages/features/insights/components/PopularEventsTable.tsx (2)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
apps/web/modules/insights/insights-view.tsx (2)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
apps/web/public/static/locales/en/common.json (1)

undefined

<retrieved_learning>
Learnt from: bandhan-majumder
PR: #22359
File: packages/lib/server/locales/en/common.json:1336-1339
Timestamp: 2025-07-14T16:31:45.201Z
Learning: When making localization changes for new features, it's often safer to add new strings rather than modify existing ones to avoid breaking existing functionality that depends on the original strings. This approach allows for feature-specific customization while maintaining backward compatibility.
</retrieved_learning>

packages/features/insights/components/BookingKPICards.tsx (2)
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.341Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.
Learnt from: eunjae-lee
PR: calcom/cal.com#22106
File: packages/features/insights/components/RoutingFunnel.tsx:15-17
Timestamp: 2025-07-15T12:58:40.497Z
Learning: In the insights routing funnel component (packages/features/insights/components/RoutingFunnel.tsx), the useColumnFilters exclusions are intentionally different from the general useInsightsParameters exclusions. RoutingFunnel specifically excludes only ["createdAt"] while useInsightsParameters excludes ["bookingUserId", "formId", "createdAt", "eventTypeId"]. This difference is by design.
🧬 Code Graph Analysis (7)
packages/features/insights/components/AverageEventDurationChart.tsx (1)
packages/features/insights/components/ChartCard.tsx (1)
  • ChartCard (14-52)
packages/features/insights/components/HighestRatedMembersTable.tsx (2)
packages/features/insights/components/ChartCard.tsx (1)
  • ChartCard (14-52)
packages/features/insights/components/TotalUserFeedbackTable.tsx (1)
  • TotalUserFeedbackTable (5-48)
packages/features/insights/components/BookingStatusLineChart.tsx (1)
packages/features/insights/components/ChartCard.tsx (1)
  • ChartCard (14-52)
packages/features/insights/components/LowestRatedMembersTable.tsx (2)
packages/features/insights/components/ChartCard.tsx (1)
  • ChartCard (14-52)
packages/features/insights/components/TotalUserFeedbackTable.tsx (1)
  • TotalUserFeedbackTable (5-48)
packages/features/insights/components/MostBookedTeamMembersTable.tsx (2)
packages/features/insights/components/ChartCard.tsx (1)
  • ChartCard (14-52)
packages/features/insights/components/TotalBookingUsersTable.tsx (1)
  • TotalBookingUsersTable (5-46)
packages/features/insights/components/MostCancelledBookingsTables.tsx (2)
packages/features/insights/components/ChartCard.tsx (1)
  • ChartCard (14-52)
packages/features/insights/components/TotalBookingUsersTable.tsx (1)
  • TotalBookingUsersTable (5-46)
packages/features/insights/components/HighestNoShowHostTable.tsx (2)
packages/features/insights/components/ChartCard.tsx (1)
  • ChartCard (14-52)
packages/features/insights/components/TotalUserFeedbackTable.tsx (1)
  • TotalUserFeedbackTable (5-48)
⏰ 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: Security Check
🔇 Additional comments (25)
packages/features/insights/components/KPICard.tsx (1)

23-23: LGTM: Simplified wrapper aligns with component hierarchy.

The change from CardInsights to plain div is appropriate since KPICard is now used as a child component within ChartCard containers, avoiding nested card styling issues.

Also applies to: 49-49

packages/features/insights/components/AverageEventDurationChart.tsx (2)

6-6: LGTM: Import added for new ChartCard component.


37-37: LGTM: Consistent refactoring to use ChartCard component.

The change from CardInsights wrapper with explicit Title component to ChartCard with title prop simplifies the JSX structure and follows the consistent refactoring pattern across the insights components.

Also applies to: 53-53

packages/features/insights/components/RecentFeedbackTable.tsx (2)

5-5: LGTM: Import added for new ChartCard component.


34-34: LGTM: Consistent refactoring to use ChartCard component.

The change from CardInsights wrapper to ChartCard with title prop follows the consistent refactoring pattern across the insights components and simplifies the JSX structure.

Also applies to: 36-36

packages/features/insights/components/HighestNoShowHostTable.tsx (2)

5-5: LGTM: Import added for new ChartCard component.


34-34: LGTM: Consistent refactoring to use ChartCard component.

The change from CardInsights wrapper to ChartCard with title prop follows the consistent refactoring pattern across the insights components and maintains the same functionality.

Also applies to: 36-36

packages/features/insights/components/LeastBookedTeamMembersTable.tsx (2)

5-5: LGTM: Import added for new ChartCard component.


34-34: LGTM: Consistent refactoring to use ChartCard component.

The change from CardInsights wrapper to ChartCard with title prop completes the consistent refactoring pattern across the insights components and maintains the same functionality.

Also applies to: 36-36

packages/features/insights/components/MostBookedTeamMembersTable.tsx (2)

5-5: Clean import update for UI standardization.

The import correctly switches to the new ChartCard component as part of the insights UI refactor.


34-36: Well-structured component wrapper refactor.

The transition from CardInsights + separate Title to ChartCard with title prop simplifies the JSX structure while maintaining the same functionality. This change is consistent with the broader UI standardization effort across insights components.

packages/features/insights/components/MostCancelledBookingsTables.tsx (2)

5-5: Import correctly updated for UI consistency.

The ChartCard import aligns with the standardized card component approach across insights components.


32-34: Proper wrapper component refactor.

The ChartCard correctly wraps the conditional rendering logic while providing a consistent title display. The refactor maintains the original component behavior.

packages/features/insights/components/LowestRatedMembersTable.tsx (2)

5-5: Import update maintains consistency.

The ChartCard import follows the standardized pattern across all insights table components.


34-36: Consistent component wrapper transition.

The ChartCard with title prop properly replaces the previous CardInsights + Title pattern while maintaining the same rendering logic and functionality.

packages/features/insights/components/HighestRatedMembersTable.tsx (2)

5-5: Import correctly aligned with UI refactor.

The ChartCard import maintains consistency with the standardized card component approach.


34-36: Proper component wrapper update.

The ChartCard with title prop correctly replaces the previous card structure while maintaining the same conditional rendering logic and functionality.

packages/features/insights/components/BookingStatusLineChart.tsx (2)

6-6: Import update follows established pattern.

The ChartCard import correctly aligns with the UI standardization across insights components.


40-49: Consistent chart wrapper refactor.

The ChartCard with title prop properly replaces the previous card structure while maintaining the LineChart component's configuration and rendering logic.

apps/web/modules/insights/insights-view.tsx (2)

78-83: Grid layout improvement looks good.

The change from 2 columns to 4 columns on large screens (lg:grid-cols-4) will provide better space utilization for the team member tables. The responsive design maintains 1 column on mobile and 2 columns on medium screens, ensuring good usability across devices.


84-90: Smart layout organization for rating tables and feedback.

The new grid structure effectively groups the rating tables with the feedback table, and the lg:col-span-2 on RecentFeedbackTable creates a balanced layout where the feedback table takes up half the width on large screens. This logical grouping improves the visual hierarchy.

packages/features/insights/components/PopularEventsTable.tsx (2)

5-5: Component refactoring aligns with the broader UI standardization.

The import change to ChartCard is consistent with the broader effort to standardize card components across the insights module.


35-54: Effective transition from Tremor UI to custom styled components.

The refactoring successfully replaces the Tremor UI table structure with a clean, custom div-based layout:

  • Improved maintainability: Using ChartCard with a title prop simplifies the component structure
  • Consistent styling: The flexbox layout with Tailwind classes provides consistent spacing and borders
  • Preserved functionality: The conditional rendering for empty data and loading states remains intact
  • Accessibility: The semantic structure is maintained despite moving away from table elements

The border utilities (border-muted, border-b, last:border-b-0) create clean visual separation between items, and the responsive text sizing ensures good readability.

apps/web/public/static/locales/en/common.json (2)

2170-2171: Value wording feels truncated – consider restoring the noun for clarity

The keys still reference “*_members”, yet the values have been shortened to “Most Booked” / “Least Booked”.
If the UI section still lists members, dropping the noun may confuse translators or future readers.

-  "most_booked_members": "Most Booked",
-  "least_booked_members": "Least Booked",
+  "most_booked_members": "Most Booked Members",
+  "least_booked_members": "Least Booked Members",

(Same applies to any other locale files.)
[ suggest_nitpick ]


2176-2177: Very-generic keys risk future collisions

"events" and "performance" are top-level, extremely common words.
The file already contains >3 000 keys; a second team member could easily add another "events" elsewhere and silently override this one.

Recommend namespacing, e.g.

-  "events": "Events",
-  "performance": "Performance",
+  "insights_events_tab": "Events",
+  "insights_performance_tab": "Performance",

Would you mind grepping the codebase for existing "events" / "performance" keys to ensure you’re not shadowing an earlier definition?

Base automatically changed from eunjae/cal-5986-drop-off-funnel-chart-for-insightsrouting to main July 16, 2025 14:36
@eunjae-lee eunjae-lee requested a review from a team as a code owner July 16, 2025 14:36
@eunjae-lee eunjae-lee force-pushed the eunjae/cal-6109-update-styles-of-charts-on-insights branch from 8e0e2bb to 03e79c9 Compare July 16, 2025 14:37
@eunjae-lee eunjae-lee marked this pull request as draft July 16, 2025 14:42
@eunjae-lee eunjae-lee marked this pull request as ready for review July 16, 2025 15:50
@dosubot dosubot bot added the 🧹 Improvements Improvements to existing features. Mostly UX/UI label Jul 16, 2025
Copy link
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

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

This is looking great! Nice job!

@eunjae-lee eunjae-lee enabled auto-merge (squash) July 17, 2025 13:52
@github-actions
Copy link
Contributor

github-actions bot commented Jul 17, 2025

E2E results are ready!

@eunjae-lee eunjae-lee merged commit 1878802 into main Jul 17, 2025
84 of 87 checks passed
@eunjae-lee eunjae-lee deleted the eunjae/cal-6109-update-styles-of-charts-on-insights branch July 17, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only 🧹 Improvements Improvements to existing features. Mostly UX/UI insights area: insights, analytics ready-for-e2e

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants