Skip to content

Conversation

@sean-brydon
Copy link
Member

@sean-brydon sean-brydon commented Dec 8, 2025

What does this PR do?

Fixes: CAL-6882

How should this be tested?

Create a team event - book a meeting
load troubleshooter and see that we can see events on troubleshooter + select team events from sidebar

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

Show team event types in the Troubleshooter and fix a race condition so selected events load reliably. Addresses CAL-6882 by displaying team events in the sidebar and calendar.

  • Bug Fixes

    • Load event types with team data (listWithTeam) and select by eventTypeId; initialize from query param with safe default to avoid race.
    • Use eventId (not slug) for team events when fetching schedules; pass isTeamEvent to ensure correct availability.
    • Fix edit badge hover state (invisible → visible on hover).
  • Migration

    • Troubleshooter query param changed from eventType (slug) to eventTypeId (number). Update any deep links.

Written for commit 288b576. Summary will update automatically on new commits.

@linear
Copy link

linear bot commented Dec 8, 2025

@graphite-app graphite-app bot requested a review from a team December 8, 2025 11:35
event: null,
setEvent: (event: EventType) => {
set({ event });
updateQueryParam("eventType", event.slug ?? "");
Copy link
Member Author

Choose a reason for hiding this comment

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

Lets use IDs now instead of slugs as if teams had the same slug on events i.e /marketing - this would break the selector

export const listWithTeamHandler = async ({ ctx }: ListWithTeamOptions) => {
const userId = ctx.user.id;
const query = Prisma.sql`SELECT "public"."EventType"."id", "public"."EventType"."teamId", "public"."EventType"."title", "public"."EventType"."slug", "j1"."name" as "teamName"
const query = Prisma.sql`SELECT "public"."EventType"."id", "public"."EventType"."teamId", "public"."EventType"."title", "public"."EventType"."slug", "public"."EventType"."length", "j1"."name" as "teamName"
Copy link
Member Author

Choose a reason for hiding this comment

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

We need length here for troubleshooter on team events

Copy link
Member Author

Choose a reason for hiding this comment

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

Nothing really changed in this file other than the way we select from store - fixes a race condition

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.

1 issue found across 5 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/features/troubleshooter/components/EventTypeSelect.tsx">

<violation number="1" location="packages/features/troubleshooter/components/EventTypeSelect.tsx:77">
P2: Missing fallback when `eventTypeId` from URL is not found. The original code fell back to the first event type when the query param event wasn&#39;t found, but this behavior was removed. Users with invalid/stale `eventTypeId` query params will see no event selected.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

duration: option.duration,
});
const foundEventType = eventTypes?.find((et) => et.id === option.id);
if (foundEventType) {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 8, 2025

Choose a reason for hiding this comment

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

P2: Missing fallback when eventTypeId from URL is not found. The original code fell back to the first event type when the query param event wasn't found, but this behavior was removed. Users with invalid/stale eventTypeId query params will see no event selected.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/troubleshooter/components/EventTypeSelect.tsx, line 77:

<comment>Missing fallback when `eventTypeId` from URL is not found. The original code fell back to the first event type when the query param event wasn&#39;t found, but this behavior was removed. Users with invalid/stale `eventTypeId` query params will see no event selected.</comment>

<file context>
@@ -7,67 +8,80 @@ import { getQueryParam } from &quot;../../bookings/Booker/utils/query-param&quot;;
-          duration: option.duration,
-        });
+        const foundEventType = eventTypes?.find((et) =&gt; et.id === option.id);
+        if (foundEventType) {
+          setSelectedEventType({
+            id: foundEventType.id,
</file context>
Fix with Cubic

Copy link
Member

@alishaz-polymath alishaz-polymath left a comment

Choose a reason for hiding this comment

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

LGTM

@alishaz-polymath alishaz-polymath enabled auto-merge (squash) December 9, 2025 04:43
@vercel
Copy link

vercel bot commented Dec 9, 2025

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

Project Deployment Preview Comments Updated (UTC)
cal-companion Ready Ready Preview Comment Dec 9, 2025 7:18am
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Dec 9, 2025 7:18am
cal-eu Ignored Ignored Dec 9, 2025 7:18am

@alishaz-polymath alishaz-polymath merged commit 75b93ce into main Dec 9, 2025
38 of 39 checks passed
@alishaz-polymath alishaz-polymath deleted the fix/troubleshooter-team-events branch December 9, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants