Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(web): open the Transcript tab when landing from a stopped recording

Richie McIlroy7c59bc3cf852
diff --git a/apps/web/app/s/[videoId]/Share.tsx b/apps/web/app/s/[videoId]/Share.tsx
index 1811f0ec2..f2b39515d 100644
--- a/apps/web/app/s/[videoId]/Share.tsx
+++ b/apps/web/app/s/[videoId]/Share.tsx
@@ -586,6 +586,7 @@ export const Share = ({
videoId={data.id}
aiData={aiData}
aiGenerationEnabled={aiGenerationAvailable}
+ recordingStopped={recordingStopped}
ref={activityRef}
/>
</div>
diff --git a/apps/web/app/s/[videoId]/_components/Sidebar.tsx b/apps/web/app/s/[videoId]/_components/Sidebar.tsx
index be120a6da..1e298665f 100644
--- a/apps/web/app/s/[videoId]/_components/Sidebar.tsx
+++ b/apps/web/app/s/[videoId]/_components/Sidebar.tsx
@@ -45,6 +45,9 @@ interface SidebarProps {
} | null;
aiGenerationEnabled?: boolean;
isScreenshot?: boolean;
+ /** The owner just stopped this recording and landed here from the desktop
+ * app — surface the transcript, which is the thing appearing live. */
+ recordingStopped?: boolean;
}
const TabContent = motion.div;
@@ -86,6 +89,7 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>(
aiData,
aiGenerationEnabled = false,
isScreenshot = false,
+ recordingStopped = false,
},
ref,
) => {
@@ -96,18 +100,22 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>(
isOwner || (user && data.organizationMembers?.includes(user.id)),
);
+ const transcriptDisabled =
+ videoSettings?.disableTranscript ?? data.orgSettings?.disableTranscript;
+
const defaultTab =
- isScreenshot ||
- !(videoSettings?.disableComments ?? data.orgSettings?.disableComments)
- ? "activity"
- : !(videoSettings?.disableSummary ?? data.orgSettings?.disableSummary)
- ? "summary"
- : !(
- videoSettings?.disableTranscript ??
- data.orgSettings?.disableTranscript
- )
- ? "transcript"
- : "activity";
+ // Landing right after stopping a recording: the transcript is what's
+ // appearing within seconds — show it instead of empty comments.
+ recordingStopped && !isScreenshot && !transcriptDisabled
+ ? "transcript"
+ : isScreenshot ||
+ !(videoSettings?.disableComments ?? data.orgSettings?.disableComments)
+ ? "activity"
+ : !(videoSettings?.disableSummary ?? data.orgSettings?.disableSummary)
+ ? "summary"
+ : !transcriptDisabled
+ ? "transcript"
+ : "activity";
const [activeTab, setActiveTab] = useState<TabType>(defaultTab);
const [[page, direction], setPage] = useState([0, 0]);