Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ Then restart the dev server, and you should be able to access the app behind the
Some OAuth providers restrict `redirect_uri` to be HTTPS, and others explicitly block `localhost` for security reasons.

## Common errors

### Error - Duplicate Vercel Project Causing MaxDuration Errors on PRs

GitHub PRs were showing Vercel build errors referencing `MaxDuration`, despite deployments working correctly on the Enterprise Vercel account.
Expand Down
2 changes: 2 additions & 0 deletions src/app/(app)/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ProfileOrganizationsSection } from '@/components/profile/ProfileOrganiz
import { ProfileKiloPassSection } from '@/components/profile/ProfileKiloPassSection';
import { CreateKilocodeOrgButton } from '@/components/dev/CreateKilocodeOrgButton';
import { isFeatureFlagEnabled } from '@/lib/posthog-feature-flags';
import { WelcomeTypeformModal } from '@/components/profile/WelcomeTypeformModal';
import { UserProfileCard } from '@/components/profile/UserProfileCard';

export default async function ProfilePage({ searchParams }: AppPageProps) {
Expand All @@ -41,6 +42,7 @@ export default async function ProfilePage({ searchParams }: AppPageProps) {
: 'Remaining Credits';
return (
<>
{!user.completed_welcome_form && <WelcomeTypeformModal userEmail={user.google_user_email} />}
{/* NOTE: When making changes to this structure, make sure to also update the structure in the loading.tsx file */}
<PageLayout title="Profile">
<div className="flex w-full flex-col gap-4 lg:flex-row">
Expand Down
9 changes: 8 additions & 1 deletion src/app/admin/oss/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,14 @@ function ManualEntrySection() {
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
if (!canSubmit) return;
processOssCsvMutation.mutate([{ githubUrl: githubUrl.match(/^https?:\/\//) ? githubUrl : `https://${githubUrl}`, email, creditsDollars, tier }]);
processOssCsvMutation.mutate([
{
githubUrl: githubUrl.match(/^https?:\/\//) ? githubUrl : `https://${githubUrl}`,
email,
creditsDollars,
tier,
},
]);
};

return (
Expand Down
1 change: 1 addition & 0 deletions src/app/api/cloud-agent/sessions/prepare/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ function createMockUser(overrides: Partial<User> = {}): User {
default_model: null,
is_bot: false,
cohorts: {},
completed_welcome_form: false,
linkedin_url: null,
github_url: null,
...overrides,
Expand Down
66 changes: 66 additions & 0 deletions src/components/profile/WelcomeTypeformModal.tsx
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the bot may have a good point about theming

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's weird because dark mode on the modal wasn't triggering for me until I forced it in the browser console, regardless it should look good now

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
'use client';

import { useState } from 'react';
import { Widget } from '@typeform/embed-react';
import { useTRPC } from '@/lib/trpc/utils';
import { useMutation } from '@tanstack/react-query';
import { Dialog, DialogContent, DialogTitle } from '@/components/ui/dialog';

const WELCOME_FORM_ID = 'xNTrQO4E';

type WelcomeTypeformModalProps = {
userEmail: string;
};

export function WelcomeTypeformModal({ userEmail }: WelcomeTypeformModalProps) {
const [isOpen, setIsOpen] = useState(true);
const [hasMarkedComplete, setHasMarkedComplete] = useState(false);
const trpc = useTRPC();

const markCompleteMutation = useMutation(
trpc.user.markWelcomeFormCompleted.mutationOptions({
onSuccess: () => {
setIsOpen(false);
},
onError: error => {
console.error('Failed to mark welcome form completed:', error);
setHasMarkedComplete(false);
},
})
);

const handleComplete = () => {
if (hasMarkedComplete) return;
setHasMarkedComplete(true);
markCompleteMutation.mutate();
};

if (!isOpen) return null;

return (
<Dialog
open={isOpen}
onOpenChange={open => {
if (!open) {
handleComplete();
}
}}
>
<DialogContent
className="[&>button]:text-muted-foreground [&>button]:hover:bg-muted [&>button]:hover:text-foreground h-[50vh] max-w-[90vw] overflow-hidden p-0 sm:h-[400px] sm:max-w-xl [&>button]:rounded-md [&>button]:p-2"
onPointerDownOutside={e => e.preventDefault()}
onEscapeKeyDown={e => e.preventDefault()}
>
<DialogTitle className="sr-only">Welcome to Kilo</DialogTitle>
<Widget
id={WELCOME_FORM_ID}
hidden={{
email: userEmail,
}}
onSubmit={handleComplete}
onClose={handleComplete}
/>
</DialogContent>
</Dialog>
);
}
2 changes: 2 additions & 0 deletions src/db/migrations/0013_chilly_richard_fisk.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "kilocode_users" ADD COLUMN "completed_welcome_form" boolean DEFAULT false NOT NULL;
UPDATE "kilocode_users" SET "completed_welcome_form" = true;
2 changes: 2 additions & 0 deletions src/db/migrations/0015_huge_stardust.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "kilocode_users" ADD COLUMN "completed_welcome_form" boolean DEFAULT false NOT NULL;
UPDATE "kilocode_users" SET "completed_welcome_form" = true;
Loading