Skip to content

Ip/meeting invite system#412

Merged
ethancha0 merged 8 commits intomainfrom
ip/meeting-invite-system
Apr 22, 2026
Merged

Ip/meeting invite system#412
ethancha0 merged 8 commits intomainfrom
ip/meeting-invite-system

Conversation

@IsaacPhoon
Copy link
Copy Markdown
Contributor

@IsaacPhoon IsaacPhoon commented Apr 16, 2026

Description

  • Add meeting_invites and meeting_invite_responses tables to DB schema, mirroring the existing group invite tables, and generate migration
  • Add inviteMeetingMembers server action that creates/reuses a meeting_invites row and sends in-app notifications to selected users with a link to the meeting
  • Add InviteMembersDialog component with member autocomplete search, selected member chips, and a copyable meeting link
  • Add "Invite Members" button to the availability page header (host-only), wired to the dialog
  • Update notification panel to navigate to the meeting page when a "Meeting Invite" notification is viewed, instead of opening the group invite dialog

4/17 - Updates (Ethan)

  • Recipients are auto-joined in the meeting
  • Pending Responders UI on availability sidebar
  • URL state management (after creation, redirect to a url, triggering the dialog)

Recording/Screenshots

image image

Test Plan

Issues

  • "Invited" Tab on Meetings page

@IsaacPhoon IsaacPhoon temporarily deployed to staging-412 April 16, 2026 22:07 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-412 April 16, 2026 22:08 Inactive
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.

2 issues found across 9 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/components/availability/header/availability-header.tsx">

<violation number="1" location="src/components/availability/header/availability-header.tsx:301">
P2: The new "Invite Members" button is visually empty on small screens because its text is hidden and no icon is provided.</violation>
</file>

<file name="src/server/actions/meeting/invite/action.ts">

<violation number="1" location="src/server/actions/meeting/invite/action.ts:46">
P2: The create-or-reuse logic is race-prone and can create multiple `meeting_invites` rows for the same meeting under concurrent requests.</violation>
</file>

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

Comment thread src/components/availability/header/availability-header.tsx
try {
let invite = await getExistingMeetingInvite(meetingId);

if (!invite) {
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.

P2: The create-or-reuse logic is race-prone and can create multiple meeting_invites rows for the same meeting under concurrent requests.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/server/actions/meeting/invite/action.ts, line 46:

<comment>The create-or-reuse logic is race-prone and can create multiple `meeting_invites` rows for the same meeting under concurrent requests.</comment>

<file context>
@@ -0,0 +1,81 @@
+	try {
+		let invite = await getExistingMeetingInvite(meetingId);
+
+		if (!invite) {
+			const [newInvite] = await db
+				.insert(meetingInvites)
</file context>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is ok for now. The following PR will introduce customizable and single-use invite links

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.

Got it—thanks for the context. Understood this will be addressed in the next PR.

Copy link
Copy Markdown
Collaborator

@ethancha0 ethancha0 left a comment

Choose a reason for hiding this comment

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

Great job Isaac, sending invites, notifications, and joining a meeting all works properly. Since you won't be in town for the next few days I can take over.

Here are a few cleanups I did in the InviteMembersDialog.tsx file:

  • getInitials moved outside of component
  • debounce raised to 300ms
  • cleanup useEffect for both timeouts
  • added copiedTimeoutRef to cleanup setCopied safely
  • removed typeof window !== "undefined" since we're in a client component
  • excess useCallback removed

I will also be polishing up the user flow by

  • triggering the dialog upon freshly created meeting
  • recipients will auto-join a meeting
  • add an "invited" tab on the meetings page

Overall, this a great base implementation for inviting users to a meeting ◡̈

@ethancha0 ethancha0 temporarily deployed to staging-412 April 17, 2026 17:23 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-412 April 17, 2026 17:24 Inactive
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 1 file (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/components/availability/invite-members-dialog.tsx">

<violation number="1" location="src/components/availability/invite-members-dialog.tsx:122">
P2: Clear any existing copy-reset timeout before creating a new one, otherwise repeated clicks can reset the “Copied” state too early.</violation>
</file>

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

Comment thread src/components/availability/invite-members-dialog.tsx
@ethancha0 ethancha0 temporarily deployed to staging-412 April 17, 2026 17:56 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-412 April 17, 2026 17:57 Inactive
@ethancha0 ethancha0 temporarily deployed to staging-412 April 17, 2026 20:28 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-412 April 17, 2026 20:28 Inactive
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.

8 issues found across 19 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/components/availability/group-availability.tsx">

<violation number="1" location="src/components/availability/group-availability.tsx:89">
P1: Passing `timeZone` into `getTimestampFromBlockIndex` can produce wrong timestamps for overnight ranges because the timezone path does not roll over days when block hours exceed 23.</violation>
</file>

<file name="src/lib/rooms/utils.ts">

<violation number="1" location="src/lib/rooms/utils.ts:9">
P1: `formatISOToLocalTime` should not hard-code `America/Los_Angeles`; this breaks local-time display for non-PT users.</violation>
</file>

<file name="src/components/nav/personal-availability-sidebar.tsx">

<violation number="1" location="src/components/nav/personal-availability-sidebar.tsx:101">
P2: Guard this async effect against stale responses and clear `importableMeetings` on failure; otherwise old meeting results can be rendered for the current meeting.</violation>

<violation number="2" location="src/components/nav/personal-availability-sidebar.tsx:213">
P2: Use unique `id`/`aria-controls` values for this new accordion; duplicated IDs create invalid ARIA wiring.</violation>
</file>

<file name="src/components/studyrooms/heatmap/rooms-heatmap.tsx">

<violation number="1" location="src/components/studyrooms/heatmap/rooms-heatmap.tsx:69">
P2: Availability sorting includes slots after the selected end time, so room order can disagree with the visible heatmap window.</violation>
</file>

<file name="src/components/studyrooms/room-results.tsx">

<violation number="1" location="src/components/studyrooms/room-results.tsx:31">
P1: Parsing `toLocaleTimeString(..., { hour12: false })` can produce `24:xx` in `en-US`, which misclassifies midnight slots and filters out valid availability.</violation>
</file>

<file name="src/lib/availability/utils.ts">

<violation number="1" location="src/lib/availability/utils.ts:228">
P1: Timezone conversion builds invalid local times when slot minutes pass midnight (e.g. 24:15), which can break ISO generation for overnight availability windows.</violation>

<violation number="2" location="src/lib/availability/utils.ts:254">
P2: Using first/last `availabilityTimeBlocks` entries assumes sorted bounds and breaks overnight/wrapped block ranges.</violation>
</file>

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

Comment thread src/components/availability/group-availability.tsx
Comment thread src/lib/rooms/utils.ts
Comment thread src/components/studyrooms/room-results.tsx
Comment thread src/lib/availability/utils.ts
Comment thread src/components/nav/personal-availability-sidebar.tsx
Comment thread src/components/nav/personal-availability-sidebar.tsx
Comment thread src/components/studyrooms/heatmap/rooms-heatmap.tsx
Comment thread src/lib/availability/utils.ts
@ethancha0 ethancha0 force-pushed the ip/meeting-invite-system branch from 97f6e49 to 0e5e4fc Compare April 19, 2026 20:45
@ethancha0 ethancha0 temporarily deployed to staging-412 April 19, 2026 20:45 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-412 April 19, 2026 20:45 Inactive
@ethancha0 ethancha0 force-pushed the ip/meeting-invite-system branch from 0e5e4fc to 7e29534 Compare April 22, 2026 00:17
@ethancha0 ethancha0 temporarily deployed to staging-412 April 22, 2026 00:17 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-412 April 22, 2026 00:17 Inactive
@ethancha0 ethancha0 temporarily deployed to staging-412 April 22, 2026 00:25 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-412 April 22, 2026 00:25 Inactive
@ethancha0 ethancha0 temporarily deployed to staging-412 April 22, 2026 02:06 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-412 April 22, 2026 02:06 Inactive
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 5 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/components/availability/invite-members-dialog.tsx">

<violation number="1" location="src/components/availability/invite-members-dialog.tsx:214">
P3: `Typography` with `variant="caption"` is inline by default, so `mb-4` won’t apply bottom spacing. Make this caption block-level so the intended spacing is preserved.</violation>
</file>

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

Comment thread src/components/availability/invite-members-dialog.tsx Outdated
@ethancha0 ethancha0 temporarily deployed to staging-412 April 22, 2026 02:20 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-412 April 22, 2026 02:20 Inactive
@ethancha0 ethancha0 merged commit 4bcfa3f into main Apr 22, 2026
2 checks passed
@ethancha0 ethancha0 deleted the ip/meeting-invite-system branch April 22, 2026 02:25
ethancha0 added a commit that referenced this pull request Apr 25, 2026
* feat: ✨ meeting invites frontend

* feat: ✨ db and server action for meeting invites

* chore: 🔧 cleanup useeffects, debounce raised, cleanup functions

* feat: ✨ recipients autoadd to meeting, pending responders on sidebar

* fix: 🐛 clear copy timeout before scheduling

* fix: 🐛 migration conflicts

* fix: 🐛 typography, rm dead table

* fix: 🐛 restore table

---------

Co-authored-by: ethancha0 <ethanchao2005@gmail.com>
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.

Meeting Invite System

2 participants