feat: `Troubleshooter` atom
Tier 2 hard typescript · local · real merged PR from calcom/cal.com #27497
Ground-truth defects
In listWithTeamHandler (packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts), this PR adds `AND "public"."EventType"."teamId" IS NULL` to the WHERE clause of Part 1 of the raw SQL UNION query. Part 1 previously returned every EventType owned by the current user (`userId = currentUser`); the new condition restricts it to non-team event types only. Team event types are then expected to come from Part 2, which discovers them via an INNER JOIN on Membership. But a team event type whose `userId` is set to the current user while that user has no Membership row for the team falls through both branches: Part 1 excludes it (teamId is not null) and Part 2 excludes it (no Membership). The result is that such owned team event types silently disappear from the listing, breaking the event-types view for owners-without-membership.
The change under review
diff (truncated — full diff)
@@ -1,3 +1,20 @@ +import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants"; +import type { UpdateEventTypeReturn } from "@calcom/platform-libraries/event-types"; +import { listWithTeamHandler, PublicEventType } from "@calcom/platform-libraries/event-types"; +import { ApiResponse } from "@calcom/platform-types"; +import { + Body, + Controller, + Get, + Param, + ParseIntPipe, + Patch, + Query, + UseGuards, + VERSION_NEUTRAL, + Version, +} from "@nestjs/common"; +import { ApiExcludeController as DocsExcludeController, ApiTags as DocsTags } from "@nestjs/swagger"; import { GetEventTypePublicOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/get-event-type-public.output"; import { API_VERSIONS_VALUES } from "@/lib/api-versions"; import { @@ -16,24 +33,6 @@ import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard"; import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard"; import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard"; import { UserWithProfile } from "@/modules/users/users.repository"; -import { - Controller, - Get, - Param, - ParseIntPipe, - UseGuards, - Version, - VERSION_NEUTRAL, - Patch, - Body, - Query, -} from "@nestjs/common"; -import { ApiTags as DocsTags, ApiExcludeController as DocsExcludeController } from "@nestjs/swagger"; - -import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants"; -import type { UpdateEventTypeReturn } from "@calcom/platform-libraries/event-types"; -import { PublicEventType } from "@calcom/platform-libraries/event-types"; -import { ApiResponse } from "@calcom/platform-types"; /* Event-types endpoints for atoms, split from AtomsController for clarity and maintainability. @@ -49,6 +48,17 @@ These endpoints should not be recommended for use by third party and are exclude export class AtomsEventTypesController { constructor(private readonly eventTypesService: EventTypesAtomService) {} + @Get("/event-types/list-with-team") + @Version(VERSION_NEUTRAL) + @UseGuards(ApiAuthGuard) + async listEventTypesWithTeam(@GetUser() user: UserWithProfile): Promise<ApiResponse<unknown>> { + const eventTypes = await listWithTeamHandler({ ctx: { user } }); + return { + status: SUCCESS_STATUS, + data: eventTypes, + }; + } + @Get("/event-types/:eventSlug/public") async getPublicEventType( @Param("eventSlug") eventSlug: string, @@ -73,6 +73,21 @@ export class AtomsSchedulesController { }; } + @Get("/schedules/event-type/:eventSlug") + @Version(VERSION_NEUTRAL) + @UseGuards(ApiAuthGuard) + @Permissions([SCHEDULE_READ]) + async getScheduleByEventSlug( + @GetUser() user: UserWithProfile, + @Param("eventSlug") eventSlug: string + ): Promise<ApiResponse<unknown>> { + const schedule = await this.schedulesService.getScheduleByEventSlug(user, eventSlug); + return { + status: SUCCESS_STATUS, + data: schedule, + }; + } + @Get("/schedules/all") @Version(VERSION_NEUTRAL) @UseGuards(ApiAuthGuard) @@ -1,3 +1,4 @@ +import { PrismaReadService } from "@/modules/prisma/prisma-read.service"; import { PrismaWriteService } from "@/modules/prisma/prisma-write.service"; import { UsersRepository } from "@/modules/users/users.repository"; import { UserWithProfile } from "@/modules/users/users.repository"; @@ -5,6 +6,7 @@ import { Logger } from "@nestjs/common"; import { Injectable } from "@nestjs/common"; import { ScheduleRepository, UpdateScheduleResponse } from "@calcom/platform-libraries/schedules"; +import { getScheduleByEventSlugHandler } from "@calcom/platform-libraries/schedules"; import { updateSchedule } from "@calcom/platform-libraries/schedules"; import { UpdateAtomScheduleDto } from "@calcom/platform-types"; import type { PrismaClient } from "@calcom/prisma"; @@ -15,6 +17,7 @@ export class SchedulesAtomsService { constructor( private readonly usersRepository: UsersRepository, + private readonly dbRead: PrismaReadService, private readonly dbWrite: PrismaWriteService ) {} @@ -42,6 +45,13 @@ export class SchedulesAtomsService { }); } + async getScheduleByEventSlug(user: UserWithProfile, eventSlug: string) { + return getScheduleByEventSlugHandler({ + ctx: { user, prisma: this.dbRead.prisma as unknown as PrismaClient }, + input: { eventSlug }, + }); + } + async updateUserSchedule({ input, user, @@ -3,7 +3,7 @@ import { Badge } from "@calcom/ui/components/badge"; import { Button } from "@calcom/ui/components/button"; import { Switch } from "@calcom/ui/components/form"; -import { TroubleshooterListItemContainer } from "./TroubleshooterListItemContainer"; +import { TroubleshooterListItemContainer } from "@calcom/features/troubleshooter/components/TroubleshooterListItemContainer"; function AvailabiltyItem() { const { t } = useLocale(); @@ -1,124 +1,16 @@ -import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { CalendarToggleContainerComponent } from "@calcom/features/troubleshooter/components/CalendarToggleContainerComponent"; import { trpc } from "@calcom/trpc/react"; -import { Badge } from "@calcom/ui/components/badge"; -import { Button } from "@calcom/ui/components/button"; -import { Switch } from "@calcom/ui/components/form"; - -import { TroubleshooterListItemContainer } from "./TroubleshooterListItemContainer"; - -const SELECTION_COLORS = ["#f97316", "#84cc16", "#06b6d4", "#8b5cf6", "#ec4899", "#f43f5e"]; - -interface CalendarToggleItemProps { - title: string; - subtitle: string; - colorDot?: string; - status: "connected" | "not_found"; - calendars?: { - active?: boolean; - name?: string; - }[]; -} -function CalendarToggleItem(props: CalendarToggleItemProps) { - const badgeStatus = props.status === "connected" ? "green" : "orange"; - const badgeText = props.status === "connected" ? "Connected" : "Not found"; - return ( - <TroubleshooterListItemContainer - title={props.title} - subtitle={props.subtitle} - prefixSlot={ - <> - <div - className="h-4 w-4 self-center rounded-[4px]" - style={{ - backgroundColor: props.colorDot, - }} - /> - </> - } - suffixSlot={ - <div> - <Badge variant={badgeStatus} withDot size="sm"> - {badgeText} - </Badge> - </div> - }> - <div className="[&>*]:text-emphasis flex flex-col gap-3"> - {props.calendars?.map((calendar) => { - return <Switch key={calendar.name} checked={calendar.active} label={calendar.name} disabled />; - })} - </div> - </TroubleshooterListItemContainer> - ); -} - -function EmptyCalendarToggleItem() { - const { t } = useLocale(); - - return ( - <TroubleshooterListItemContainer - title={t("installed", { count: 0 })} - subtitle={t("please_install_a_calendar")} - prefixSlot={ - <> - <div className="h-4 w-4 self-center rounded-[4px] bg-blue-500" /> - </> - } - suffixSlot={ - <div> - <Badge variant="orange" withDot size="sm"> - {t("unavailable")} - </Badge> - </div> - }> - <div className="flex flex-col gap-3"> - <Button color="secondary" className="justify-center gap-2" href="/apps/categories/calendar"> - {t("install_calendar")} - </Button> - </div> - </TroubleshooterListItemContainer> - ); -} export function CalendarToggleContainer() { - const { t } = useLocale(); - const { data, isLoading } = trpc.viewer.calendars.connectedCalendars.useQuery(); - - const hasConnectedCalendars = data && data?.connectedCalendars.length > 0; + const { data, isLoading } = + trpc.viewer.calendars.connectedCalendars.useQuery(); return ( - <div className="flex flex-col stack-y-3"> - <p className="text-sm font-medium leading-none">{t("calendars_were_checking_for_conflicts")}</p> - {hasConnectedCalendars && !isLoading ? ( - <> - {data.connectedCalendars.map((calendar) => { - const foundPrimary = calendar.calendars?.find((item) => item.primary); - // Will be used when getAvailbility is modified to use externalId instead of appId for source. - // const color = SELECTION_COLORS[idx] || "#000000"; - // // Add calendar to color map using externalId (what we use on the backend to determine source) - // addToColorMap(foundPrimary?.externalId, color); - return ( - <CalendarToggleItem - key={calendar.credentialId} - title={calendar.integration.name} - colorDot="#000000" - subtitle={foundPrimary?.name ?? "Nameless Calendar"} - status={calendar.error ? "not_found" : "connected"} - calendars={calendar.calendars?.map((item) => { - return { - active: item.isSelected, - name: item.name, - }; - })} - /> - ); - })} - <Button color="secondary" className="justify-center gap-2" href="/settings/my-account/calendars"> - {t("manage_calendars")} - </Button> - </> - ) : ( - <EmptyCalendarToggleItem /> - )} - </div> + <CalendarToggleContainerComponent + connectedCalendars={data?.connectedCalendars ?? []} + isLoading={isLoading} + manageCalendarsAction={{ href: "/settings/my-account/calendars" }} + installCalendarAction={{ href: "/apps/categories/calendar" }} + /> ); } @@ -1,7 +1,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Badge } from "@calcom/ui/components/badge"; -import { TroubleshooterListItemHeader } from "./TroubleshooterListItemContainer"; +import { TroubleshooterListItemHeader } from "@calcom/features/troubleshooter/components/TroubleshooterListItemContainer"; function ConnectedAppsItem() { return ( @@ -1,43 +1,42 @@ -import Link from "next/link"; - +import { EventScheduleItemComponent } from "@calcom/features/troubleshooter/components/EventScheduleItemComponent"; +import { useTroubleshooterStore } from "@calcom/features/troubleshooter/store"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { Badge } from "@calcom/ui/components/badge"; -import { Label } from "@calcom/ui/components/form"; +import Link from "next/link"; -import { useTroubleshooterStore } from "@calcom/features/troubleshooter/store"; -import { TroubleshooterListItemHeader } from "./TroubleshooterListItemContainer"; +export { EventScheduleItemComponent }; -export function EventScheduleItem() { +export function EventScheduleItem(): JSX.Element { const { t } = useLocale(); const selectedEventType = useTroubleshooterStore((state) => state.event); - const { data: schedule } = trpc.viewer.availability.schedule.getScheduleByEventSlug.useQuery( - { - eventSlug: selectedEventType?.slug as string, - }, - { - enabled: !!selectedEventType?.slug, - } - ); + const { data: schedule } = + trpc.viewer.availability.schedule.getScheduleByEventSlug.useQuery( + { + eventSlug: selectedEventType?.slug as string, + }, + { + enabled: !!selectedEventType?.slug, + } + ); return ( - <div> - <Label>{t("availability_schedule")}</Label> - <TroubleshooterListItemHeader - className="group rounded-md border-b" - prefixSlot={<div className="w-4 rounded-[4px] bg-black" />} - title={schedule?.name ?? "Loading"} - suffixSlot={ - schedule && ( - <Link href={`/availability/${schedule.id}`} className="inline-flex"> - <Badge color="orange" size="sm" className="invisible hover:cursor-pointer group-hover:visible"> - {t("edit")} - </Badge> - </Link> - ) - } - /> - </div> + <EventScheduleItemComponent + schedule={schedule ?? null} + suffixSlot={ + schedule && ( + <Link href={`/availability/${schedule.id}`} className="inline-flex"> + <Badge + color="orange" + size="sm" + className="invisible hover:cursor-pointer group-hover:visible" + > + {t("edit")} + </Badge> + </Link> + ) + } + /> ); } @@ -1,88 +1,16 @@ -import { useMemo, useEffect, startTransition } from "react"; -import { shallow } from "zustand/shallow"; - +import { EventTypeSelectComponent } from "@calcom/features/troubleshooter/components/EventTypeSelectComponent"; import { trpc } from "@calcom/trpc/react"; -import { SelectField } from "@calcom/ui/components/form"; - -import { getQueryParam } from "@calcom/features/bookings/Booker/utils/query-param"; -import { useTroubleshooterStore } from "@calcom/features/troubleshooter/store"; - -export function EventTypeSelect() { - const { data: eventTypes, isPending } = trpc.viewer.eventTypes.listWithTeam.useQuery(); - const { event: selectedEventType, setEvent: setSelectedEventType } = useTroubleshooterStore( - (state) => ({ - event: state.event, - setEvent: state.setEvent, - }), - shallow - ); - - const options = useMemo(() => { - if (!eventTypes) return []; - return eventTypes.map((e) => ({ - label: e.title, - value: e.id.toString(), - id: e.id, - duration: e.length, - })); - }, [eventTypes]); - - // Initialize event type from query param or default to first event - useEffect(() => { - if (!eventTypes || eventTypes.length === 0) return; - - const selectedEventIdParam = getQueryParam("eventTypeId"); - const eventTypeId = selectedEventIdParam ? parseInt(selectedEventIdParam, 10) : null; - - // If we already have a selected event that matches the query param, don't do anything - if (selectedEventType?.id === eventTypeId) return; - // If there's a query param, try to find and set that event - if (eventTypeId && !isNaN(eventTypeId)) { - startTransition(() => { - const foundEventType = eventTypes.find((et) => et.id === eventTypeId); - if (foundEventType) { - setSelectedEventType({ - id: foundEventType.id, - slug: foundEventType.slug, - duration: foundEventType.length, - teamId: foundEventType.team?.id ?? null, - }); - return; - } - }); - } +export { EventTypeSelectComponent }; - // If no event is selected and no valid query param, default to first event - if (!selectedEventType && !eventTypeId) { - const firstEvent = eventTypes[0]; - setSelectedEventType({ - id: firstEvent.id, - slug: firstEvent.slug, - duration: firstEvent.length, - teamId: firstEvent.team?.id ?? null, - }); - } - }, [eventTypes, selectedEventType, setSelectedEventType]); +export function EventTypeSelect(): JSX.Element { + const { data: eventTypes, isPending } = + trpc.viewer.eventTypes.listWithTeam.useQuery(); return ( - <SelectField - label="Event Type" - options={options} - isDisabled={isPending || options.length === 0} - value={options.find((option) => option.id === selectedEventType?.id) || options[0]} - onChange={(option) => { - if (!option) return; - const foundEventType = eventTypes?.find((et) => et.id === option.id); - if (foundEventType) { - setSelectedEventType({ - id: foundEventType.id, - slug: foundEventType.slug, - duration: foundEventType.length, - teamId: foundEventType.team?.id ?? null, - }); - } - }} + <EventTypeSelectComponent + eventTypes={eventTypes ?? []} + isPending={isPending} /> ); } @@ -1247,6 +1247,7 @@ "invitees_can_schedule": "Invitees can schedule", "date_range": "Date range", "calendar_days": "calendar days", + "nameless_calendar": "Nameless Calendar", "business_days": "business days", "set_address_place": "Set an address or place", "set_link_meeting": "Set a link to the meeting", @@ -2925,6 +2926,7 @@ "directory_sync_delete_confirmation": "This action cannot be undone. This will permanently delete the directory sync connection.", "event_setup_length_error": "Event Setup: The duration must be at least 1 minute.", "availability_schedules": "Availability schedules", + "availability_schedule": "Availability Schedule", "unauthorized": "Unauthorized", "access_cal_account": "{{clientName}} wants to access your {{appName}} account", "select_account_team": "Select account or team", new file mode 100644
Leaderboard for this case
hard · 2 of 9 bots fully caught it (22% solve rate) · 22% avg coverage.
| # | Bot | Result | Caught | Coverage | Findings | False alarms |
|---|---|---|---|---|---|---|
| 1 | Drape (Deep Review) | solved | 1/1 | 100.0% | 5 | 0 |
| 2 | Drape (Review) | solved | 1/1 | 100.0% | 4 | 0 |
| 3 | cursor | miss | 0/1 | 0.0% | 2 | 0 |
| 4 | greptile | miss | 0/1 | 0.0% | 1 | 0 |
| 5 | Mjolnir (Opus 5.5) | miss | 0/1 | 0.0% | 2 | 0 |
| 6 | Mjolnir (Sonnet 5.5) | miss | 0/1 | 0.0% | 1 | 0 |
| 7 | qodo | miss | 0/1 | 0.0% | 0 | 0 |
| 8 | Claude Code (Opus 5.5) | miss | 0/1 | 0.0% | 3 | 1 |
| 9 | Cubic | miss | 0/1 | 0.0% | 10 | 3 |
Bot results
Claude Code (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d1 | high | ✗ | — |
The shared component the new platform atom uses still reads eventTypeId from the host page's URL, and the store's initialize/setMonth/setSelectedDate still call updateQueryParam no matter what isPlatform is. That makes the isPlatform isolation incomplete. Detail: month defaults to null in the atom, so initialize only writes month when the host passes one. [grounded: tree packages/features/troubleshooter/components/EventTypeSelectComponent.tsx] [consensus 3/3: valid=3]
On first mount, eventTypes is empty until the async query resolves, so the child effect returns early. By the time it calls setEvent, the parent's initialize effect has already set isPlatform. On a later remount, isPlatform is already true, because the flag is never reset. The claimed early URL write therefore does not happen in practice. [invalid: contradiction] [consensus 3/4: invalid=3, valid=1]
The stray leading space is real but only cosmetic, since HTML rendering mostly collapses it. The label text change comes from adding the previously missing locale key. This is a style nit. [grounded: tree packages/features/troubleshooter/components/EventScheduleItemComponent.tsx] [consensus 3/3: minor=3]
raw comments (3)
The new `isPlatform` flag only stops `setEvent` from writing `eventTypeId` to the URL. `initialize`, `setMonth` and `setSelectedDate` still call `updateQueryParam`, so the platform atom still rewrites the host app's URL with `month` and `date` params. Also, `EventTypeSelectComponent` still reads `eventTypeId` from the host URL with `getQueryParam`, so an unrelated host query param can pick which event type is selected.
The store is a module-level singleton and `isPlatform` is only ever set to true, never reset. `initialize` runs in a parent `useEffect`, which fires after child effects. If a child calls `setEvent` before that effect runs, the URL is still updated, so the flag is applied late as well as never cleared.
The label is rendered as `<Label> {t("availability_schedule")}</Label>`, with a stray space before the text. It also uses the new key "Availability Schedule", replacing the old `availability_schedule` label in the web app, so the label text there changes slightly.
Cubic · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d1 | high | ✗ | — |
CalProvider resets all queries whenever the accessToken (user identity) changes, so stale cached schedules from a previous user aren't served. [invalid: contradiction] [consensus 3/5: invalid=3, uncertain=2]
The flag is only ever set to true and never reset, so the global store stays in platform mode for any later regular-troubleshooter mount in the same runtime. That scenario is unlikely in practice. [grounded: diff] [consensus 3/5: valid=3, uncertain=2]
Grep confirms the key already exists at line 4540 with the value "Availability schedule". JSON keeps the last occurrence, so the newly added entry is dead. [grounded: diff] [consensus 5/5: valid=5]
When loading, the else branch renders EmptyCalendarToggleItem ("Installed 0" plus an install button). The logic was copied from the web version, but the new platform caller now shows the same misleading state. [grounded: diff] [consensus 3/5: valid=3, invalid=2]
The new service passes dbRead as ctx.prisma for the slug lookup, but getHandler builds its repository from the global prisma, so one request reads from two different clients. [grounded: tree packages/trpc/server/routers/viewer/availability/schedule/get.handler.ts] [consensus 5/5: valid=5]
The query's error is ignored, and a failed request becomes an empty list that renders the install-calendar empty state. [grounded: diff] [consensus 4/5: valid=4, invalid=1]
The new wrapper sets the meta column to 0px at <=768px while the sidebar is shown from 640px via sm:flex, so the layout breaks between 640 and 768px. [grounded: diff] [consensus 5/5: valid=5]
The removed web EventTypeSelect had the identical `if (!selectedEventType && !eventTypeId)` guard. The logic was only moved, not changed. [invalid: introduced=no] [consensus 5/5: invalid=5]
CalProvider resets queries on any accessToken change, so one user's cached event types aren't served to another user. [invalid: contradiction] [consensus 3/5: invalid=3, uncertain=2]
This is an unused variable and dead code. It's a cleanup note, not a behavioural defect. [grounded: diff] [consensus 5/5: minor=5]
raw comments (11)
<!-- cubic:v=311f3a93-f51a-47eb-9b5f-7e749c6c164c -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":7} -->
P1: When the authenticated user changes while the shared query cache remains mounted, this hook can display the previous user’s schedule for the same event slug. Include the authenticated user or tenant identity in the query key, or remove this query when authentication changes.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At packages/platform/atoms/hooks/useScheduleByEventSlug.tsx, line 24:
<comment>When the authenticated user changes while the shared query cache remains mounted, this hook can display the previous user’s schedule for the same event slug. Include the authenticated user or tenant identity in the query key, or remove this query when authentication changes.</comment>
<file context>
@@ -0,0 +1,40 @@
+ const { isInit } = useAtomsContext();
+
+ const schedule = useQuery({
+ queryKey: [QUERY_KEY, props.eventSlug],
+ queryFn: () => {
+ return http
</file context>
```
</details>
<!-- cubic:v=059e07d7-abc6-42e2-80b8-ba3e14e0e9f5 -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":8} -->
P2: When a platform troubleshooter mounts before the regular troubleshooter in the same runtime, `initialize` leaves `isPlatform` true. Set `isPlatform` on every initialization so the regular troubleshooter can restore normal `eventTypeId` updates.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/troubleshooter/store.ts, line 95:
<comment>When a platform troubleshooter mounts before the regular troubleshooter in the same runtime, `initialize` leaves `isPlatform` true. Set `isPlatform` on every initialization so the regular troubleshooter can restore normal `eventTypeId` updates.</comment>
<file context>
@@ -77,15 +81,20 @@ export const useTroubleshooterStore = create<TroubleshooterStore>((set, get) =>
},
- initialize: ({ month }: StoreInitializeType) => {
+ initialize: ({ month, isPlatform }: StoreInitializeType) => {
+ if (isPlatform) {
+ set({ isPlatform: true });
+ }
</file context>
```
</details>
```suggestion
set({ isPlatform: Boolean(isPlatform) });
```
<!-- cubic:v=6bbc67d8-29fa-420b-a55d-ba5f372916b5 -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":9} -->
P2: The added "availability_schedule" key duplicates an existing one at line 4540 ("Availability schedule"). Since the JSON parser keeps the last occurrence, the new value at line 2929 is overridden and never used. Remove the duplicate or delete the older entry so the intended casing actually applies.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At apps/web/public/static/locales/en/common.json, line 2929:
<comment>The added "availability_schedule" key duplicates an existing one at line 4540 ("Availability schedule"). Since the JSON parser keeps the last occurrence, the new value at line 2929 is overridden and never used. Remove the duplicate or delete the older entry so the intended casing actually applies.</comment>
<file context>
@@ -2925,6 +2926,7 @@
"directory_sync_delete_confirmation": "This action cannot be undone. This will permanently delete the directory sync connection.",
"event_setup_length_error": "Event Setup: The duration must be at least 1 minute.",
"availability_schedules": "Availability schedules",
+ "availability_schedule": "Availability Schedule",
"unauthorized": "Unauthorized",
"access_cal_account": "{{clientName}} wants to access your {{appName}} account",
</file context>
```
</details>
```suggestion
Remove this line (the key already exists at line 4540); if the casing change is intended, update the existing entry there instead.
```
<!-- cubic:v=454e693e-cbe2-4afa-b110-9a47aa1f3faf -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":10} -->
P2: While the connected-calendars query is loading, both callers provide an empty array, so this branch falsely displays “Installed 0” and asks the user to install a calendar. Render a loading state or defer the empty state until loading finishes.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/troubleshooter/components/CalendarToggleContainerComponent.tsx, line 133:
<comment>While the connected-calendars query is loading, both callers provide an empty array, so this branch falsely displays “Installed 0” and asks the user to install a calendar. Render a loading state or defer the empty state until loading finishes.</comment>
<file context>
@@ -0,0 +1,174 @@
+ <p className="text-sm font-medium leading-none">
+ {t("calendars_were_checking_for_conflicts")}
+ </p>
+ {hasConnectedCalendars && !isLoading ? (
+ <>
+ {connectedCalendars.map((calendar) => {
</file context>
```
</details>
<!-- cubic:v=9c4a2dac-7e9c-411a-92c3-4c7839eeeae1 -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":9} -->
P2: When `DATABASE_READ_URL` differs from `DATABASE_URL`, this endpoint mixes clients: the slug lookup uses `dbRead`, but schedule details are loaded through the handler’s package-global `prisma`. Make the delegated schedule lookup honor `ctx.prisma` or use a repository built from `dbRead` so replica and primary data cannot be mixed.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At apps/api/v2/src/modules/atoms/services/schedules-atom.service.ts, line 50:
<comment>When `DATABASE_READ_URL` differs from `DATABASE_URL`, this endpoint mixes clients: the slug lookup uses `dbRead`, but schedule details are loaded through the handler’s package-global `prisma`. Make the delegated schedule lookup honor `ctx.prisma` or use a repository built from `dbRead` so replica and primary data cannot be mixed.</comment>
<file context>
@@ -42,6 +45,13 @@ export class SchedulesAtomsService {
+ async getScheduleByEventSlug(user: UserWithProfile, eventSlug: string) {
+ return getScheduleByEventSlugHandler({
+ ctx: { user, prisma: this.dbRead.prisma as unknown as PrismaClient },
+ input: { eventSlug },
+ });
</file context>
```
</details>
<!-- cubic:v=77ce674d-e214-4fbc-a54f-f29dc53593af -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":9} -->
P2: When the `/calendars` request fails, this fallback treats the failure as no connected calendars and can prompt users to install or reconnect a calendar unnecessarily. Preserve the query error and render an error/retry state instead of converting failed data to an empty list.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At packages/platform/atoms/troubleshooter/sidebar/CalendarToggleContainer.tsx, line 17:
<comment>When the `/calendars` request fails, this fallback treats the failure as no connected calendars and can prompt users to install or reconnect a calendar unnecessarily. Preserve the query error and render an error/retry state instead of converting failed data to an empty list.</comment>
<file context>
@@ -0,0 +1,27 @@
+
+ return (
+ <CalendarToggleContainerComponent
+ connectedCalendars={calendars.data?.connectedCalendars ?? []}
+ isLoading={calendars.isLoading}
+ {...(onManageCalendarsClick
</file context>
```
</details>
<!-- cubic:v=f73bed70-a242-4063-9968-579130b08490 -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":9} -->
P2: At 640–767px, `TroubleshooterPlatformWrapper` collapses the metadata column to `0px`, but `sm:flex` still displays this sidebar. Use `md:flex` so the sidebar stays hidden until the wrapper restores its metadata column.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At packages/platform/atoms/troubleshooter/sidebar/TroubleshooterSidebar.tsx, line 32:
<comment>At 640–767px, `TroubleshooterPlatformWrapper` collapses the metadata column to `0px`, but `sm:flex` still displays this sidebar. Use `md:flex` so the sidebar stays hidden until the wrapper restores its metadata column.</comment>
<file context>
@@ -0,0 +1,42 @@
+ const { t } = useLocale();
+
+ return (
+ <div className="relative z-10 hidden h-screen w-full flex-col gap-6 overflow-y-auto py-6 pl-4 pr-6 sm:flex md:pl-0">
+ <SidebarHeading name={t("troubleshooter")} />
+ <EventTypeSelect />
</file context>
```
</details>
<!-- cubic:v=5579ed68-9670-48d2-9b9e-52a43acda070 -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":9} -->
P2: When `eventTypeId` is numeric but no longer present in `eventTypes`, this guard is false and the store remains unset. The select displays the first option, but the calendar and schedule read the store, so the troubleshooter has no selected event; treat an ID as valid only when it resolves to an option before falling back.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/troubleshooter/components/EventTypeSelectComponent.tsx, line 79:
<comment>When `eventTypeId` is numeric but no longer present in `eventTypes`, this guard is false and the store remains unset. The select displays the first option, but the calendar and schedule read the store, so the troubleshooter has no selected event; treat an ID as valid only when it resolves to an option before falling back.</comment>
<file context>
@@ -0,0 +1,115 @@
+ }
+
+ // If no event is selected and no valid query param, default to first event
+ if (!selectedEventType && !eventTypeId) {
+ const firstEvent = eventTypes[0];
+ setSelectedEventType({
</file context>
```
</details>
```suggestion
if (!selectedEventType && (!eventTypeId || !eventTypes.some((et) => et.id === eventTypeId))) {
```
<!-- cubic:v=6c78054e-577f-4c7f-9280-686be470ca1b -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":7} -->
P2: When two authenticated users share a React Query client, this static key reuses the first user's event-type list for the second user. Include a stable authenticated user identity in the key, such as `userId`, so user-specific data cannot be served from another user's cache.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At packages/platform/atoms/hooks/useEventTypesList.tsx, line 25:
<comment>When two authenticated users share a React Query client, this static key reuses the first user's event-type list for the second user. Include a stable authenticated user identity in the key, such as `userId`, so user-specific data cannot be served from another user's cache.</comment>
<file context>
@@ -0,0 +1,39 @@
+ const { isInit } = useAtomsContext();
+
+ const eventTypes = useQuery({
+ queryKey: [QUERY_KEY],
+ queryFn: () => {
+ return http.get<ApiResponse<ListWithTeamData>>("/atoms/event-types/list-with-team").then((res) => {
</file context>
```
</details>
<!-- cubic:v=cd164ee1-0591-40c0-be72-6dc89c39abf2 -->
<!-- cubic:review-run=6db06bb1-5216-5a69-bdc1-990ed0999809 -->
<!-- metadata:{"confidence":10} -->
P3: `isTablet` is never used, so this media-query subscription has no effect and the intended tablet behavior is absent. Remove the unused query or use it to drive the tablet layout.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At packages/platform/atoms/troubleshooter/wrappers/TroubleshooterPlatformWrapper.tsx, line 21:
<comment>`isTablet` is never used, so this media-query subscription has no effect and the intended tablet behavior is absent. Remove the unused query or use it to drive the tablet layout.</comment>
<file context>
@@ -0,0 +1,89 @@
+ onInstallCalendarClick,
+}: TroubleshooterComponentProps): JSX.Element => {
+ const isMobile = useMediaQuery("(max-width: 768px)");
+ const isTablet = useMediaQuery("(max-width: 1024px)");
+
+ useInitalizeTroubleshooterStore({
</file context>
```
</details>
<!-- cubic:review-summary:start -->
**10 issues found** across 31 files
<!-- cubic:review-summary:end -->
<details>
<summary>Prompt for AI agents (unresolved issues)</summary>
```text
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/features/troubleshooter/store.ts">
<violation number="1" location="packages/features/troubleshooter/store.ts:95">
P2: When a platform troubleshooter mounts before the regular troubleshooter in the same runtime, `initialize` leaves `isPlatform` true. Set `isPlatform` on every initialization so the regular troubleshooter can restore normal `eventTypeId` updates.</violation>
</file>
<file name="apps/web/public/static/locales/en/common.json">
<violation number="1" location="apps/web/public/static/locales/en/common.json:2929">
P2: The added "availability_schedule" key duplicates an existing one at line 4540 ("Availability schedule"). Since the JSON parser keeps the last occurrence, the new value at line 2929 is overridden and never used. Remove the duplicate or delete the older entry so the intended casing actually applies.</violation>
</file>
<file name="packages/features/troubleshooter/components/CalendarToggleContainerComponent.tsx">
<violation number="1" location="packages/features/troubleshooter/components/CalendarToggleContainerComponent.tsx:133">
P2: While the connected-calendars query is loading, both callers provide an empty array, so this branch falsely displays “Installed 0” and asks the user to install a calendar. Render a loading state or defer the empty state until loading finishes.</violation>
</file>
<file name="apps/api/v2/src/modules/atoms/services/schedules-atom.service.ts">
<violation number="1" location="apps/api/v2/src/modules/atoms/services/schedules-atom.service.ts:50">
P2: When `DATABASE_READ_URL` differs from `DATABASE_URL`, this endpoint mixes clients: the slug lookup uses `dbRead`, but schedule details are loaded through the handler’s package-global `prisma`. Make the delegated schedule lookup honor `ctx.prisma` or use a repository built from `dbRead` so replica and primary data cannot be mixed.</violation>
</file>
<file name="packages/platform/atoms/troubleshooter/wrappers/TroubleshooterPlatformWrapper.tsx">
<violation number="1" location="packages/platform/atoms/troubleshooter/wrappers/TroubleshooterPlatformWrapper.tsx:21">
P3: `isTablet` is never used, so this media-query subscription has no effect and the intended tablet behavior is absent. Remove the unused query or use it to drive the tablet layout.</violation>
</file>
<file name="packages/platform/atoms/troubleshooter/sidebar/CalendarToggleContainer.tsx">
<violation number="1" location="packages/platform/atoms/troubleshooter/sidebar/CalendarToggleContainer.tsx:17">
P2: When the `/calendars` request fails, this fallback treats the failure as no connected calendars and can prompt users to install or reconnect a calendar unnecessarily. Preserve the query error and render an error/retry state instead of converting failed data to an empty list.</violation>
</file>
<file name="packages/platform/atoms/troubleshooter/sidebar/TroubleshooterSidebar.tsx">
<violation number="1" location="packages/platform/atoms/troubleshooter/sidebar/TroubleshooterSidebar.tsx:32">
P2: At 640–767px, `TroubleshooterPlatformWrapper` collapses the metadata column to `0px`, but `sm:flex` still displays this sidebar. Use `md:flex` so the sidebar stays hidden until the wrapper restores its metadata column.</violation>
</file>
<file name="packages/features/troubleshooter/components/EventTypeSelectComponent.tsx">
<violation number="1" location="packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:79">
P2: When `eventTypeId` is numeric but no longer present in `eventTypes`, this guard is false and the store remains unset. The select displays the first option, but the calendar and schedule read the store, so the troubleshooter has no selected event; treat an ID as valid only when it resolves to an option before falling back.</violation>
</file>
<file name="packages/platform/atoms/hooks/useEventTypesList.tsx">
<violation number="1" location="packages/platform/atoms/hooks/useEventTypesList.tsx:25">
P2: When two authenticated users share a React Query client, this static key reuses the first user's event-type list for the second user. Include a stable authenticated user identity in the key, such as `userId`, so user-specific data cannot be served from another user's cache.</violation>
</file>
<file name="packages/platform/atoms/hooks/useScheduleByEventSlug.tsx">
<violation number="1" location="packages/platform/atoms/hooks/useScheduleByEventSlug.tsx:24">
P1: When the authenticated user changes while the shared query cache remains mounted, this hook can display the previous user’s schedule for the same event slug. Include the authenticated user or tenant identity in the query key, or remove this query when authentication changes.</violation>
</file>
```
</details>
<sub>Reply with feedback, questions, or to request a fix.<br /><br />[Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/drape-io/crbench-cubic-2026-09/22/ai_pr_review_github_delivery_04bbd4153d06757e733fb9a370edeb182bcce2abe6c6b6c7dcf944f0b5f6a39e?returnTo=https%3A%2F%2Fgithub.com%2Fdrape-io%2Fcrbench-cubic-2026-09%2Fpull%2F22)</sub>
<!-- cubic:review-post:ai_pr_review_github_delivery_04bbd4153d06757e733fb9a370edeb182bcce2abe6c6b6c7dcf944f0b5f6a39e:15fc1cc0734aa074a39d47b3d288f05dfc5a38fa:6db06bb1-5216-5a69-bdc1-990ed0999809 -->
cursor · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d1 | high | ✗ | — |
The shared component still reads eventTypeId from the host URL on platform. If the host page carries an eventTypeId that matches none of the user's event types, no event is ever selected, because the default branch requires !eventTypeId, so LargeCalendar renders null. The URL-write part is weaker: the effect waits for async data, which normally arrives after the parent effect has set isPlatform. That doesn't refute the main failure. [grounded: tree packages/features/troubleshooter/components/EventTypeSelectComponent.tsx] [consensus 5/5: valid=5]
The new platform LargeCalendar returns null when a personal event's username is null. listWithTeam returns row.username from a LEFT JOIN on users, and username is nullable, so the main pane stays blank in that case. [grounded: tree packages/platform/atoms/troubleshooter/large-calendar/LargeCalendar.tsx] [consensus 5/5: valid=5]
raw comments (3)
### Platform selector still uses URL params
**Medium Severity**
<!-- DESCRIPTION START -->
`EventTypeSelectComponent` always reads `eventTypeId` from the host URL, and `isPlatform` is set in a parent `useEffect` that runs after child effects. On platform, a host `eventTypeId` can block defaulting the first event (leaving the calendar empty), and the first `setEvent` can still write `eventTypeId` onto the embedder URL.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: 8f6acbf6-dd9d-4620-8afa-ee8e565018e7 -->
<!-- LOCATIONS START
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx#L49-L89
packages/features/troubleshooter/store.ts#L81-L97
LOCATIONS END -->
<details>
<summary>Additional Locations (1)</summary>
- [`packages/features/troubleshooter/store.ts#L81-L97`](https://github.com/drape-io/crbench-cursor-2026-09/blob/a46671ff877151d06e2630df134e086bff79c94e/packages/features/troubleshooter/store.ts#L81-L97)
</details>
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90Ojg5MWUyMWMwLWE1Y2UtNDIzZC1hYzcxLTBlZDdkNzc1ZmEzNyIsImVuY3J5cHRpb25LZXkiOiJoRVhjVXdyZGJEV2pnMkxVWWJLUHIxaDBjSGJBRllXWHlIYWN2bC0yR1dvIiwiYnJhbmNoIjoidDItY2FsLWNvbS0yNzQ5NyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90Ojg5MWUyMWMwLWE1Y2UtNDIzZC1hYzcxLTBlZDdkNzc1ZmEzNyIsImVuY3J5cHRpb25LZXkiOiJoRVhjVXdyZGJEV2pnMkxVWWJLUHIxaDBjSGJBRllXWHlIYWN2bC0yR1dvIiwiYnJhbmNoIjoidDItY2FsLWNvbS0yNzQ5NyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjIyLCJjb21taXRTaGEiOiJhNDY2NzFmZjg3NzE1MWQwNmUyNjMwZGYxMzRlMDg2YmZmNzljOTRlIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a46671ff877151d06e2630df134e086bff79c94e. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
### Calendar blank without event username
**Medium Severity**
<!-- DESCRIPTION START -->
The platform `LargeCalendar` only renders when `event.teamId` or `event.username` is set. Personal events get `username` from `listWithTeam`, and `User.username` is optional, so a selected personal event with no username returns `null` and leaves the main pane blank.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: 726e0b2e-128e-4f38-b6ee-e94b53c15455 -->
<!-- LOCATIONS START
packages/platform/atoms/troubleshooter/large-calendar/LargeCalendar.tsx#L7-L30
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts#L43-L44
LOCATIONS END -->
<details>
<summary>Additional Locations (1)</summary>
- [`packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts#L43-L44`](https://github.com/drape-io/crbench-cursor-2026-09/blob/a46671ff877151d06e2630df134e086bff79c94e/packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts#L43-L44)
</details>
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmJkMGM5MjllLTZiMzMtNDBhOS05NjVmLWFlYjQ0ZTBlZTNlNiIsImVuY3J5cHRpb25LZXkiOiIyak1EbWVjZWxNRDlZUmdOU2QySVdxTFpDNUh2ZnZXMTZQbVNFel80aTFRIiwiYnJhbmNoIjoidDItY2FsLWNvbS0yNzQ5NyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmJkMGM5MjllLTZiMzMtNDBhOS05NjVmLWFlYjQ0ZTBlZTNlNiIsImVuY3J5cHRpb25LZXkiOiIyak1EbWVjZWxNRDlZUmdOU2QySVdxTFpDNUh2ZnZXMTZQbVNFel80aTFRIiwiYnJhbmNoIjoidDItY2FsLWNvbS0yNzQ5NyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjIyLCJjb21taXRTaGEiOiJhNDY2NzFmZjg3NzE1MWQwNmUyNjMwZGYxMzRlMDg2YmZmNzljOTRlIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a46671ff877151d06e2630df134e086bff79c94e. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- BUGBOT_REVIEW -->
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
<!-- BUGBOT_FIX_ALL -->
<a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTozYWRkMGY5Ny0zMWZhLTRmNTktOTc0ZC03NGQyNTc3MmM5MjMiLCJlbmNyeXB0aW9uS2V5IjoiSDFuWHFDSU03MmlaTHB3a1F6WHhqOFpKcFdxT2pfVlUyd2p1UkM2SGpwayIsImJyYW5jaCI6InQyLWNhbC1jb20tMjc0OTciLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>
<!-- /BUGBOT_FIX_ALL -->
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN -->
<sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END -->
<sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a46671ff877151d06e2630df134e086bff79c94e. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
Drape (Deep Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d1 | high | ✓ | wrong severity |
The change adds an isPlatform flag but uses it only in setEvent. initialize still calls updateQueryParam for month even when isPlatform is set, and the atom exposes a public `month` prop that reaches this path. That is an incomplete change. setMonth and setSelectedDate are not reached from the platform atom, so the real impact is limited. [grounded: tree packages/features/troubleshooter/store.ts] [consensus 3/3: valid=3]
Grep shows `availability_schedule` already exists at line 4540. The added line at 2929 duplicates it, and the later definition overrides it when the file is parsed. [grounded: diff] [consensus 3/3: valid=3]
The shared component, now used by the platform atom, reads eventTypeId from the host page's URL. If that id is not in the list, no event gets set, and because eventTypeId is truthy the first-event fallback is skipped too, so nothing is selected. [grounded: tree packages/features/troubleshooter/components/EventTypeSelectComponent.tsx] [consensus 3/3: valid=3]
The new platform LargeCalendar renders EventTypeCalendarViewComponent. That component only fetches available slots (useAvailableSlots) and never loads busy events, so the troubleshooter atom cannot show calendar conflicts the way the web version does. [grounded: tree packages/platform/atoms/troubleshooter/large-calendar/LargeCalendar.tsx] [consensus 3/3: valid=3]
raw comments (5)
**Platform atom still rewrites host page's URL**
`isPlatform` only gates the query-param write in `setEvent`. `initialize` still writes `month` to the host page's URL, and so do `setMonth`, `setSelectedDate` and `addToSelectedDate`. Check `isPlatform` before every `updateQueryParam`/`removeQueryParam` call in the store.
```
packages/features/troubleshooter/store.ts:94 initialize: ({ month, isPlatform }: StoreInitializeType) => {
packages/features/troubleshooter/store.ts:95 if (isPlatform) {
packages/features/troubleshooter/store.ts:96 set({ isPlatform: true });
packages/features/troubleshooter/store.ts:97 }
packages/features/troubleshooter/store.ts:98 if (month) {
packages/features/troubleshooter/store.ts:99 set({ month });
packages/features/troubleshooter/store.ts:100 updateQueryParam("month", month);
packages/features/troubleshooter/store.ts:101 }
```
**Duplicate `availability_schedule` translation key**
The key `availability_schedule` is already defined further down in this file, so the copy added here is overwritten by the later one when the file is parsed, and translators see the key twice. Drop the added line and keep the existing key.
```
apps/web/public/static/locales/en/common.json:2929 "availability_schedule": "Availability Schedule",
apps/web/public/static/locales/en/common.json:4540 "availability_schedule": "Availability schedule",
```
**Atom can get stuck with no event selected**
In platform mode this still reads `eventTypeId` from the host page's URL. If that id isn't in the list, nothing gets selected, and the fallback to the first event is skipped. Skip the query-param lookup when the store's `isPlatform` is true.
```
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:51 if (!eventTypes || eventTypes.length === 0) return;
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:53 const selectedEventIdParam = getQueryParam("eventTypeId");
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:54 const eventTypeId = selectedEventIdParam
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:55 ? parseInt(selectedEventIdParam, 10)
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:79 if (!selectedEventType && !eventTypeId) {
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:80 const firstEvent = eventTypes[0];
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:81 setSelectedEventType({
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:82 id: firstEvent.id,
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:83 slug: firstEvent.slug,
packages/features/troubleshooter/components/EventTypeSelectComponent.tsx:84 duration: firstEvent.length,
```
**Owned team event types dropped from event-type list**
The new `teamId IS NULL` filter hides team event types the user owns via `userId` but whose membership isn't accepted. The web bookings filter uses this handler too. Drop the filter; the mapping already nulls username for team rows.
```
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:18 WHERE "public"."EventType"."userId" = ${userId} AND "public"."EventType"."teamId" IS NULL
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:19 UNION
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:20 SELECT "public"."EventType"."id", "public"."EventType"."teamId", "public"."EventType"."title", "public"."EventType"."slug", "public"."EventType"."length", "j1"."name" as "teamName", NULL as "username"
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:21 FROM "public"."EventType"
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:22 INNER JOIN "public"."Team" AS "j1" ON ("j1"."id") = ("public"."EventType"."teamId")
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:23 INNER JOIN "public"."Membership" AS "t2" ON "t2"."teamId" = "j1"."id"
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:24 WHERE "t2"."userId" = ${userId} AND "t2"."accepted" = true`;
```
**Platform troubleshooter never shows calendar conflicts**
This renders the public booking `CalendarViewPlatformWrapper`, which shows bookable slots. It never shows the busy times and working hours the web `LargeCalendar` loads from `availability.user`. Add an atoms busy-times endpoint and hook, and render busy events as the web LargeCalendar does.
```
packages/platform/atoms/troubleshooter/large-calendar/LargeCalendar.tsx:5 export const LargeCalendar = (): JSX.Element | null => {
packages/platform/atoms/troubleshooter/large-calendar/LargeCalendar.tsx:6 const event = useTroubleshooterStore((state) => state.event);
packages/platform/atoms/troubleshooter/large-calendar/LargeCalendar.tsx:8 if (!event?.slug) return null;
packages/platform/atoms/troubleshooter/large-calendar/LargeCalendar.tsx:10 if (event.teamId) {
apps/web/modules/troubleshooter/components/LargeCalendar.tsx:20 const { data: busyEvents } = trpc.viewer.availability.user.useQuery(
apps/web/modules/troubleshooter/components/LargeCalendar.tsx:21 {
apps/web/modules/troubleshooter/components/LargeCalendar.tsx:22 username: session?.user?.username || "",
apps/web/modules/troubleshooter/components/LargeCalendar.tsx:66 const calendarEvents = busyEvents?.busy.map((event, idx) => {
apps/web/modules/troubleshooter/components/LargeCalendar.tsx:67 return {
apps/web/modules/troubleshooter/components/LargeCalendar.tsx:68 id: idx,
```
Drape (Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d1 | high | ✓ | wrong severity |
The new hook puts the slug into the URL path without encoding it. Cal.com slugs are usually slugified, so this would rarely trigger, but the code shown does not guard against it. [grounded: tree packages/platform/atoms/hooks/useScheduleByEventSlug.tsx] [consensus 3/3: valid=3]
On platform, setEvent no longer writes eventTypeId to the URL, but the effect still reads it. If the host URL contains eventTypeId, any other selection makes the ids differ, so the effect's startTransition sets the event back to the URL's id. The change caused this by making setEvent skip the URL write while the read stayed. [grounded: tree packages/features/troubleshooter/components/EventTypeSelectComponent.tsx] [consensus 3/3: valid=3]
The change only partly adds the isPlatform guard. If the platform wrapper gets a month prop, initialize still calls updateQueryParam and rewrites the host page URL. setMonth and setSelectedDate are also unguarded. [grounded: tree packages/features/troubleshooter/store.ts] [consensus 3/3: valid=3]
raw comments (4)
**Event slug not URL-encoded in request path**
`eventSlug` is interpolated raw into `/atoms/schedules/event-type/${props.eventSlug}`. A slug with `/`, `?` or `#` changes the route or truncates the path. Use encodeURIComponent(props.eventSlug).
```
packages/platform/atoms/hooks/useScheduleByEventSlug.tsx:24 queryKey: [QUERY_KEY, props.eventSlug],
```
**Platform event selection reverts to URL param**
On platform the store no longer writes `eventTypeId` to the URL, but the effect still reads it from the host page URL. If the host URL has that param, every user selection is overwritten. Skip the query-param initialization when `isPlatform` is true.
```
packages/features/troubleshooter/store.ts:81 event: null,
packages/features/troubleshooter/store.ts:82 setEvent: (event: EventType) => {
packages/features/troubleshooter/store.ts:83 set({ event });
packages/features/troubleshooter/store.ts:84 if (!get().isPlatform) {
```
**Platform atom still rewrites host page URL**
`isPlatform` only guards `eventTypeId` in `setEvent`. `setMonth`, `setSelectedDate` and `initialize` still call `updateQueryParam`, so the embedded atom edits the host URL. Apply the isPlatform guard to every updateQueryParam call in the store.
```
packages/features/troubleshooter/store.ts:81 event: null,
packages/features/troubleshooter/store.ts:82 setEvent: (event: EventType) => {
packages/features/troubleshooter/store.ts:83 set({ event });
packages/features/troubleshooter/store.ts:84 if (!get().isPlatform) {
```
**Shared handler query changed for existing callers**
The shared `listWithTeamHandler` now filters the personal branch with `teamId IS NULL` and joins `users`. This changes results for the web booking-filter caller (`useEventTypes`) as well as the new platform endpoint. Keep the original WHERE clause unless the filter is deliberately needed, and confirm the web consumers are unaffected.
```
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:14 const query = Prisma.sql`SELECT "public"."EventType"."id", "public"."EventType"."teamId", "public"."EventType"."title", "public"."EventType"."slug", "public"."EventType"."length", "j1"."name" as "teamName", "u"."username" as "username"
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:15 FROM "public"."EventType"
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:16 LEFT JOIN "public"."Team" AS "j1" ON ("j1"."id") = ("public"."EventType"."teamId")
packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts:17 LEFT JOIN "public"."users" AS "u" ON ("u"."id") = ("public"."EventType"."userId")
apps/web/modules/bookings/hooks/useEventTypes.ts:12 const eventTypesQuery = trpc.viewer.eventTypes.listWithTeam.useQuery(undefined, {
```
greptile · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d1 | high | ✗ | — |
The new platform atom and the new API endpoint send only the event slug. The handler looks the event up with `userId_slug: { userId: ctx.user.id, slug }`, so a team event that this member doesn't own falls back to the member's default schedule, or matches a personal event with the same slug. The web app already behaved this way, but this change adds a new caller and endpoint that expose the same wrong lookup. [grounded: tree packages/platform/atoms/troubleshooter/sidebar/EventScheduleItem.tsx] [consensus 5/5: valid=5]
raw comments (2)
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Team schedules resolve incorrectly**
Selecting a team event type sends only its slug, but the schedule handler looks it up using the authenticated member's user ID. Team events are listed for every accepted member and are not necessarily owned by that member, so this can return the member's default schedule—or a personal event with the same slug—instead of the selected team's schedule. Pass the selected event type or team identity through the request and use it when resolving the schedule.
<h3>Greptile Summary</h3>
This PR extracts reusable troubleshooter components, introduces a public platform Troubleshooter atom, and adds authenticated atom endpoints for event-type and schedule data.
- Shares event-type selection, schedule display, calendar status, and list-item UI between web and platform surfaces.
- Adds platform hooks and an example page for the new Troubleshooter atom.
- Extends event-type listing with usernames and exposes schedule lookup through the API v2 atom controller.
- Team event schedule resolution needs correction because the new platform flow loses the selected team's ownership context.
<h3>Confidence Score: 4/5</h3>
The PR is not safe to merge until team event selections resolve their actual team schedule rather than a member's personal or default schedule.
The new platform troubleshooter lists team events for accepted members but sends only the selected slug to a handler scoped by the authenticated user's ID, producing incorrect schedule information for team events not owned by that member.
**Files Needing Attention:** packages/platform/atoms/troubleshooter/sidebar/EventScheduleItem.tsx; packages/trpc/server/routers/viewer/availability/schedule/getScheduleByEventTypeSlug.handler.ts
<details><summary><h3>Important Files Changed</h3></summary>
| Filename | Overview |
|----------|----------|
| packages/platform/atoms/troubleshooter/sidebar/EventScheduleItem.tsx | Connects the selected event to schedule loading but drops the team identity needed to resolve team schedules correctly. |
| packages/trpc/server/routers/viewer/availability/schedule/getScheduleByEventTypeSlug.handler.ts | Resolves schedules by the authenticated user's ID and slug, which does not support team events selected by other members. |
| packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts | Extends combined personal/team event results with usernames while continuing to expose team events through accepted membership. |
| packages/features/troubleshooter/components/EventTypeSelectComponent.tsx | Extracts shared event selection and stores the selected event's team and username context. |
| packages/platform/atoms/troubleshooter/wrappers/TroubleshooterPlatformWrapper.tsx | Adds the public platform wrapper and composes the troubleshooter sidebar with the large calendar. |
| apps/api/v2/src/modules/atoms/controllers/atoms.schedules.controller.ts | Adds the authenticated atom endpoint used to retrieve a schedule by event slug. |
</details>
<details open><summary><h3>Flowchart</h3></summary>
```mermaid
%%{init: {'theme': 'neutral'}}%%
flowchart LR
U[Platform troubleshooter] --> E[Event type list hook]
E --> A[Atom event-types endpoint]
A --> L[listWithTeamHandler]
L --> S[Selected personal or team event]
S --> H[Schedule hook using event slug]
H --> P[Atom schedule endpoint]
P --> G[getScheduleByEventSlugHandler]
G --> Q[userId + slug lookup]
Q --> D[Selected schedule or user default]
S --> C[Calendar view]
C --> O[teamId or username ownership context]
```
</details>
<!-- greptile_other_comments_section -->
<sub>Reviews (1): Last reviewed commit: ["Update apps/api/v2/src/modules/atoms/con..."](https://github.com/drape-io/crbench-greptile-2026-09/commit/459ca8f7fd0d529d75486d458634ef68760781a2) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=64284270)</sub>
Mjolnir (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d1 | high | ✗ | — |
The new platform atom uses the shared EventTypeSelectComponent, and that component still reads eventTypeId from the host URL even though the PR guards the write when isPlatform is set. If the ID doesn't match any of the user's event types, the default-to-first branch is skipped (`!eventTypeId` is false), so the event stays null and LargeCalendar returns null. [grounded: tree packages/features/troubleshooter/components/EventTypeSelectComponent.tsx] [consensus 3/3: valid=3]
Grep shows `availability_schedule` at line 2929 (newly added) and again at line 4540 (existing). JSON keeps the last duplicate, so the added title-case value never takes effect. [grounded: diff] [consensus 3/3: valid=3]
raw comments (2)
[P3] Platform troubleshooter still reads `eventTypeId` from the host app's URL
This PR gates the URL write in `setEvent` behind `isPlatform` so the atom doesn't touch the host app's query string. The shared `EventTypeSelectComponent` doesn't do the same for the read: it still calls `getQueryParam("eventTypeId")` on every render path. When the atom is embedded on a host page whose URL has its own `eventTypeId` param (for example an event-type detail route), that unrelated ID drives the selection. If the ID matches one of the user's event types, that type is silently preselected. If it doesn't match, the "default to first event" branch is skipped because `eventTypeId` is truthy, so the store event stays `null`. The dropdown still shows `options[0]`, but the schedule item stays on "Loading..." and `LargeCalendar` renders nothing. The fix is to skip the query-param lookup when `isPlatform` is set, matching the guard added in `setEvent`.
[P3] Duplicate `availability_schedule` translation key
This change adds `"availability_schedule": "Availability Schedule"`, but the same key already exists further down the file (around line 4540, `"availability_schedule": "Availability schedule"`). JSON parsers keep the last duplicate, so the new entry and its title-case wording never take effect. Duplicate keys are also often flagged by i18n/lint tooling and make later edits ambiguous. The existing key already covers `t("availability_schedule")`, so this addition can be dropped; if title case was intended, change the existing entry instead. Per the repo rules, UI strings belong in this file ([CLAUDE.md](CLAUDE.md) "Add translations to `apps/web/public/static/locales/en/common.json` for all UI strings"), and that means one canonical entry per key.
Mjolnir (Sonnet 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d1 | high | ✗ | — |
Grep confirms the key already exists at line 4540 ("Availability schedule"), so the newly added key at line 2929 is a duplicate. The later value overrides it, which makes the new entry dead. [grounded: diff] [consensus 3/3: valid=3]
raw comments (1)
[P3] Duplicate `availability_schedule` key added to en/common.json
The file already defines `"availability_schedule": "Availability schedule"` at line 4540, so the new `"availability_schedule": "Availability Schedule"` is a duplicate key. JSON parsers keep the last value, so the new entry is dead and the displayed casing doesn't change. Duplicate keys can also trip Biome or JSON lint checks. The new entry should be removed, or the existing one edited if the casing change is intended.
qodo · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d1 | high | ✗ | — |
raw comments (2)
<h3>Qodo is busy working</h3>
Check back in a few minutes. Qodo's code review agents are on it.
<img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">
<img src="https://www.qodo.ai/wp-content/uploads/2026/01/anteater-looking-at-ants-01-transparent-bg-croped-ezgif.com-optimize-1.gif" width="30%">
<h3>PR Summary by Qodo</h3>
Add reusable Troubleshooter atom and supporting APIs
<code>✨ Enhancement</code> <code>🕐 40+ Minutes</code>
<img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">
<details>
<summary>AI Description</summary>
<dl>
<dd>
<br/>
><pre>
>• Adds an embeddable Troubleshooter atom with event, schedule, calendar, and availability views.
>• Exposes authenticated atom APIs for event-type lists and schedule lookup.
>• Extracts shared troubleshooter UI components for web and platform reuse.
></pre>
</dd>
</dl>
</details>
<details>
<summary>Diagram</summary>
<dl>
<dd>
<br/>
```mermaid
graph TD
Host["Host App"] --> Wrapper["Troubleshooter Atom"] --> Sidebar["Selection Sidebar"] --> Hooks["Atom Query Hooks"] --> API["Atoms API"] --> Handlers["Shared Handlers"] --> DB[("Cal Database")]
Wrapper --> Calendar["Calendar View"]
```
</dd>
</dl>
</details>
<details>
<summary>High-Level Assessment</summary>
<dl>
<dd>
<br/>
>The chosen approach is appropriate: shared presentational components preserve web behavior while platform-specific wrappers own transport and navigation concerns. Duplicating the troubleshooter UI inside atoms or embedding the existing web route would increase drift or coupling, so neither is preferable.
</dd>
</dl>
</details>
<details>
<summary> Files changed (31) <code> +816 / -300 </code> </summary>
<dl>
<dd>
<br/>
<details>
<summary>Enhancement (21) <code> +732 / -68 </code></summary>
<dl>
<dd>
<details>
<summary>atoms.event-types.controller.ts<code>Expose event types with team context</code> <code>+28/-18</code></summary>
<br/>
>Expose event types with team context
>
><pre>
>• Adds an authenticated, version-neutral atom endpoint that returns the current user's personal and team event types through the shared list handler.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-5829f1fb0862a7e9f5104b9e261d60a955d0d80f2e98e90a2e185130e4d25ad7'>apps/api/v2/src/modules/atoms/controllers/atoms.event-types.controller.ts</a>
</details>
<details>
<summary>atoms.schedules.controller.ts<code>Expose schedules by event slug</code> <code>+15/-0</code></summary>
<br/>
>Expose schedules by event slug
>
><pre>
>• Adds an authenticated schedule-read endpoint for resolving the schedule associated with an event-type slug.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-9dc472763e91223e0b32fca089e1dd0b9ecdb4d46d85eb9a592e23d807c784bd'>apps/api/v2/src/modules/atoms/controllers/atoms.schedules.controller.ts</a>
</details>
<details>
<summary>schedules-atom.service.ts<code>Resolve event schedules through shared handler</code> <code>+10/-0</code></summary>
<br/>
>Resolve event schedules through shared handler
>
><pre>
>• Injects the read-only Prisma service and delegates event-slug schedule lookup to the existing schedule handler.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-2c5ebf8f3c8a878704aa2b8208d87784a3b5c84506981e2c561f2b40d9f74f56'>apps/api/v2/src/modules/atoms/services/schedules-atom.service.ts</a>
</details>
<details>
<summary>common.json<code>Add troubleshooter display translations</code> <code>+2/-0</code></summary>
<br/>
>Add troubleshooter display translations
>
><pre>
>• Adds localized labels for nameless calendars and the singular availability schedule heading.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-57de4b8e5231f1d699891d98b0381d56e9e24537b0ca5420d1fba4f0597370bc'>apps/web/public/static/locales/en/common.json</a>
</details>
<details>
<summary>CalendarToggleContainerComponent.tsx<code>Extract reusable connected-calendar panel</code> <code>+174/-0</code></summary>
<br/>
>Extract reusable connected-calendar panel
>
><pre>
>• Introduces a transport-agnostic calendar list supporting connected, unavailable, loading, management, and installation states. Navigation can be supplied as links or callbacks.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-9d1430807982147b29f78d9fc45bf49431b4a4c2de3959e6fe1181a788ebc5e1'>packages/features/troubleshooter/components/CalendarToggleContainerComponent.tsx</a>
</details>
<details>
<summary>EventScheduleItemComponent.tsx<code>Extract reusable schedule summary</code> <code>+33/-0</code></summary>
<br/>
>Extract reusable schedule summary
>
><pre>
>• Adds a localized schedule summary component with loading fallback and an optional consumer-provided action slot.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-fc9be9fc16fb643025114fd5e23a39cab6e38a20d94abed766857451eec5e20b'>packages/features/troubleshooter/components/EventScheduleItemComponent.tsx</a>
</details>
<details>
<summary>EventTypeSelectComponent.tsx<code>Extract reusable event-type selection logic</code> <code>+115/-0</code></summary>
<br/>
>Extract reusable event-type selection logic
>
><pre>
>• Adds a shared selector that maps event types, initializes selection from query state, and stores personal username or team context for calendar rendering.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-5edca439a3077d1088206982a9f4e8a6926f8b57d26c77f713b858ec04457fa5'>packages/features/troubleshooter/components/EventTypeSelectComponent.tsx</a>
</details>
<details>
<summary>store.ts<code>Support platform-specific troubleshooter state</code> <code>+14/-4</code></summary>
<br/>
>Support platform-specific troubleshooter state
>
><pre>
>• Adds platform mode and personal-event usernames to shared state. Platform mode prevents event selection from mutating the host application's eventTypeId query parameter.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-e9a2d12c73e30716714ff0134f64c73760315855a34cc49bcc6d14764a587b7a'>packages/features/troubleshooter/store.ts</a>
</details>
<details>
<summary>useEventTypesList.tsx<code>Add atom event-type list hook</code> <code>+39/-0</code></summary>
<br/>
>Add atom event-type list hook
>
><pre>
>• Introduces a React Query hook for the authenticated event-type list endpoint, gated by atom initialization.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-743cadf18677ed725447bcfe12f04aa06852e1d65f861b5c73a66646414ca2da'>packages/platform/atoms/hooks/useEventTypesList.tsx</a>
</details>
<details>
<summary>useScheduleByEventSlug.tsx<code>Add atom schedule lookup hook</code> <code>+40/-0</code></summary>
<br/>
>Add atom schedule lookup hook
>
><pre>
>• Introduces a React Query hook that retrieves a selected event type's schedule when both atom initialization and an event slug are available.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-c3f5e2605492ee89584b94d405539fc4a3d8070ddfb4561c4c56e5876b684bcd'>packages/platform/atoms/hooks/useScheduleByEventSlug.tsx</a>
</details>
<details>
<summary>index.ts<code>Export the Troubleshooter atom</code> <code>+35/-42</code></summary>
<br/>
>Export the Troubleshooter atom
>
><pre>
>• Exports the new TroubleShooter component and reorganizes the atom package's public exports.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-50aa2ec24edd0285bd919d745b76f5918a1a77d65fb789e46a8387d0808bf31e'>packages/platform/atoms/index.ts</a>
</details>
<details>
<summary>index.ts<code>Define troubleshooter package entry point</code> <code>+1/-0</code></summary>
<br/>
>Define troubleshooter package entry point
>
><pre>
>• Exports the platform wrapper from the troubleshooter atom module.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-782171c04bb024b475ad50cba121c272aa769f502e473b026b9c13198d5505dd'>packages/platform/atoms/troubleshooter/index.ts</a>
</details>
<details>
<summary>LargeCalendar.tsx<code>Render availability for selected event type</code> <code>+31/-0</code></summary>
<br/>
>Render availability for selected event type
>
><pre>
>• Selects team or username calendar-view parameters from troubleshooter state and renders the existing platform calendar wrapper.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-7f021c2f3209a65cd19774d950b1b31a4861870256187c775acf104a51784ad7'>packages/platform/atoms/troubleshooter/large-calendar/LargeCalendar.tsx</a>
</details>
<details>
<summary>CalendarToggleContainer.tsx<code>Connect atom calendar data to shared UI</code> <code>+27/-0</code></summary>
<br/>
>Connect atom calendar data to shared UI
>
><pre>
>• Loads connected calendars through the atom hook and translates optional host callbacks into shared component actions.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-bc500e30c18c230b9261acb2e6e819529317022b081311b1dbf4e34620e45cf9'>packages/platform/atoms/troubleshooter/sidebar/CalendarToggleContainer.tsx</a>
</details>
<details>
<summary>EventScheduleItem.tsx<code>Connect atom schedule lookup to shared UI</code> <code>+13/-0</code></summary>
<br/>
>Connect atom schedule lookup to shared UI
>
><pre>
>• Reads the selected event slug, loads its schedule through the atom API hook, and renders the shared schedule summary.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-c250798c03739ace2599aee970f06ef4000aeaa4fcc24afb7c4ed174866732b6'>packages/platform/atoms/troubleshooter/sidebar/EventScheduleItem.tsx</a>
</details>
<details>
<summary>EventTypeSelect.tsx<code>Connect atom event types to shared selector</code> <code>+13/-0</code></summary>
<br/>
>Connect atom event types to shared selector
>
><pre>
>• Loads atom event types and passes query data and pending state into the reusable event-type selector.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-a89dfda9a6a018d8e70a7a32243e93cf6809a912ff9e9e07f7bd70d96f88279b'>packages/platform/atoms/troubleshooter/sidebar/EventTypeSelect.tsx</a>
</details>
<details>
<summary>TroubleshooterSidebar.tsx<code>Compose the troubleshooter sidebar</code> <code>+42/-0</code></summary>
<br/>
>Compose the troubleshooter sidebar
>
><pre>
>• Builds the desktop sidebar from event selection, schedule details, and connected-calendar controls with optional host callbacks.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-e6d4e8028403d0631f4f184fc18e288a5c994ee2d336066188296a361fa7ed22'>packages/platform/atoms/troubleshooter/sidebar/TroubleshooterSidebar.tsx</a>
</details>
<details>
<summary>TroubleshooterPlatformWrapper.tsx<code>Build the embeddable Troubleshooter atom</code> <code>+89/-0</code></summary>
<br/>
>Build the embeddable Troubleshooter atom
>
><pre>
>• Adds responsive layout, atom and Booker providers, platform-aware store initialization, sidebar callbacks, and the main availability calendar.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-c90545839a16b7b6713d56b034a16448cae8d8d6c3670e85e3751ab9a0a068cf'>packages/platform/atoms/troubleshooter/wrappers/TroubleshooterPlatformWrapper.tsx</a>
</details>
<details>
<summary>event-types.ts<code>Expose shared event-type list handler</code> <code>+2/-0</code></summary>
<br/>
>Expose shared event-type list handler
>
><pre>
>• Re-exports the tRPC event-type list handler for use by the atom API controller.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-ecd7c97809dba2f1384354ca1534100285a5f250e4e20221a399d365de1bd11e'>packages/platform/libraries/event-types.ts</a>
</details>
<details>
<summary>schedules.ts<code>Expose event-slug schedule handler</code> <code>+2/-0</code></summary>
<br/>
>Expose event-slug schedule handler
>
><pre>
>• Re-exports the schedule lookup handler for use by atom services.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-00b8cfc1b86f8c516192c63b3817e2c850c144539e44154da406c415aabe08b1'>packages/platform/libraries/schedules.ts</a>
</details>
<details>
<summary>listWithTeam.handler.ts<code>Return personal usernames with event types</code> <code>+7/-4</code></summary>
<br/>
>Return personal usernames with event types
>
><pre>
>• Adds usernames for personal event types, excludes team-owned records from the personal query branch, and narrows the required user context. Team event types continue to return team metadata without usernames.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-fd564c1880f07bc0d40a9f29d8bee92a971aa3590dc1c312e228ed9140a07f00'>packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts</a>
</details>
</dd>
</dl>
</details>
<details>
<summary>Refactor (8) <code> +51 / -232 </code></summary>
<dl>
<dd>
<details>
<summary>AvailabilitySchedulesContainer.tsx<code>Use shared troubleshooter list container</code> <code>+1/-1</code></summary>
<br/>
>Use shared troubleshooter list container
>
><pre>
>• Replaces the local list-item import with the reusable feature-package component.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-00e8c09c774396fa05d25de04e8cc3933d57c06893425a256795be87a79737b8'>apps/web/modules/troubleshooter/components/AvailabilitySchedulesContainer.tsx</a>
</details>
<details>
<summary>CalendarToggleContainer.tsx<code>Delegate calendar toggles to shared component</code> <code>+9/-117</code></summary>
<br/>
>Delegate calendar toggles to shared component
>
><pre>
>• Removes duplicated calendar rendering and supplies tRPC data plus web navigation actions to the shared calendar component.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-adbdabb55042455183ea8eb5f246c008a6ded822e912a19f499fad70aa94173c'>apps/web/modules/troubleshooter/components/CalendarToggleContainer.tsx</a>
</details>
<details>
<summary>ConnectedAppsContainer.tsx<code>Use shared list-item header</code> <code>+1/-1</code></summary>
<br/>
>Use shared list-item header
>
><pre>
>• Switches the connected-app display to the list header exported by the troubleshooter feature package.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-7f36f0facf8d684ab8c9139583a87937642ae5361b0e0cb862dec397d525125b'>apps/web/modules/troubleshooter/components/ConnectedAppsContainer.tsx</a>
</details>
<details>
<summary>EventScheduleItem.tsx<code>Reuse shared schedule presentation</code> <code>+30/-31</code></summary>
<br/>
>Reuse shared schedule presentation
>
><pre>
>• Retains web-specific tRPC fetching and edit navigation while delegating schedule presentation to a reusable component.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-f1809ee63b1c5c908d88afa41b0e92dd406732e82e84d96d4e1ec02be2e5f662'>apps/web/modules/troubleshooter/components/EventScheduleItem.tsx</a>
</details>
<details>
<summary>EventTypeSelect.tsx<code>Reuse shared event-type selector</code> <code>+8/-80</code></summary>
<br/>
>Reuse shared event-type selector
>
><pre>
>• Keeps web-specific tRPC loading while moving selection initialization and rendering into the shared feature component.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-f0fe7c5e8abc95f3d06fa0fab4509e68ce5af79406659dd2f04e57cbde635367'>apps/web/modules/troubleshooter/components/EventTypeSelect.tsx</a>
</details>
<details>
<summary>TroubleshooterListItemContainer.tsx<code>Relocate shared troubleshooter list primitives</code> <code>+0/-0</code></summary>
<br/>
>Relocate shared troubleshooter list primitives
>
><pre>
>• Moves the reusable list-item container and header into the feature package so web and platform consumers share the same presentation.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-18c16d7d02d14469a20abb94255b1854e62c22c18a2ca1ac3b1fe31da6098a47'>packages/features/troubleshooter/components/TroubleshooterListItemContainer.tsx</a>
</details>
<details>
<summary>get.handler.ts<code>Narrow schedule handler user dependency</code> <code>+1/-1</code></summary>
<br/>
>Narrow schedule handler user dependency
>
><pre>
>• Restricts the handler context type to the user fields it actually requires, allowing reuse with API user projections.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-92602e022ecd515b7928a54087d7be923112ea353f8bcd370decb6d4dd8f671e'>packages/trpc/server/routers/viewer/availability/schedule/get.handler.ts</a>
</details>
<details>
<summary>getScheduleByEventTypeSlug.handler.ts<code>Narrow event schedule handler context</code> <code>+1/-1</code></summary>
<br/>
>Narrow event schedule handler context
>
><pre>
>• Restricts the required user context to identifier, timezone, and default schedule fields for cross-transport reuse.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-e398ead79ba22ed04eccf01845441273f80a8b6cf67cf8c3e1c710b5ddf72117'>packages/trpc/server/routers/viewer/availability/schedule/getScheduleByEventTypeSlug.handler.ts</a>
</details>
</dd>
</dl>
</details>
<details>
<summary>Documentation (2) <code> +33 / -0 </code></summary>
<dl>
<dd>
<details>
<summary>index.tsx<code>Link the troubleshooter example</code> <code>+3/-0</code></summary>
<br/>
>Link the troubleshooter example
>
><pre>
>• Adds the Troubleshooter demonstration page to the base example navigation.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-4201b9deba0e5d4c628d5ccc0046e3e44e3942ed73a480424661987914884008'>packages/platform/examples/base/src/components/Navbar/index.tsx</a>
</details>
<details>
<summary>troubleshooter.tsx<code>Demonstrate Troubleshooter atom integration</code> <code>+30/-0</code></summary>
<br/>
>Demonstrate Troubleshooter atom integration
>
><pre>
>• Adds an example page embedding the atom and wiring calendar management and installation callbacks to host-app navigation.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/21/files#diff-8eed41d1059cff2c7a1ccb080ebafdd423ddc55124083cfc50e85b5c19069ec4'>packages/platform/examples/base/src/pages/troubleshooter.tsx</a>
</details>
</dd>
</dl>
</details>
</dd>
</dl>
</details>