Skip to content

feat: download iCal and add to Outlook #331

Open
IsaacPhoon wants to merge 17 commits intomainfrom
ip/ical-and-outlook
Open

feat: download iCal and add to Outlook #331
IsaacPhoon wants to merge 17 commits intomainfrom
ip/ical-and-outlook

Conversation

@IsaacPhoon
Copy link
Copy Markdown
Contributor

Description

This PR adds two features

  • Download iCal
  • Add to Outlook

These features are only accessible if a meeting is scheduled, similarly to how the Google Calendar button works.
Works for both days of the week meeting as well as normal meetings
Note: Similarly to Google Calendar, we can only add a contiguous time block for 1 day. Therefore, when meetings on multiple days are scheduled, adding to Outlook only adds the first day, with a popup that lets the user know that if they want multiple days, they should export through the iCal feature

Recording/Screenshots

Before

After

Test Plan

Issues

Copy link
Copy Markdown
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.

3 issues found across 4 files

Prompt for AI agents (unresolved issues)

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="src/lib/ical.ts">

<violation number="1" location="src/lib/ical.ts:115">
P1: Generate the iCal timestamps in `meetingData.timezone`, not the server's local timezone. As written, `.ics` downloads shift meeting times whenever the meeting timezone and server timezone differ.</violation>
</file>

<file name="src/components/availability/header/availability-header.tsx">

<violation number="1" location="src/components/availability/header/availability-header.tsx:288">
P1: Pass the meeting timezone into the Outlook link generation. The current link uses timezone-less `startdt`/`enddt`, so Outlook will interpret the event in the opener's local timezone and shift meetings for users outside `meetingData.timezone`.</violation>

<violation number="2" location="src/components/availability/header/availability-header.tsx:330">
P2: Wrap the iCal download action in `try/catch` so server-action failures surface a toast instead of becoming an unhandled rejected promise.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/lib/ical.ts Outdated
onClick={async () => {
try {
const { success, link, totalDays } =
await getOutlookCalendarLink({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: Pass the meeting timezone into the Outlook link generation. The current link uses timezone-less startdt/enddt, so Outlook will interpret the event in the opener's local timezone and shift meetings for users outside meetingData.timezone.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/components/availability/header/availability-header.tsx, line 288:

<comment>Pass the meeting timezone into the Outlook link generation. The current link uses timezone-less `startdt`/`enddt`, so Outlook will interpret the event in the opener's local timezone and shift meetings for users outside `meetingData.timezone`.</comment>

<file context>
@@ -273,6 +277,72 @@ export function AvailabilityHeader({
+										onClick={async () => {
+											try {
+												const { success, link, totalDays } =
+													await getOutlookCalendarLink({
+														meetingId: meetingData.id,
+														meetingTitle: meetingData.title,
</file context>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the update!

Comment thread src/components/availability/header/availability-header.tsx Outdated
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
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 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

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="src/server/actions/availability/outlook/action.ts">

<violation number="1" location="src/server/actions/availability/outlook/action.ts:20">
P1: Using UTC date parts here can shift the event to the wrong calendar day; use local date getters when composing the date string.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/server/actions/availability/outlook/action.ts Outdated
Copy link
Copy Markdown
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 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

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="src/lib/ical.ts">

<violation number="1" location="src/lib/ical.ts:78">
P1: Using local date getters here can shift the calendar day by timezone, causing exported iCal/Outlook events to land on the wrong date. Keep UTC getters when deriving the Y-M-D used for timezone conversion.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/lib/ical.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iCal / Outlook Event Download

1 participant