Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3f5c7bc
wip
ameer2468 Oct 12, 2025
2c4c410
onboarding backend
ameer2468 Oct 13, 2025
e68957c
modify stripe webhook to handle checkout from onboarding
ameer2468 Oct 13, 2025
e3b25de
decrease timeout
ameer2468 Oct 13, 2025
ae3ef1d
put deployment url on success for testing
ameer2468 Oct 13, 2025
9b26d12
cancel url
ameer2468 Oct 13, 2025
8d4f42d
fixes
ameer2468 Oct 13, 2025
08ff461
set completion
ameer2468 Oct 13, 2025
6f59fed
attempt fix redirection
ameer2468 Oct 13, 2025
f5e1c65
logging
ameer2468 Oct 13, 2025
609278a
logs
ameer2468 Oct 14, 2025
0f3dda7
restore server env
ameer2468 Oct 14, 2025
d4c17c4
Update _journal.json
ameer2468 Oct 14, 2025
952f019
Merge branch 'main' into onboarding
richiemcilroy Oct 14, 2025
badaa37
cleanup
ameer2468 Oct 14, 2025
7da87fe
Merge branch 'onboarding' of https://github.com/CapSoftware/Cap into …
ameer2468 Oct 14, 2025
73bc732
minor refinements
ameer2468 Oct 14, 2025
a42f264
copy changes
richiemcilroy Oct 14, 2025
cdbeced
Merge branch 'onboarding' of https://github.com/CapSoftware/cap into …
richiemcilroy Oct 14, 2025
c52cf61
use transactions
ameer2468 Oct 14, 2025
b81659a
Merge branch 'onboarding' of https://github.com/CapSoftware/Cap into …
ameer2468 Oct 14, 2025
906d278
scaffold user rpcs
Brendonovich Oct 14, 2025
c70d720
rpc
ameer2468 Oct 14, 2025
2a1b233
Delete ONBOARDING_RPC_MIGRATION.md
ameer2468 Oct 14, 2025
6594be4
use S3 bucket service
ameer2468 Oct 14, 2025
4cfeedd
remove api endpoints
ameer2468 Oct 14, 2025
5ee586f
download page and fixes
ameer2468 Oct 14, 2025
9fb84d0
Merge branch 'main' into onboarding
ameer2468 Oct 14, 2025
44aff44
Update route.ts
ameer2468 Oct 14, 2025
724a038
cleanups
ameer2468 Oct 15, 2025
b54a556
Merge branch 'main' into onboarding
ameer2468 Oct 15, 2025
9088554
Update Items.tsx
ameer2468 Oct 15, 2025
dc24b11
remove dead code
ameer2468 Oct 15, 2025
8a644fe
Merge branch 'main' into onboarding
ameer2468 Oct 15, 2025
0d602f7
remove pushing
ameer2468 Oct 15, 2025
47c0b9f
conditional pushing
ameer2468 Oct 15, 2025
7d3645a
mb
ameer2468 Oct 15, 2025
f9e1710
prefill org name
ameer2468 Oct 15, 2025
c56f999
Merge branch 'main' into staging
ameer2468 Oct 15, 2025
a8ab75b
Update CustomDomainPage.tsx
ameer2468 Oct 15, 2025
63d06c2
Merge branch 'main' into staging
ameer2468 Oct 15, 2025
6c56457
Merge branch 'main' into onboarding
Brendonovich Oct 15, 2025
3004f01
Merge branch 'onboarding' of https://github.com/CapSoftware/Cap into …
Brendonovich Oct 15, 2025
60ec6de
use stripe context
ameer2468 Oct 15, 2025
6facdf6
Merge branch 'onboarding' of https://github.com/CapSoftware/Cap into …
ameer2468 Oct 15, 2025
a6f3843
Update CustomDomainPage.tsx
ameer2468 Oct 15, 2025
8e7372a
ts
ameer2468 Oct 15, 2025
16c5b6b
move user call into org-setup block
ameer2468 Oct 15, 2025
15a0935
redirect to org settings when checking out during onboarding
ameer2468 Oct 15, 2025
9858c08
add signout and skip
ameer2468 Oct 15, 2025
a2a136c
Update DownloadPage.tsx
ameer2468 Oct 15, 2025
2643d9f
Update DownloadPage.tsx
ameer2468 Oct 15, 2025
b2a9c47
Merge branch 'main' into staging
ameer2468 Oct 15, 2025
00e5948
Merge branch 'download-step-update' into staging
ameer2468 Oct 15, 2025
fad4ee8
improve upload image ui
ameer2468 Oct 17, 2025
f504a30
Merge branch 'improve-upload-image-ui' into staging
ameer2468 Oct 17, 2025
09d7373
Merge branch 'main' into staging
ameer2468 Oct 17, 2025
3995610
Update DownloadPage.tsx
ameer2468 Oct 17, 2025
60235fe
Fix pro check
ameer2468 Oct 18, 2025
b4595bb
Merge branch 'fix-pro-check' into staging
ameer2468 Oct 18, 2025
313669b
Update ShareHeader.tsx
ameer2468 Oct 18, 2025
6af12d7
Update ShareHeader.tsx
ameer2468 Oct 18, 2025
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
8 changes: 3 additions & 5 deletions apps/web/app/s/[videoId]/_components/ShareHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ export const ShareHeader = ({
}
};

const isUserPro = userIsPro(user);
const showUpgradeBanner =
user && data.ownerId === user.id && !userIsPro(user);
const isVideoOwnerPro = user && data.ownerId === user.id && userIsPro(user);

Comment on lines +132 to 133
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Use tri‑state isVideoOwnerPro to avoid showing owner CTAs to viewers.

Make isVideoOwnerPro: true | false | null using the already‑computed isOwner. This also fixes the user | boolean inference from the chained &&.

-  const isVideoOwnerPro = user && data.ownerId === user.id && userIsPro(user);
+  const isVideoOwnerPro: boolean | null = isOwner ? userIsPro(user) : null;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const isVideoOwnerPro = user && data.ownerId === user.id && userIsPro(user);
const isVideoOwnerPro: boolean | null = isOwner ? userIsPro(user) : null;
🤖 Prompt for AI Agents
In apps/web/app/s/[videoId]/_components/ShareHeader.tsx around lines 132-133,
the current const isVideoOwnerPro = user && data.ownerId === user.id &&
userIsPro(user); yields a boolean|User inference and always boolean, causing
owner CTAs to show incorrectly; change it to a tri-state const isVideoOwnerPro:
true | false | null = isOwner ? userIsPro(user) : null where isOwner is the
already-computed data.ownerId === user?.id (or use existing isOwner variable),
ensuring you only call userIsPro when isOwner is true and return null when no
owner/user context exists so UI can distinguish viewer vs known owner.

const handleSharingUpdated = () => {
refresh();
Expand Down Expand Up @@ -183,7 +181,7 @@ export const ShareHeader = ({

return (
<>
{showUpgradeBanner && (
{user !== null && !isVideoOwnerPro && (
<div className="flex sticky flex-col sm:flex-row inset-x-0 top-0 z-10 gap-4 justify-center items-center px-3 py-2 mx-auto w-[calc(100%-20px)] max-w-fit rounded-b-xl border bg-gray-4 border-gray-6">
<p className="text-center text-gray-12">
Shareable links are limited to 5 mins on the free plan.
Expand Down Expand Up @@ -282,7 +280,7 @@ export const ShareHeader = ({
)}
</Button>
</div>
{user !== null && !isUserPro && (
{!isVideoOwnerPro && (
<button
type="button"
className="flex items-center mt-2 mb-3 text-sm text-gray-400 duration-200 cursor-pointer hover:text-blue-500"
Expand Down
6 changes: 4 additions & 2 deletions apps/web/app/s/[videoId]/_components/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { userSelectProps } from "@cap/database/auth/session";
import type { comments as commentsSchema, videos } from "@cap/database/schema";
import { classNames } from "@cap/utils";
import { classNames, userIsPro } from "@cap/utils";
import type { Video } from "@cap/web-domain";
import clsx from "clsx";
import { AnimatePresence, motion } from "framer-motion";
Expand Down Expand Up @@ -141,6 +141,8 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>(
setActiveTab(tabId);
};

const isVideoOwnerPro = user && data.ownerId === user.id && userIsPro(user);

Comment on lines +144 to +145
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Compute isVideoOwnerPro as tri‑state and ensure boolean typing.

Current expression infers user | boolean and treats non‑owners as “not pro owners,” causing downstream owner‑only CTAs to show for viewers. Make it tri‑state: true (owner+pro), false (owner+not‑pro), null (not owner or no user).

-    const isVideoOwnerPro = user && data.ownerId === user.id && userIsPro(user);
+    const isOwner = user?.id === data.ownerId;
+    const isVideoOwnerPro: boolean | null = isOwner ? userIsPro(user) : null;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const isVideoOwnerPro = user && data.ownerId === user.id && userIsPro(user);
const isOwner = user?.id === data.ownerId;
const isVideoOwnerPro: boolean | null = isOwner ? userIsPro(user) : null;
🤖 Prompt for AI Agents
In apps/web/app/s/[videoId]/_components/Sidebar.tsx around lines 144-145, the
isVideoOwnerPro variable is currently inferred as user | boolean and treats
non-owners as false, which makes owner-only CTAs appear to viewers; change it to
a tri-state (true | false | null) by explicitly typing it (boolean | null) and
computing it as: if no user or user.id !== data.ownerId then null, otherwise set
to userIsPro(user) (true or false). Ensure the const declaration includes the
explicit type annotation (boolean | null) so downstream code can reliably
distinguish owner+pro (true), owner+not-pro (false), and not-owner/no-user
(null).

const renderTabContent = () => {
switch (activeTab) {
case "activity":
Expand Down Expand Up @@ -181,7 +183,7 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>(
isSummaryDisabled={videoSettings?.disableSummary}
initialAiData={aiData || undefined}
aiGenerationEnabled={aiGenerationEnabled}
user={user}
isVideoOwnerPro={isVideoOwnerPro}
/>
);
case "transcript":
Expand Down
13 changes: 5 additions & 8 deletions apps/web/app/s/[videoId]/_components/tabs/Summary.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use client";

import type { userSelectProps } from "@cap/database/auth/session";
import { Button } from "@cap/ui";
import { userIsPro } from "@cap/utils";
import type { Video } from "@cap/web-domain";
import { faRectangleList } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useEffect, useState } from "react";
Expand All @@ -13,7 +12,7 @@ interface Chapter {
}

interface SummaryProps {
videoId: string;
videoId: Video.VideoId;
onSeek?: (time: number) => void;
initialAiData?: {
title?: string | null;
Expand All @@ -22,8 +21,8 @@ interface SummaryProps {
processing?: boolean;
};
aiGenerationEnabled?: boolean;
user: typeof userSelectProps | null;
isSummaryDisabled?: boolean;
isVideoOwnerPro: boolean | null;
}

const formatTime = (time: number) => {
Expand Down Expand Up @@ -67,7 +66,7 @@ export const Summary: React.FC<SummaryProps> = ({
initialAiData,
isSummaryDisabled = false,
aiGenerationEnabled = false,
user,
isVideoOwnerPro,
}) => {
const [aiData, setAiData] = useState<{
title?: string | null;
Expand Down Expand Up @@ -95,12 +94,10 @@ export const Summary: React.FC<SummaryProps> = ({
}
};

const hasProAccess = userIsPro(user);

const hasExistingAiData =
aiData?.summary || (aiData?.chapters && aiData.chapters.length > 0);

if (!hasProAccess && !hasExistingAiData) {
if (!isVideoOwnerPro && !hasExistingAiData) {
return (
<div className="flex flex-col justify-center items-center p-8 h-full text-center">
<div className="space-y-4 max-w-sm">
Expand Down