Skip to content

feat: add widget app — chat screens, VAPI integration, auth, voice UI - #6

Merged
ladaniprem merged 1 commit into
masterfrom
09-widget-updates
Jul 4, 2026
Merged

ladaniprem merged 1 commit into
masterfrom
09-widget-updates

Conversation

@ladaniprem

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 4, 2026 12:15
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ladaniprem, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: c2a92419-43e0-43b2-8119-8d0bd290f0bd

📥 Commits

Reviewing files that changed from the base of the PR and between d8139c3 and a5f77a7.

⛔ Files ignored due to path filters (1)
  • apps/widget/public/logo.svg is excluded by !**/*.svg
📒 Files selected for processing (21)
  • apps/widget/app/layout.tsx
  • apps/widget/app/page.tsx
  • apps/widget/hooks/.gitkeep
  • apps/widget/lib/.gitkeep
  • apps/widget/modules/widget/atoms/widget-atoms.ts
  • apps/widget/modules/widget/constants.ts
  • apps/widget/modules/widget/hooks/use-vapi.ts
  • apps/widget/modules/widget/types.ts
  • apps/widget/modules/widget/ui/components/widget-footer.tsx
  • apps/widget/modules/widget/ui/components/widget-header.tsx
  • apps/widget/modules/widget/ui/screens/widget-auth-screen.tsx
  • apps/widget/modules/widget/ui/screens/widget-chat-screen.tsx
  • apps/widget/modules/widget/ui/screens/widget-contact-screen.tsx
  • apps/widget/modules/widget/ui/screens/widget-error-screen.tsx
  • apps/widget/modules/widget/ui/screens/widget-inbox-screen.tsx
  • apps/widget/modules/widget/ui/screens/widget-loading-screen.tsx
  • apps/widget/modules/widget/ui/screens/widget-selection-screen.tsx
  • apps/widget/modules/widget/ui/screens/widget-voice-screen.tsx
  • apps/widget/modules/widget/ui/views/widget-view.tsx
  • apps/widget/package.json
  • apps/widget/public/widget.js

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@ladaniprem
ladaniprem merged commit 94ac0a7 into master Jul 4, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a standalone “widget” app with an embeddable launcher script and a multi-screen UI for authenticated chat, inbox browsing, and optional voice calling via Vapi.

Changes:

  • Added a public embed script (widget.js) that injects a floating button and an iframe pointing at the widget app.
  • Implemented widget UI flow (loading → auth/selection → chat/inbox/voice/contact) using Jotai state and Convex queries/actions.
  • Added Vapi integration (voice calls + transcript UI) and supporting dependencies/assets.

Reviewed changes

Copilot reviewed 19 out of 22 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
apps/widget/public/widget.js Embeddable script that renders the launcher button + iframe and handles postMessage events.
apps/widget/public/logo.svg Logo asset used for assistant/avatar UI.
apps/widget/package.json Adds dependencies for Vapi, forms, validation, and supporting utilities.
apps/widget/modules/widget/ui/views/widget-view.tsx Screen router that renders the active widget screen based on atom state.
apps/widget/modules/widget/ui/screens/widget-loading-screen.tsx Initialization flow: org validation, session validation, settings load, Vapi secrets load.
apps/widget/modules/widget/ui/screens/widget-auth-screen.tsx Contact-session creation form (name/email) and metadata capture.
apps/widget/modules/widget/ui/screens/widget-selection-screen.tsx Entry point for starting chat, voice, or phone contact (feature-gated by settings/secrets).
apps/widget/modules/widget/ui/screens/widget-chat-screen.tsx Chat UI powered by Convex agent threads, suggestions, and message composer.
apps/widget/modules/widget/ui/screens/widget-inbox-screen.tsx Paginated list of past conversations with infinite scroll.
apps/widget/modules/widget/ui/screens/widget-voice-screen.tsx Voice call UI with live transcript display and speaking/listening indicator.
apps/widget/modules/widget/ui/screens/widget-contact-screen.tsx Shows phone number, copy-to-clipboard, and “Call Now” action.
apps/widget/modules/widget/ui/screens/widget-error-screen.tsx Error display screen for invalid configuration/init failures.
apps/widget/modules/widget/ui/components/widget-header.tsx Shared header with theme toggle.
apps/widget/modules/widget/ui/components/widget-footer.tsx Shared footer navigation (home/inbox).
apps/widget/modules/widget/hooks/use-vapi.ts Vapi client hook: connect/disconnect, speaking state, transcript events.
apps/widget/modules/widget/atoms/widget-atoms.ts Jotai atoms for screen routing, org/session IDs, settings, and secrets.
apps/widget/modules/widget/constants.ts Screen constants and contact-session storage key prefix.
apps/widget/modules/widget/types.ts Type helper for widget screen union.
apps/widget/app/page.tsx Widget app entry page that passes organizationId into the UI.
apps/widget/app/layout.tsx Minor formatting change.
apps/widget/lib/.gitkeep Keeps lib directory in git.
apps/widget/hooks/.gitkeep Keeps hooks directory in git.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,43 @@
(function(){"use strict";const o={WIDGET_URL:"localhost:3000",DEFAULT_POSITION:"bottom-right"},u=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
Comment thread apps/widget/app/page.tsx
Comment on lines 1 to +5
"use client";
import {useMutation, useQuery} from 'convex/react';
import {api} from "@workspace/backend/_generated/api";
import { Button } from '@workspace/ui/components/button';

export default function Page() {
const users = useQuery(api.users.getMany);
const addUser = useMutation(api.users.add);
import { use } from "react";

import { WidgetView } from "@/modules/widget/ui/views/widget-view";
Comment on lines +21 to +25
useEffect(() => {
if (!vapiSecrets) {
return;
}

Comment on lines +64 to +66
return () => {
vapiInstance.disconnect();
};
return () => {
vapiInstance.disconnect();
};
}, []);
Comment on lines +18 to +22
import {
AIConversation,
AIConversationContent,
AIConversationScrollButton,
} from "@workspace/ui/components/ai/conversation";
Comment on lines +96 to +101
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
message: "",
},
});
Comment on lines +72 to +77
<Button asChild className="w-full" size="lg">
<Link href={`tel:${phoneNumber}`}>
<PhoneIcon />
Call Now
</Link>
</Button>
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.

2 participants