Skip to content

Comments

feat: cal ai promo design#23651

Merged
PeerRich merged 35 commits intomainfrom
refactor/cal-ai-design
Sep 14, 2025
Merged

feat: cal ai promo design#23651
PeerRich merged 35 commits intomainfrom
refactor/cal-ai-design

Conversation

@Udit-takkar
Copy link
Contributor

@Udit-takkar Udit-takkar commented Sep 6, 2025

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

I'll update the 'new' button in /workflows in a follow up PR. For now I have added basic version

Screenshot 2025-09-12 at 3 36 26 AM

Screen.Recording.2025-09-11.at.3.42.54.PM.mov
Screen.Recording.2025-09-11.at.3.42.26.PM.mov

Screenshot 2025-09-08 at 4 31 08 PM

Screenshot 2025-09-08 at 9 51 58 PM

Screenshot 2025-09-08 at 4 37 03 PM

Screen.Recording.2025-09-11.at.7.15.22.PM.mov

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A 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.
  • N/A I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 6, 2025

Walkthrough

Adds Cal.ai features across the codebase: introduces a new CSS variable --cal-bg-launch-dark and Tailwind color token launch-dark; expands English i18n keys for Cal.ai workflows and templates; adds UI components and hooks (CalAiBanner, WorkflowCreationDialog, useWorkflowCreation); adds a server-side page to create Cal AI workflow templates (wf-10, wf-11) with auth, permission, and rate-limit checks; propagates an isCalAi flag through workflow action options and select rendering; updates CAL_AI UI/state and agent-creation flow in WorkflowStepContainer and AgentConfigurationSheet; adds NewLaunchSidebarCard variant, new icons, and minor sheet, test, and styling tweaks.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: cal ai promo design" is concise and directly related to the primary changes in this PR, which introduce Cal AI promotional/design elements such as a banner, badges, new card variant, styles, and locale keys; it follows conventional commit style and is clear to a reader scanning history. It accurately reflects the main purpose without noisy details or file lists. It could be marginally more specific about scope (e.g., workflows/banner) but that is optional and not required for clarity.
Description Check ✅ Passed The PR description contains a high-level summary, multiple screenshots, and is thematically aligned with the changeset (Cal AI promo/design), so it is related to the code changes and passes this lenient check. The description does include placeholder issue references and omits concrete "How should this be tested?" steps, but it is not completely off-topic or unrelated.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/cal-ai-design

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d3e700c and 3ec425e.

⛔ Files ignored due to path filters (1)
  • apps/web/playwright/icons.e2e.ts-snapshots/icons--calcom-web-linux.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • apps/web/playwright/icons.e2e.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/playwright/icons.e2e.ts
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Production builds / Build API v2
  • GitHub Check: Production builds / Build Docs
  • GitHub Check: Production builds / Build Atoms
  • GitHub Check: Linters / lint
  • GitHub Check: Production builds / Build Web App
  • GitHub Check: Production builds / Build API v1
  • GitHub Check: Tests / Unit
  • GitHub Check: Type check / check-types

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.

@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Sep 6, 2025
@vercel
Copy link

vercel bot commented Sep 7, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Sep 14, 2025 2:42pm
cal-eu Ignored Ignored Sep 14, 2025 2:42pm

<div className="flex items-center justify-between">
<span className="w-full" data-testid={`select-option-${(props as unknown as ExtendedOption).value}`}>
{(props.data as unknown as ExtendedOption).isCalAi ? (
<Badge startIcon="sparkles" variant="purple" className="mr-1 hidden md:inline-flex">
Copy link
Member

Choose a reason for hiding this comment

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

@Udit-takkar I added the batch here as well

Screenshot 2025-09-10 at 12 05 44 PM

@Udit-takkar Udit-takkar marked this pull request as ready for review September 11, 2025 08:55
@Udit-takkar Udit-takkar requested a review from a team as a code owner September 11, 2025 08:55
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: 0

♻️ Duplicate comments (3)
packages/features/ee/workflows/components/WorkflowStepContainer.tsx (3)

273-316: Avoid getting stuck after failed auto-create; await mutation and drop console.log.

Same issue previously flagged; symptoms: CTA can remain disabled due to hasAutoCreated.current and errors aren’t caught from mutate. Use mutateAsync, await it, and reset flags on error. Remove the console.log.

-      if (isCreatingAgent.current || createAgentMutation.isPending) {
-        console.log("Agent creation already in progress, skipping...");
+      if (isCreatingAgent.current || createAgentMutation.isPending) {
         return;
       }
@@
-        if (updatedStep?.id) {
-          createAgentMutation.mutate({
+        if (updatedStep?.id) {
+          await createAgentMutation.mutateAsync({
             teamId,
             workflowStepId: updatedStep.id,
             ...(templateWorkflowId && { templateWorkflowId }),
           });
         } else {
           showToast(t("failed_to_get_workflow_step_id"), "error");
         }
       } catch (error) {
         console.error("Failed to create agent:", error);
         showToast(t("failed_to_create_agent"), "error");
+        // enable retry after failure
+        hasAutoCreated.current = false;
       } finally {
         isCreatingAgent.current = false;
       }

Outside selected lines (mutation options), also consider:

// add to createAgentMutation options
onSettled: (_data, error) => {
  if (error) hasAutoCreated.current = false;
},

321-346: Auto-create guard should not rely on hasAutoCreated to prevent retries.

Rely on isPending/isSuccess plus the in-flight isCreatingAgent ref. Don’t set hasAutoCreated before the async call completes; otherwise a failure blocks the CTA.

-    const shouldAutoCreate =
+    const shouldAutoCreate =
       autoCreateAgent === "true" &&
       templateWorkflowId &&
       step?.id &&
       step.action === WorkflowActions.CAL_AI_PHONE_CALL &&
       !stepAgentId &&
-      !hasAutoCreated.current &&
       !createAgentMutation.isPending &&
       !createAgentMutation.isSuccess;
@@
-    if (shouldAutoCreate && onSaveWorkflow) {
-      hasAutoCreated.current = true;
-      handleCreateAgent(templateWorkflowId);
-    }
+    if (shouldAutoCreate && onSaveWorkflow) {
+      handleCreateAgent(templateWorkflowId);
+    }

780-783: Don’t disable CTA with hasAutoCreated; base on pending state and in-flight ref.

Keeps the button retryable after failures and prevents accidental permanent disable.

-                  disabled={props.readOnly || isCreatingAgent.current || hasAutoCreated.current}
+                  disabled={props.readOnly || isCreatingAgent.current || createAgentMutation.isPending}
                   className="flex items-center justify-center"
                   onClick={() => handleCreateAgent()}
-                  loading={createAgentMutation.isPending || isCreatingAgent.current}>
+                  loading={createAgentMutation.isPending || isCreatingAgent.current}>
🧹 Nitpick comments (3)
packages/features/ee/workflows/components/WorkflowStepContainer.tsx (3)

193-197: Preserve URL hash when cleaning up params; optionally suppress duplicate toast in auto-flow.

  • Add url.hash to avoid dropping fragment on replace.
  • In autoCreateAgent flow, consider suppressing the extra success toast here for a single final toast UX.
-      router.replace(url.pathname + url.search);
+      router.replace(url.pathname + url.search + url.hash);

Outside selected lines (for clarity), gate the toast:

// Inside onSuccess before deleting params
const isAuto = new URL(window.location.href).searchParams.get("autoCreateAgent") === "true";
if (!isAuto) {
  showToast(t("agent_created_successfully"), "success");
}

258-258: Remove dead state or convert to ref.

_isSenderIsNeeded state is never read; only the setter is used to trigger re-renders. Either derive this from action or use a ref if you don’t need re-render semantics.


318-320: Minor: avoid capturing params; read at use-site.

Reading autoCreateAgent/templateWorkflowId directly inside onSuccess and the effect reduces stale-closure risk and keeps behavior consistent after navigation.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between abee5d1 and 8c637c3.

📒 Files selected for processing (2)
  • apps/web/public/static/locales/en/common.json (8 hunks)
  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/public/static/locales/en/common.json
🧰 Additional context used
📓 Path-based instructions (3)
**/*.tsx

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

Always use t() for text localization in frontend code; direct text embedding should trigger a warning

Files:

  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx
**/*.{ts,tsx}

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

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx
🧠 Learnings (7)
📓 Common learnings
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/WorkflowStepContainer.tsx:641-649
Timestamp: 2025-08-26T20:09:17.089Z
Learning: In packages/features/ee/workflows/components/WorkflowStepContainer.tsx, Cal.AI actions are intentionally filtered out/hidden for organization workflows when props.isOrganization is true. This restriction is by design per maintainer Udit-takkar in PR #22995, despite the broader goal of enabling Cal.AI self-serve.
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/AgentConfigurationSheet.tsx:348-371
Timestamp: 2025-08-15T00:27:33.280Z
Learning: In calcom/cal.com workflows and AI agent components, variable insertion follows a consistent pattern of directly transforming the input variable with toUpperCase() and replace(/ /g, "_") to create tokens like {VARIABLE_NAME}. The AgentConfigurationSheet.tsx implementation correctly follows this same pattern as WorkflowStepContainer.tsx, per maintainer Udit-takkar in PR #22995.
📚 Learning: 2025-08-26T20:09:17.089Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/WorkflowStepContainer.tsx:641-649
Timestamp: 2025-08-26T20:09:17.089Z
Learning: In packages/features/ee/workflows/components/WorkflowStepContainer.tsx, Cal.AI actions are intentionally filtered out/hidden for organization workflows when props.isOrganization is true. This restriction is by design per maintainer Udit-takkar in PR #22995, despite the broader goal of enabling Cal.AI self-serve.

Applied to files:

  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx
📚 Learning: 2025-08-15T00:27:33.280Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/AgentConfigurationSheet.tsx:348-371
Timestamp: 2025-08-15T00:27:33.280Z
Learning: In calcom/cal.com workflows and AI agent components, variable insertion follows a consistent pattern of directly transforming the input variable with toUpperCase() and replace(/ /g, "_") to create tokens like {VARIABLE_NAME}. The AgentConfigurationSheet.tsx implementation correctly follows this same pattern as WorkflowStepContainer.tsx, per maintainer Udit-takkar in PR #22995.

Applied to files:

  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx
📚 Learning: 2025-09-08T09:34:46.661Z
Learnt from: CarinaWolli
PR: calcom/cal.com#23421
File: packages/features/ee/workflows/components/AddActionDialog.tsx:171-174
Timestamp: 2025-09-08T09:34:46.661Z
Learning: In packages/features/ee/workflows/components/AddActionDialog.tsx, the actionOptions prop is guaranteed to never be empty according to maintainer CarinaWolli, so defensive checks for empty arrays are not necessary.

Applied to files:

  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx
📚 Learning: 2025-08-14T10:30:23.062Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/lib/schema.ts:41-43
Timestamp: 2025-08-14T10:30:23.062Z
Learning: In calcom/cal.com workflows with CAL_AI_PHONE_CALL actions, agentId can legitimately be null during initial setup. The workflow is: 1) save workflow to get step ID, 2) use step ID to create and link agent. Therefore, agentId should remain nullable in schemas to support this multi-step setup process (per maintainer Udit-takkar).

Applied to files:

  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx
📚 Learning: 2025-08-27T12:15:43.830Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/trpc/server/routers/viewer/aiVoiceAgent/testCall.handler.ts:41-44
Timestamp: 2025-08-27T12:15:43.830Z
Learning: In calcom/cal.com, the AgentService.getAgent() method in packages/features/calAIPhone/providers/retellAI/services/AgentService.ts does NOT include authorization checks - it only validates the agentId parameter and directly calls the repository without verifying user/team access. This contrasts with other methods like getAgentWithDetails() which properly use findByIdWithUserAccessAndDetails() for authorization. When reviewing updateToolsFromAgentId() calls, always verify both agent ownership and eventType ownership are checked.

Applied to files:

  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx
📚 Learning: 2025-08-08T09:27:23.896Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22919
File: packages/features/calAIPhone/providers/retellAI/services/AgentService.ts:195-216
Timestamp: 2025-08-08T09:27:23.896Z
Learning: In PR calcom/cal.com#22919, file packages/features/calAIPhone/providers/retellAI/services/AgentService.ts, the updateAgentConfiguration method intentionally does not persist the optional `name` parameter to the repository for now, per maintainer (Udit-takkar). Future reviews should not flag this unless requirements change.

Applied to files:

  • packages/features/ee/workflows/components/WorkflowStepContainer.tsx
🧬 Code graph analysis (1)
packages/features/ee/workflows/components/WorkflowStepContainer.tsx (1)
packages/features/ee/workflows/lib/actionHelperFunctions.ts (1)
  • isCalAIAction (37-39)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (3)
packages/features/ee/workflows/components/WorkflowStepContainer.tsx (3)

4-4: Good call adding useCallback.

Keeps handler identity stable and prevents unnecessary re-renders.


641-642: Nice: expose isCalAi to the select option.

Enables UI affordances (badges/labels) without re-deriving downstream.


766-767: Responsive layout improvement LGTM.

Better mobile stacking and alignment in the CAL.AI setup block.

@Udit-takkar
Copy link
Contributor Author

@keithwillcode i'll fix the e2e tests

@Udit-takkar Udit-takkar dismissed stale reviews from PeerRich and CarinaWolli via 7950ddb September 14, 2025 09:55
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: 0

🧹 Nitpick comments (2)
packages/features/ee/workflows/components/AgentConfigurationSheet.tsx (2)

711-735: Hide/disable “Test agent” when no agentId to avoid inert UI

Clicking opens state but the dialog won’t render without agentId, leading to a no‑op. Either hide the control or disable it when !agentId.

Apply one of the following minimal fixes (preferred: hide):

Option A — hide when unavailable:

-            <div className="mr-auto">
+            {agentId && (
+              <div className="mr-auto">
                 <Dropdown>
                   <DropdownMenuTrigger asChild>
                     <Button
                       color="secondary"
                       className="rounded-[10px]"
-                      disabled={readOnly}
+                      disabled={readOnly}
                       EndIcon="chevron-down">
                       {t("test_agent")}
                     </Button>
                   </DropdownMenuTrigger>
                   <DropdownMenuContent>
                     <DropdownMenuItem>
                       <DropdownItem
                         type="button"
                         StartIcon="monitor"
                         onClick={() => {
                           setIsWebCallDialogOpen(true);
                         }}>
                         {t("web_call")}
                       </DropdownItem>
                     </DropdownMenuItem>
                   </DropdownMenuContent>
                 </Dropdown>
-            </div>
+              </div>
+            )}

Option B — keep visible but disable the trigger:

-                    disabled={readOnly}
+                    disabled={readOnly || !agentId}

737-741: justify-center likely redundant on Button

Our Button styles already center content. Dropping this reduces class churn.

-            <Button
-              className="justify-center"
+            <Button
               type="button"
               color="secondary"
               onClick={() => onOpenChange(false)}>
...
-            <Button
-              type="button"
-              className="justify-center"
+            <Button
+              type="button"
               onClick={agentForm.handleSubmit(handleAgentUpdate)}

Also applies to: 744-749

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8c637c3 and 7950ddb.

📒 Files selected for processing (3)
  • apps/web/playwright/fixtures/workflows.ts (1 hunks)
  • packages/features/ee/workflows/components/AgentConfigurationSheet.tsx (2 hunks)
  • packages/features/ee/workflows/components/WorkflowCreationDialog.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/features/ee/workflows/components/WorkflowCreationDialog.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.ts

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

**/*.ts: For Prisma queries, only select data you need; never use include, always use select
Ensure the credential.key field is never returned from tRPC endpoints or APIs

Files:

  • apps/web/playwright/fixtures/workflows.ts
**/*.{ts,tsx}

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

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • apps/web/playwright/fixtures/workflows.ts
  • packages/features/ee/workflows/components/AgentConfigurationSheet.tsx
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • apps/web/playwright/fixtures/workflows.ts
  • packages/features/ee/workflows/components/AgentConfigurationSheet.tsx
**/*.tsx

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

Always use t() for text localization in frontend code; direct text embedding should trigger a warning

Files:

  • packages/features/ee/workflows/components/AgentConfigurationSheet.tsx
🧠 Learnings (5)
📓 Common learnings
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/WorkflowStepContainer.tsx:641-649
Timestamp: 2025-08-26T20:09:17.089Z
Learning: In packages/features/ee/workflows/components/WorkflowStepContainer.tsx, Cal.AI actions are intentionally filtered out/hidden for organization workflows when props.isOrganization is true. This restriction is by design per maintainer Udit-takkar in PR #22995, despite the broader goal of enabling Cal.AI self-serve.
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/AgentConfigurationSheet.tsx:348-371
Timestamp: 2025-08-15T00:27:33.280Z
Learning: In calcom/cal.com workflows and AI agent components, variable insertion follows a consistent pattern of directly transforming the input variable with toUpperCase() and replace(/ /g, "_") to create tokens like {VARIABLE_NAME}. The AgentConfigurationSheet.tsx implementation correctly follows this same pattern as WorkflowStepContainer.tsx, per maintainer Udit-takkar in PR #22995.
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/AgentConfigurationSheet.tsx:348-371
Timestamp: 2025-08-15T00:27:33.280Z
Learning: In calcom/cal.com, the variable insertion pattern in AgentConfigurationSheet.tsx follows the same implementation as existing workflow code. The current approach of building variable tokens directly from the input variable (with toUpperCase and space replacement) is the established pattern and doesn't need to be changed for locale-agnostic concerns, per maintainer Udit-takkar.
📚 Learning: 2025-08-15T00:27:33.280Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/AgentConfigurationSheet.tsx:348-371
Timestamp: 2025-08-15T00:27:33.280Z
Learning: In calcom/cal.com, the variable insertion pattern in AgentConfigurationSheet.tsx follows the same implementation as existing workflow code. The current approach of building variable tokens directly from the input variable (with toUpperCase and space replacement) is the established pattern and doesn't need to be changed for locale-agnostic concerns, per maintainer Udit-takkar.

Applied to files:

  • packages/features/ee/workflows/components/AgentConfigurationSheet.tsx
📚 Learning: 2025-08-15T00:27:33.280Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/AgentConfigurationSheet.tsx:348-371
Timestamp: 2025-08-15T00:27:33.280Z
Learning: In calcom/cal.com workflows and AI agent components, variable insertion follows a consistent pattern of directly transforming the input variable with toUpperCase() and replace(/ /g, "_") to create tokens like {VARIABLE_NAME}. The AgentConfigurationSheet.tsx implementation correctly follows this same pattern as WorkflowStepContainer.tsx, per maintainer Udit-takkar in PR #22995.

Applied to files:

  • packages/features/ee/workflows/components/AgentConfigurationSheet.tsx
📚 Learning: 2025-08-08T09:29:11.681Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22919
File: packages/features/calAIPhone/interfaces/AIPhoneService.interface.ts:118-143
Timestamp: 2025-08-08T09:29:11.681Z
Learning: In calcom/cal.com PR #22919, packages/features/calAIPhone/interfaces/AIPhoneService.interface.ts (TypeScript), the AIPhoneServiceAgentListItem is required to include user.email in listAgents responses (per maintainer Udit-takkar). Future reviews should not flag this as unnecessary PII unless requirements change.

Applied to files:

  • packages/features/ee/workflows/components/AgentConfigurationSheet.tsx
📚 Learning: 2025-08-08T09:27:23.896Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22919
File: packages/features/calAIPhone/providers/retellAI/services/AgentService.ts:195-216
Timestamp: 2025-08-08T09:27:23.896Z
Learning: In PR calcom/cal.com#22919, file packages/features/calAIPhone/providers/retellAI/services/AgentService.ts, the updateAgentConfiguration method intentionally does not persist the optional `name` parameter to the repository for now, per maintainer (Udit-takkar). Future reviews should not flag this unless requirements change.

Applied to files:

  • packages/features/ee/workflows/components/AgentConfigurationSheet.tsx
🧬 Code graph analysis (1)
packages/features/ee/workflows/components/AgentConfigurationSheet.tsx (2)
packages/ui/components/dropdown/Dropdown.tsx (5)
  • Dropdown (12-12)
  • DropdownMenuTrigger (15-26)
  • DropdownMenuContent (34-51)
  • DropdownMenuItem (63-71)
  • DropdownItem (161-181)
packages/ui/components/button/Button.tsx (1)
  • Button (221-349)
🔇 Additional comments (3)
apps/web/playwright/fixtures/workflows.ts (1)

28-29: Make creation path configurable and add explicit waits to reduce flakiness.

Hard-coding "scratch" narrows coverage (can’t exercise Cal.ai template) and can flake if the dialog renders slowly or under different flags/roles — add a startFrom prop (default "scratch") and explicit expects before clicks.

Location: apps/web/playwright/fixtures/workflows.ts — lines 28–29

-    await page.getByTestId(`workflow-option-card-scratch`).click();
-    await page.getByTestId("continue-button").click();
+    const optionTestId =
+      startFrom === "calai" ? "workflow-option-card-calai-template" : "workflow-option-card-scratch";
+    const optionCard = page.getByTestId(optionTestId);
+    await expect(optionCard).toBeVisible();
+    await optionCard.click();
+    const continueBtn = page.getByTestId("continue-button");
+    await expect(continueBtn).toBeEnabled();
+    await continueBtn.click();

Additions (illustrative — adjust exact testId if different):

// extend props
type CreateWorkflowProps = {
  name?: string;
  isTeam?: true;
  trigger?: WorkflowTriggerEvents;
  startFrom?: "scratch" | "calai";
};

// destructure with default
const { name, isTeam, trigger, startFrom = "scratch" } = props;

I could not find a "workflow-option-card-calai-template" test id in the repo — confirm the Cal.ai card test id before applying. Search example:

rg -n -C2 'workflow-option-card-[A-Za-z0-9_-]+' || true
packages/features/ee/workflows/components/AgentConfigurationSheet.tsx (2)

910-910: Theming LGTM

Switching bg-whitebg-default aligns with tokenized theming and dark‑mode support.


711-735: ```shell
#!/bin/bash
set -euo pipefail

echo "PWD: $(pwd)"
echo

echo "1) Find AgentConfigurationSheet.tsx"
FILE=$(find . -type f -iname 'AgentConfigurationSheet.tsx' -print -quit || true)
if [ -n "$FILE" ]; then
echo "Found: $FILE"
echo
echo "2) Print lines 680-760 of the file:"
awk 'NR>=680 && NR<=760{printf("%6d: %s\n", NR, $0)}' "$FILE" || true
else
echo "AgentConfigurationSheet.tsx not found. Listing .tsx files under packages/features (up to 200):"
find packages/features -type f -iname '*.tsx' -maxdepth 6 -print | sed -n '1,200p' || true
fi

echo
echo "3) Search for translation keys and test actions (test_agent, web_call, phone_call):"
grep -RIn --exclude-dir=node_modules -E 'test_agent|web_call|phone_call' . || true

echo
echo "4) Search for DropdownItem usages:"
grep -RIn --exclude-dir=node_modules -E 'DropdownItem' . || true

echo
echo "5) Search for StartIcon props matching monitor/phone/call:"
grep -RIn --exclude-dir=node_modules -E 'StartIcon\s*=' . | grep -Ei 'monitor|phone|telephone|call' || true

echo
echo "6) Search for phone-number / phone card components (PhoneNumber, PhoneCard, PhoneNumberCard):"
grep -RIn --exclude-dir=node_modules -E 'PhoneNumber|PhoneCard|PhoneNumberCard|phone-card|phoneNumber' . || true

echo
echo "Done."


</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

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

Caution

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

⚠️ Outside diff range comments (1)
apps/web/playwright/icons.e2e.ts (1)

5-8: Force a deterministic visual environment.

Locks down common flake sources across CI.

 test.use({
   viewport: { width: 1265, height: 1320 }, // Match the expected dimensions
+  colorScheme: "light",
+  deviceScaleFactor: 1,
+  timezoneId: "UTC",
+  locale: "en-US",
 });
🧹 Nitpick comments (1)
apps/web/playwright/icons.e2e.ts (1)

12-15: Scope the screenshot to the icon gallery (optional).

Reduces noise from headers/nav/footers if they change independently.

-  await expect(page).toHaveScreenshot("icons.png", {
-    maxDiffPixelRatio: 0.05,
-    animations: "disabled",
-    fullPage: true,
-  });
+  const gallery = page.locator("main"); // replace with a specific [data-testid="icons-gallery"] if available
+  await expect(gallery).toHaveScreenshot("icons.png", {
+    maxDiffPixelRatio: 0.05,
+    animations: "disabled",
+  });
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7950ddb and c883f44.

⛔ Files ignored due to path filters (1)
  • apps/web/playwright/icons.e2e.ts-snapshots/icons--calcom-web-darwin.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • apps/web/playwright/icons.e2e.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

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

**/*.ts: For Prisma queries, only select data you need; never use include, always use select
Ensure the credential.key field is never returned from tRPC endpoints or APIs

Files:

  • apps/web/playwright/icons.e2e.ts
**/*.{ts,tsx}

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

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • apps/web/playwright/icons.e2e.ts
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • apps/web/playwright/icons.e2e.ts
🧠 Learnings (1)
📓 Common learnings
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/WorkflowStepContainer.tsx:641-649
Timestamp: 2025-08-26T20:09:17.089Z
Learning: In packages/features/ee/workflows/components/WorkflowStepContainer.tsx, Cal.AI actions are intentionally filtered out/hidden for organization workflows when props.isOrganization is true. This restriction is by design per maintainer Udit-takkar in PR #22995, despite the broader goal of enabling Cal.AI self-serve.
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/AgentConfigurationSheet.tsx:348-371
Timestamp: 2025-08-15T00:27:33.280Z
Learning: In calcom/cal.com workflows and AI agent components, variable insertion follows a consistent pattern of directly transforming the input variable with toUpperCase() and replace(/ /g, "_") to create tokens like {VARIABLE_NAME}. The AgentConfigurationSheet.tsx implementation correctly follows this same pattern as WorkflowStepContainer.tsx, per maintainer Udit-takkar in PR #22995.
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/features/ee/workflows/components/AgentConfigurationSheet.tsx:348-371
Timestamp: 2025-08-15T00:27:33.280Z
Learning: In calcom/cal.com, the variable insertion pattern in AgentConfigurationSheet.tsx follows the same implementation as existing workflow code. The current approach of building variable tokens directly from the input variable (with toUpperCase and space replacement) is the established pattern and doesn't need to be changed for locale-agnostic concerns, per maintainer Udit-takkar.
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
apps/web/playwright/icons.e2e.ts (1)

12-15: Don’t widen visual diff tolerance; stabilize the capture and update the golden instead.

0.15 risks hiding real icon regressions—use a stricter ratio, wait for fonts/network, disable animations, and re-record the snapshot.

File: apps/web/playwright/icons.e2e.ts (lines 12–15)

 test("Icons render properly", async ({ page }) => {
   await page.goto("/icons");
+  await page.waitForLoadState("networkidle");
+  // Wait for fonts to settle to avoid antialiasing/layout diffs
+  await page.evaluate(() => (document as any).fonts?.ready);
   await expect(page).toHaveScreenshot("icons.png", {
-    maxDiffPixelRatio: 0.15,
+    maxDiffPixelRatio: 0.05,
+    animations: "disabled",
     fullPage: true,
   });
 });

Re-record snapshot: pnpm playwright test apps/web/playwright/icons.e2e.ts --update-snapshots

@PeerRich PeerRich merged commit cfadd2e into main Sep 14, 2025
36 of 37 checks passed
@PeerRich PeerRich deleted the refactor/cal-ai-design branch September 14, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai area: AI, cal.ai core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ✨ feature New feature or request High priority Created by Linear-GitHub Sync ready-for-e2e size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants