Skip to content

Comments

feat: add Flappy Bird game feature#22297

Closed
Devanshusharma2005 wants to merge 37 commits intocalcom:mainfrom
Devanshusharma2005:feat/flappy-bird-integration
Closed

feat: add Flappy Bird game feature#22297
Devanshusharma2005 wants to merge 37 commits intocalcom:mainfrom
Devanshusharma2005:feat/flappy-bird-integration

Conversation

@Devanshusharma2005
Copy link
Contributor

@Devanshusharma2005 Devanshusharma2005 commented Jul 7, 2025

What does this PR do?

Added flappy bird game feature to cal video.
Added a new enableFlappyBirdGame field to the CalVideoSettings schema and model
Created a database migration for the new field
Added the toggle to enable/disable the game in the event type setup page
Created a new FlappyBirdGame component with minimize and close functionality
Integrated the game into the video waiting room component
Added translations for the new feature
Added automatic hiding of the game when participants join the meeting

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Video Demo (if applicable):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

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?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

Summary by cubic

Added a Flappy Bird game to the video waiting room, with an option to enable or disable it in event settings.

  • New Features
    • Added a toggle in event type setup to enable the Flappy Bird game.
    • Integrated the game into the waiting room with minimize and close options.
    • Game hides automatically when participants join.
    • Added translations and database support for the new setting.

@Devanshusharma2005 Devanshusharma2005 requested review from a team July 7, 2025 12:59
@Devanshusharma2005 Devanshusharma2005 requested a review from a team as a code owner July 7, 2025 12:59
@vercel
Copy link

vercel bot commented Jul 7, 2025

@Devanshusharma2005 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot requested a review from a team July 7, 2025 12:59
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jul 7, 2025
@github-actions github-actions bot added ❗️ migrations contains migration files and removed community Created by Linear-GitHub Sync labels Jul 7, 2025
@keithwillcode keithwillcode added the community-interns The team responsible for reviewing, testing and shipping low/medium community PRs label Jul 7, 2025
@graphite-app
Copy link

graphite-app bot commented Jul 7, 2025

Graphite Automations

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

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

"Add community label" took an action on this PR • (07/07/25)

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

@dosubot dosubot bot added cal video i18n area: i18n, translations ✨ feature New feature or request labels Jul 7, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic found 4 issues across 12 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@Devanshusharma2005 Devanshusharma2005 marked this pull request as draft July 7, 2025 13:09
@Devanshusharma2005 Devanshusharma2005 marked this pull request as ready for review July 8, 2025 04:00
@Devanshusharma2005 Devanshusharma2005 marked this pull request as draft July 8, 2025 04:00
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic found 2 issues across 12 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@Devanshusharma2005 Devanshusharma2005 marked this pull request as ready for review July 8, 2025 12:35
@dosubot dosubot bot added the event-types area: event types, event-types label Jul 8, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic found 1 issue across 16 files. Review it in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@Udit-takkar Udit-takkar closed this Jul 9, 2025
@Udit-takkar Udit-takkar reopened this Jul 9, 2025
@CarinaWolli CarinaWolli modified the milestones: v5.6, v5.7 Aug 18, 2025
@Devanshusharma2005 Devanshusharma2005 dismissed Udit-takkar’s stale review August 27, 2025 09:40

The merge-base changed after approval.

@Devanshusharma2005 Devanshusharma2005 force-pushed the feat/flappy-bird-integration branch from 673054d to 250727f Compare August 27, 2025 09:42
auto-merge was automatically disabled September 3, 2025 13:02

Pull request was closed

@dosubot dosubot bot removed this from the v5.7 milestone Sep 3, 2025
- Resolved conflicts in 7 files:
  - apps/api/v2/swagger/documentation.json
  - apps/web/public/static/locales/en/common.json
  - docs/api-reference/v2/openapi.json
  - packages/features/eventtypes/components/locations/Locations.tsx
  - packages/features/eventtypes/lib/types.ts
  - packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts
  - packages/prisma/zod/custom/eventtype.ts

- Integrated Flappy Bird game feature with main branch video settings structure
- Added enableFlappyBirdGame to CalVideoSettings interface and component
- Preserved all main branch functionality while adding flappy bird integration
- Updated localization strings for flappy bird game feature
- Fixed sessionStorage import issue in NavigationItem.tsx
- Removed duplicate enableAutomaticRecordingForOrganizer
- Removed duplicate enableAutomaticTranscription
- Removed duplicate disableTranscriptionForGuests
- Removed duplicate disableTranscriptionForOrganizer
- This resolves TypeScript compilation errors from merge conflicts
@github-actions github-actions bot removed the Stale label Sep 4, 2025
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/trpc/server/routers/viewer/eventTypes/update.handler.ts (1)

132-143: Trim calVideoSettings selection to only what’s used

In this handler you only check for existence of eventType.calVideoSettings (Line 632). Consider selecting just id to reduce payload and CPU. If other fields aren’t consumed downstream, this keeps the query lean.

Proposed diff:

       calVideoSettings: {
-        select: {
-          disableRecordingForOrganizer: true,
-          disableRecordingForGuests: true,
-          enableAutomaticTranscription: true,
-          enableAutomaticRecordingForOrganizer: true,
-          disableTranscriptionForGuests: true,
-          disableTranscriptionForOrganizer: true,
-          redirectUrlOnExit: true,
-          enableFlappyBirdGame: true,
-        },
+        select: { id: true },
       },

Before applying, verify no consumer relies on those fields from this handler’s return.

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

3535-3535: Copy tweak (optional): clarify context

Consider clarifying that the waiting is for others to join the call.

Proposed diff:

-  "play_while_you_wait": "Play while you wait",
+  "play_while_you_wait": "Play while you wait for others to join",
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • 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 068e726 and 1649482.

📒 Files selected for processing (4)
  • apps/api/v2/swagger/documentation.json (1 hunks)
  • apps/web/public/static/locales/en/common.json (1 hunks)
  • packages/prisma/schema.prisma (1 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/update.handler.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/prisma/schema.prisma
  • apps/api/v2/swagger/documentation.json
🧰 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:

  • packages/trpc/server/routers/viewer/eventTypes/update.handler.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:

  • packages/trpc/server/routers/viewer/eventTypes/update.handler.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:

  • packages/trpc/server/routers/viewer/eventTypes/update.handler.ts
🧠 Learnings (2)
📚 Learning: 2025-08-17T22:00:16.329Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/trpc/server/routers/viewer/aiVoiceAgent/_router.ts:117-126
Timestamp: 2025-08-17T22:00:16.329Z
Learning: In calcom/cal.com PR #22995, packages/trpc/server/routers/viewer/aiVoiceAgent/_router.ts, the enabled input parameter in the update endpoint is intentionally not forwarded to aiService.updateAgentConfiguration() as the enabled/disabled agent functionality is not required at the moment (per maintainer Udit-takkar). Future reviews should not flag this as missing functionality unless requirements change.

Applied to files:

  • packages/trpc/server/routers/viewer/eventTypes/update.handler.ts
📚 Learning: 2025-08-21T13:44:06.805Z
Learnt from: supalarry
PR: calcom/cal.com#23217
File: apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/output-event-types.service.ts:93-94
Timestamp: 2025-08-21T13:44:06.805Z
Learning: In apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.ts, repository functions that use explicit Prisma select clauses (like getEventTypeWithSeats) are used for specific purposes and don't need to include all EventType fields like bookingRequiresAuthentication. These methods don't feed into the general OutputEventTypesService_2024_06_14 flow.

Applied to files:

  • packages/trpc/server/routers/viewer/eventTypes/update.handler.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). (3)
  • GitHub Check: Type check / check-types
  • GitHub Check: Tests / Unit
  • GitHub Check: Linters / lint
🔇 Additional comments (3)
packages/trpc/server/routers/viewer/eventTypes/update.handler.ts (2)

141-142: Add enableFlappyBirdGame to select — looks correct

Field is properly added to the calVideoSettings.select and will flow through the handler context as expected.


618-623: Confirm upsert mapping includes enableFlappyBirdGame end-to-end – Verified that

  • CalVideoSettingsRepository DTO declares enableFlappyBirdGame?: boolean | null and both upsert paths set it via calVideoSettings.enableFlappyBirdGame ?? false.
  • Prisma schema defines enableFlappyBirdGame Boolean @default(false), and the migration adds the column with NOT NULL DEFAULT false.
  • Zod schemas in trpc and prisma/zod mark it optional().nullable()/nullish() and handlers default to false on create.
apps/web/public/static/locales/en/common.json (1)

3531-3535: New i18n keys for Flappy Bird — looks good

Keys are clearly named, consistent with existing conventions, and placed above the sentinel line to avoid merge conflicts.

Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

Type checks are failing

@Devanshusharma2005
Copy link
Contributor Author

Type checks are failing

fixed.!

- Added enableFlappyBirdGame to createCalVideoSettings method type and data
- Fixed CalVideoSettings component to remove Badge from flappy bird toggle
- This resolves the 'something went wrong' error on event types page
- Enables proper creation and updating of event types with flappy bird settings
Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

There are some bugs in this PR

Udit-takkar
Udit-takkar previously approved these changes Sep 5, 2025
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 (5)
packages/lib/server/repository/eventTypeRepository.ts (1)

722-733: Expose enableFlappyBirdGame in CompleteEventTypeSelect — looks good; consider de-duping the select

Selection is correct. To avoid field drift across repositories, centralize the CalVideoSettings select in a shared constant and reuse it here and elsewhere.

Apply within this segment:

-      calVideoSettings: {
-        select: {
-          disableRecordingForGuests: true,
-          disableRecordingForOrganizer: true,
-          enableAutomaticTranscription: true,
-          enableAutomaticRecordingForOrganizer: true,
-          disableTranscriptionForGuests: true,
-          disableTranscriptionForOrganizer: true,
-          redirectUrlOnExit: true,
-          enableFlappyBirdGame: true,
-        },
-      },
+      calVideoSettings: { select: CAL_VIDEO_SETTINGS_SELECT },

Add once near other selects (e.g., after hashedLinkSelect):

const CAL_VIDEO_SETTINGS_SELECT = {
  disableRecordingForGuests: true,
  disableRecordingForOrganizer: true,
  enableAutomaticTranscription: true,
  enableAutomaticRecordingForOrganizer: true,
  disableTranscriptionForGuests: true,
  disableTranscriptionForOrganizer: true,
  redirectUrlOnExit: true,
  enableFlappyBirdGame: true,
} satisfies Prisma.CalVideoSettingsSelect;
packages/features/eventtypes/components/locations/CalVideoSettings.tsx (1)

15-19: Prop type nullability — OK; align base type to drop the local extension

This local extension is fine, but since the form writes null via setValueAs, prefer updating the base CalVideoSettings type to accept string | null for redirectUrlOnExit so this component can use CalVideoSettingsType | null directly.

Proposed change outside this file (packages/features/eventtypes/lib/types.ts):

 export interface CalVideoSettings {
   disableRecordingForOrganizer?: boolean;
   disableRecordingForGuests?: boolean;
   enableAutomaticTranscription?: boolean;
   enableAutomaticRecordingForOrganizer?: boolean;
   disableTranscriptionForGuests?: boolean;
   disableTranscriptionForOrganizer?: boolean;
-  redirectUrlOnExit?: string;
+  redirectUrlOnExit?: string | null;
   enableFlappyBirdGame?: boolean;
 }

Then here:

-const CalVideoSettings = ({
-  calVideoSettings,
-}: {
-  calVideoSettings: (CalVideoSettingsType & { redirectUrlOnExit?: string | null }) | null;
-}) => {
+const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings: CalVideoSettingsType | null }) => {
packages/features/eventtypes/components/locations/Locations.tsx (3)

385-391: Localize link text per guidelines.

Replace hardcoded "here" with t("here") to comply with i18n rules for TSX.

-                  <Link
-                    key="event_type_requires_google_calendar"
-                    className="cursor-pointer text-blue-500 underline"
-                    href="/apps/google-calendar">
-                    here
-                  </Link>,
+                  <Link
+                    key="event_type_requires_google_calendar"
+                    className="cursor-pointer text-blue-500 underline"
+                    href="/apps/google-calendar"
+                  >
+                    {t("here")}
+                  </Link>,

426-433: Localize "App Store" label.

Avoid embedded strings in TSX; use t().

-              <Link
-                key="cant_find_the_right_conferencing_app_visit_our_app_store"
-                className="cursor-pointer text-blue-500 underline"
-                href="/apps/categories/conferencing">
-                App Store
-              </Link>,
+              <Link
+                key="cant_find_the_right_conferencing_app_visit_our_app_store"
+                className="cursor-pointer text-blue-500 underline"
+                href="/apps/categories/conferencing"
+              >
+                {t("app_store")}
+              </Link>,

175-176: Avoid magic string for Cal Video detection.

Consider centralizing "integrations:daily" as a constant from @calcom/app-store/locations (if available) to prevent drift and aid refactors.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • 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 1649482 and 1297d9f.

📒 Files selected for processing (7)
  • apps/api/v2/swagger/documentation.json (1 hunks)
  • apps/web/public/static/locales/en/common.json (1 hunks)
  • docs/api-reference/v2/openapi.json (1 hunks)
  • packages/features/eventtypes/components/locations/CalVideoSettings.tsx (2 hunks)
  • packages/features/eventtypes/components/locations/Locations.tsx (2 hunks)
  • packages/lib/server/repository/eventTypeRepository.ts (2 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/api/v2/swagger/documentation.json
  • docs/api-reference/v2/openapi.json
  • apps/web/public/static/locales/en/common.json
🧰 Additional context used
📓 Path-based instructions (5)
**/*.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:

  • packages/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts
  • packages/lib/server/repository/eventTypeRepository.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:

  • packages/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts
  • packages/features/eventtypes/components/locations/CalVideoSettings.tsx
  • packages/lib/server/repository/eventTypeRepository.ts
  • packages/features/eventtypes/components/locations/Locations.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/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts
  • packages/features/eventtypes/components/locations/CalVideoSettings.tsx
  • packages/lib/server/repository/eventTypeRepository.ts
  • packages/features/eventtypes/components/locations/Locations.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/eventtypes/components/locations/CalVideoSettings.tsx
  • packages/features/eventtypes/components/locations/Locations.tsx
**/*Repository.ts

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

Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

Files:

  • packages/lib/server/repository/eventTypeRepository.ts
🧠 Learnings (6)
📚 Learning: 2025-08-17T22:00:16.329Z
Learnt from: Udit-takkar
PR: calcom/cal.com#22995
File: packages/trpc/server/routers/viewer/aiVoiceAgent/_router.ts:117-126
Timestamp: 2025-08-17T22:00:16.329Z
Learning: In calcom/cal.com PR #22995, packages/trpc/server/routers/viewer/aiVoiceAgent/_router.ts, the enabled input parameter in the update endpoint is intentionally not forwarded to aiService.updateAgentConfiguration() as the enabled/disabled agent functionality is not required at the moment (per maintainer Udit-takkar). Future reviews should not flag this as missing functionality unless requirements change.

Applied to files:

  • packages/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts
📚 Learning: 2025-08-27T13:32:46.887Z
Learnt from: supalarry
PR: calcom/cal.com#23364
File: apps/api/v2/src/ee/event-types/event-types_2024_06_14/transformers/internal-to-api/internal-to-api.spec.ts:295-296
Timestamp: 2025-08-27T13:32:46.887Z
Learning: In calcom/cal.com, when transforming booking fields from internal to API format, tests in organizations-event-types.e2e-spec.ts already expect name field label and placeholder to be empty strings ("") rather than undefined. PR changes that set these to explicit empty strings are typically fixing implementation to match existing test expectations rather than breaking changes.

Applied to files:

  • packages/features/eventtypes/components/locations/CalVideoSettings.tsx
  • packages/features/eventtypes/components/locations/Locations.tsx
📚 Learning: 2025-08-21T13:44:06.805Z
Learnt from: supalarry
PR: calcom/cal.com#23217
File: apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/output-event-types.service.ts:93-94
Timestamp: 2025-08-21T13:44:06.805Z
Learning: In apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.ts, repository functions that use explicit Prisma select clauses (like getEventTypeWithSeats) are used for specific purposes and don't need to include all EventType fields like bookingRequiresAuthentication. These methods don't feed into the general OutputEventTypesService_2024_06_14 flow.

Applied to files:

  • packages/lib/server/repository/eventTypeRepository.ts
📚 Learning: 2025-09-03T11:54:05.409Z
Learnt from: supalarry
PR: calcom/cal.com#23514
File: apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts:579-582
Timestamp: 2025-09-03T11:54:05.409Z
Learning: In calcom/cal.com bookings repository methods, when Prisma select uses `eventType: true`, all eventType fields including seatsShowAttendees are automatically included in the selection. Explicit field selection is not required when using `true` for nested relations.

Applied to files:

  • packages/lib/server/repository/eventTypeRepository.ts
📚 Learning: 2025-09-03T11:54:05.409Z
Learnt from: supalarry
PR: calcom/cal.com#23514
File: apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts:579-582
Timestamp: 2025-09-03T11:54:05.409Z
Learning: In calcom/cal.com bookings repository methods, when Prisma include uses `eventType: true`, all eventType fields including seatsShowAttendees are automatically included in the selection. Explicit field selection is not required when using `true` for nested relations.

Applied to files:

  • packages/lib/server/repository/eventTypeRepository.ts
📚 Learning: 2025-08-29T22:57:30.382Z
Learnt from: bandhan-majumder
PR: calcom/cal.com#23454
File: packages/features/form-builder/FormBuilder.tsx:11-11
Timestamp: 2025-08-29T22:57:30.382Z
Learning: FormBuilder.tsx in packages/features/form-builder/ does not have "use client" directive at the top despite using client-side React hooks and event handlers, which suggests it should be a client component.

Applied to files:

  • packages/features/eventtypes/components/locations/Locations.tsx
🧬 Code graph analysis (2)
packages/features/eventtypes/components/locations/CalVideoSettings.tsx (3)
packages/features/eventtypes/lib/types.ts (2)
  • CalVideoSettings (241-250)
  • FormValues (78-175)
packages/platform/atoms/index.ts (1)
  • useIsPlatform (7-7)
packages/ui/components/badge/index.ts (1)
  • UpgradeTeamsBadge (2-2)
packages/features/eventtypes/components/locations/Locations.tsx (1)
packages/features/eventtypes/lib/types.ts (1)
  • CalVideoSettings (241-250)
⏰ 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). (6)
  • GitHub Check: Production builds / Build Web App
  • GitHub Check: Tests / Unit
  • GitHub Check: Production builds / Build API v2
  • GitHub Check: Production builds / Build Atoms
  • GitHub Check: Production builds / Build API v1
  • GitHub Check: Type check / check-types
🔇 Additional comments (4)
packages/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts (1)

48-59: Propagate enableFlappyBirdGame on duplicate — LGTM

The new field is correctly selected under calVideoSettings so it will be preserved when duplicating an event type.

packages/lib/server/repository/eventTypeRepository.ts (1)

1064-1073: Org admin view: enableFlappyBirdGame added — LGTM

Consistent with the user view selection; no concerns.

packages/features/eventtypes/components/locations/CalVideoSettings.tsx (1)

127-142: New toggle for Flappy Bird — LGTM

Uses t() correctly, binds via Controller, and follows existing toggle patterns with UpgradeTeamsBadge.

packages/features/eventtypes/components/locations/Locations.tsx (1)

5-5: LGTM: useFieldArray import is appropriate.

Matches the usage below; no issues.

EventTypeSetupProps,
FormValues,
} from "@calcom/features/eventtypes/lib/types";
import type { LocationFormValues, EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types";
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Type import realignment looks good; verify no lingering FormValues usages.

Ensure all references to the old FormValues type were removed/updated across the feature.

Run to confirm no remaining FormValues references:


🏁 Script executed:

#!/bin/bash
rg -nP --type=ts --type=tsx -C1 '\bFormValues\b' packages/features/eventtypes

Length of output: 107


🏁 Script executed:

#!/bin/bash
rg -nP -g '*.ts' -g '*.tsx' -C1 '\bFormValues\b' packages/features/eventtypes

Length of output: 29317


Replace remaining FormValues usages with specific form value types
The grep search uncovered numerous imports and useFormContext<FormValues>() usages still scattered across packages/features/eventtypes/components (e.g. EventWorkflowsTab.tsx, RequiresConfirmationController.tsx, CustomEventTypeModal.tsx, EventSetupTab.tsx, EventAdvancedTab.tsx, EventAvailabilityTab.tsx, and many more). Remove these generic FormValues references and update each component to use the appropriate specific types exported from packages/features/eventtypes/lib/types.ts (such as LocationFormValues, other subset types).

🤖 Prompt for AI Agents
In packages/features/eventtypes/components/locations/Locations.tsx around line
11, replace any remaining generic FormValues usage with the specific
LocationFormValues type: update the import list to include LocationFormValues
(if not already) and change useFormContext<FormValues>() and any prop/type
annotations that reference the generic FormValues to use LocationFormValues
instead; ensure all handlers, selectors, and default value references expect the
LocationFormValues shape; repeat this pattern for other components found by your
grep (EventWorkflowsTab, RequiresConfirmationController, CustomEventTypeModal,
EventSetupTab, EventAdvancedTab, EventAvailabilityTab, etc.) by importing the
correct subset types from packages/features/eventtypes/lib/types.ts and using
them in useFormContext<> and type annotations.

Comment on lines +256 to +270
{isCalVideo && !isPlatform && (
<CalVideoSettings calVideoSettings={eventType.calVideoSettings} />
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Pass calVideoSettings defensively and confirm RHF wiring.

eventType.calVideoSettings may be undefined. Prefer a safe default and ensure CalVideoSettings writes to the RHF path (calVideoSettings.*), not just local state.

Apply:

-                <CalVideoSettings calVideoSettings={eventType.calVideoSettings} />
+                <CalVideoSettings calVideoSettings={eventType.calVideoSettings ?? {}} />

Then verify CalVideoSettings reads/writes RHF state:


🏁 Script executed:

#!/bin/bash
rg -nC2 --type=ts --type=tsx 'CalVideoSettings.*Props|useFormContext|calVideoSettings' packages/features/eventtypes/components/locations/CalVideoSettings.tsx

Length of output: 187


🏁 Script executed:

#!/bin/bash
# Search for component implementation and prop definitions
rg -nC3 'CalVideoSettings(' -g 'packages/features/eventtypes/components/locations/CalVideoSettings.tsx'
rg -nC3 'interface.*Props' -g 'packages/features/eventtypes/components/locations/CalVideoSettings.tsx'
# Verify usage of calVideoSettings within component
rg -nC3 'calVideoSettings' -g 'packages/features/eventtypes/components/locations/CalVideoSettings.tsx'
# Check for React Hook Form wiring
rg -nC3 'useFormContext' -g 'packages/features/eventtypes/components/locations/CalVideoSettings.tsx'

Length of output: 11190


🏁 Script executed:

#!/bin/bash
# Locate definition of CalVideoSettingsType to verify optionality of its fields
rg -R "CalVideoSettingsType" -n packages/features/eventtypes/lib/types.ts

Length of output: 478


🏁 Script executed:

#!/bin/bash
# Locate CalVideoSettingsType definition
rg -n "CalVideoSettingsType" -g "packages/features/eventtypes/lib/types.ts"
# Locate EventType definition and its calVideoSettings property
rg -nC3 "EventType" -g "packages/features/eventtypes/lib/types.ts"
rg -nC3 "calVideoSettings" -g "packages/features/eventtypes/lib/types.ts"
# Inspect Locations.tsx Props for eventType type
rg -nC3 "interface.*Props" -g "packages/features/eventtypes/components/locations/Locations.tsx"

Length of output: 6302


Use null as a safe default for calVideoSettings

Change the component invocation to:

- <CalVideoSettings calVideoSettings={eventType.calVideoSettings} />
+ <CalVideoSettings calVideoSettings={eventType.calVideoSettings ?? null} />

CalVideoSettings already uses React Hook Form’s Controller on calVideoSettings.*, so the RHF wiring is correct.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{isCalVideo && !isPlatform && (
<CalVideoSettings calVideoSettings={eventType.calVideoSettings} />
)}
{isCalVideo && !isPlatform && (
<CalVideoSettings calVideoSettings={eventType.calVideoSettings ?? null} />
)}
🤖 Prompt for AI Agents
In packages/features/eventtypes/components/locations/Locations.tsx around lines
256-258, the CalVideoSettings prop should use null as a safe default so RHF
Controller paths like calVideoSettings.* exist; change the invocation to pass
eventType.calVideoSettings ?? null (i.e.,
calVideoSettings={eventType.calVideoSettings ?? null}) so undefined is replaced
with null before rendering CalVideoSettings.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

E2E results are ready!

@keithwillcode
Copy link
Contributor

Closing for now since stale + conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cal video community-interns The team responsible for reviewing, testing and shipping low/medium community PRs event-types area: event types, event-types ✨ feature New feature or request i18n area: i18n, translations ❗️ migrations contains migration files ready-for-e2e size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants